C. Ramesses and Corner Inversion 官方题解解读

    原文:

One can notice that the operation does not change the total parity of the matrix. So, if the total parity of AA and BB do not match, then the answer is No. However, this is not the only case when the answer is no.

You can also notice that the operation does not change the total parity of each row/column independently. Thus, if in at least one row or column the parity of AA and BB do not match, then the answer is No. It turns out that if all these parities match, then the answer is Yes.

We will prove this constructing a sequence of operations that transforms AA to BB whenever parities in all rows and column match. Let's perform an operation (1,1,x,y)(1,1,x,y) for all such x>1x>1 and y>1y>1 that Axy≠BxyAxy≠Bxy. After all these operations the whole matrices except maybe the first column and the first row match. But the first column and the first row also match because of the parity! So AA is now BB.

    解读 :

    前提条件:整体奇偶性相同,各行奇偶性相同,各列奇偶性相同。
    operatxon (1,1,x,y) 不会改变整体的奇偶性,不会改变每一行的奇偶性,不会改变每一列的奇偶性。
    那么,当我对所有的A[x][y](x>1&&y>1,A[x][y]!=B[x][y])执行operatxon (1,1,x,y)后,首先这些原本和B[x][y]不同的A[x][y]会变得和B[x][y]相同。
    然后从行奇偶性相同的角度出发,对于第p行(p>1)来说,A[p][y]=B[p][y](y>1),由于有行奇偶性相同,则一定会使A[p][1]=B[p][1].
    从列奇偶性相同的角度出发,对于第p列(p>1)来说,A[x][p]=B[x][p](x>1),由于有列奇偶性相同,则一定会使 A[1][p]=B[1][p].
    对于A[1][1]来说,你可以从三个角度来看是否相等,例如从整体奇偶性来看,我们已经证明A[x][y]=B[x][y](x!=1&&y!=1),那么由于有整体奇偶性相同,则一定会使A[1][1]=B[1][1].
    -----------------
    话说,行列奇偶性相同,是不是意味着整体奇偶性相同呢?
    答:从一方考虑就行了,如果行列奇偶性混合考虑起来会很混乱。
    行奇偶性相同,则整体奇偶性相同:
    整体奇偶性=sum(各行奇偶性)
    列奇偶性相同,则整体奇偶性相同:
    整体奇偶性=sum(各列奇偶性)
 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值