一定要看数组开够了没,n,m≤20n,m \le 20n,m≤20 的情况一定要开到 a[21][41]\text a[21][41]a[21][41]。
本蒟蒻就因为这个 【数据删除】 的问题调了 10min10 \text{min}10min 太弱了/cf。