摘要:
思路:这个分清楚情况就很好做了。注意一点当A的转置等于B的时候(对角线除外),记录A的下三角(或上三角)有cnt个的数与B不同,如果cnt>1则不需要额外的步数就可以了,否则当k==2时结果要加2,反之加1.代码如下: 1 #include 2 #include 3 #define M 105 4 using namespace std; 5 int a[M][M],b[M][M],n; 6 bool is() 7 { 8 for(int i=0;i1) return 0;22 return 1;23 }24 int main()25 {26 int t,ca=0,... 阅读全文