for(int i=1;i<=n<<1;i++)
for(int j=1;j<=m<<1;j++)
sum[i][j]=sum[i][j-1]*base1+a[i][j];
for(int i=1;i<=n<<1;i++)
for(int j=1;j<=m<<1;j++)
sum[i][j]+=sum[i-1][j]*base2;
// rep(i, 1, n << 1) {
// rep(j, 1, m << 1) {
// sum[i][j] = sum[i][j - 1] * base1 + sum[i - 1][j] * base2 + a[i][j];
// }
// }
为什么下面那段hash计算是错的。有点迷惑,当成二维前缀和计算是错的。