正文
增加 1 行删除 1 行
25 行未改动26272829303132333418 行未改动25 行未改动int sum[1010][1010];ll q1(int x, int y) {ll t1 = x / n, t2 = y / n;ll k = 1ll * t1 * t2; ll res = k * cnt;x %= n, y %= n;res += sum[x][n] * t2, res += sum[n][y] * t1;res += sum[x][y];return res;}18 行未改动25 行未改动26272829303132333418 行未改动25 行未改动int sum[1010][1010];ll q1(int x, int y) {ll t1 = x / n, t2 = y / n;ll k = 1ll * t1 * t2; ll res = k * cnt;x %= n, y %= n;res += sum[x][n] * t2, res += sum[n][y] * t1;res += sum[x][y];return res;}18 行未改动