版本比较
P2474 [SCOI2008] 天平 题解
正文
增加 2 行删除 2 行
17 行未改动1819202122222324252648 行未改动757677787979808182838417 行未改动
这样,对于每个条件,我们做出如下操作:
- 若关系为 ```=```,考虑极限情况,则 $fx_{i,j}=0$ 且 $fn_{i,j}=0$。
- 若关系为 ```-```,考虑极限情况,则 $fx_{i,j}=-1$ 且 $fn_{i,j}=-2$。
- 若关系为 ```+```,考虑极限情况,则 $fx_{i,j}=2$ 且 $fn_{i,j}=1$。
48 行未改动 if((fn[a][j]==fx[a][j]&&fx[a][j]==fn[i][b]&&fn[i][b]==fx[i][b])|| (fn[a][i]==fx[j][b]&&fx[j][b]==fx[a][i]&&fx[a][i]==fn[j][b])) cnt2++; } } printf("%d %d %d\n",cnt1,cnt2,cnt3); printf("%d %d %d\n",cnt1,cnt2,cnt3); return 0;}```
写的时候注意搞清楚关系。~~希望对你有帮助qwq~~