版本比较
2025 Autumn XYD Lessons 9.9 模考
正文
增加 6 行删除 6 行
32 行未改动3334353637383940414264 行未改动10710810911011111211311411531 行未改动1471481491501511521531541551566 行未改动1631641651661671681691701717 行未改动32 行未改动#define rson mid + 1, r, rt << 1 | 1#define BCNT __builtin_popcount#define cost_time (1e3 * clock() / CLOCKS_PER_SEC) << "ms"#define cost_space (abs(&MemoryST - &MemoryED) / 1024.0 / 1024.0) << "MB"const int inf = 0x3f3f3f3f;const ll linf = 1e18;mt19937 rnd(random_device{}());template<typename T> void chkmax(T& x, T y) { x = max(x, y); }template<typename T> void chkmin(T& x, T y) { x = min(x, y); }template<typename T> T abs(T x) { return (x < 0) ? -x : x; }64 行未改动}} else {below[i][j] = below[i + 1][j];rightlen[i][j] = downlen[i][j] = 0;if (mp[i][j + 1] == 1)st[top = 1] = Node(j + 1, 0), sufsum[1] = 0, cur = 0;int h = below[i][j] - i;for (; top > 0 && h <= st[top].h; top --)cur -= st[top].h * (st[top - 1].x - st[top].x);31 行未改动#define rson mid + 1, r, rt << 1 | 1#define BCNT __builtin_popcount#define cost_time (1e3 * clock() / CLOCKS_PER_SEC) << "ms"#define cost_space (abs(&MemoryST - &MemoryED) / 1024.0 / 1024.0) << "MB"const int inf = 0x3f3f3f3f;const ll linf = 1e18;mt19937 rnd(random_device{}());template<typename T> void chkmax(T& x, T y) { x = max(x, y); }template<typename T> void chkmin(T& x, T y) { x = min(x, y); }template<typename T> T abs(T x) { return (x < 0) ? -x : x; }6 行未改动for (int i = 1; i <= n; i ++) scanf("%d", &a[i]);f[0].reset(), f[0][0] = 1; int o = 0;for (; m | s; s >>= 1, m >>= 1) {if (m & 1) {f[o ^= 1].reset();for (int x = f[o ^ 1]._Find_next(-1); x <= 200000; x = f[o ^ 1]._Find_next(x))for (int i = 1; i <= n; i ++)f[o].flip(a[i] + x);} f[o ^= 1].reset();7 行未改动32 行未改动3334353637383940414264 行未改动10710810911011111211311411531 行未改动1471481491501511521531541551566 行未改动1631641651661671681691701717 行未改动32 行未改动#define rson mid + 1, r, rt << 1 | 1#define BCNT __builtin_popcount#define cost_time (1e3 * clock() / CLOCKS_PER_SEC) << "ms"#define cost_space (abs(&MemoryST - &MemoryED) / 1024.0 / 1024.0) << "MB"const int inf = 0x3f3f3f3f;const ll linf = 1e18;mt19937 rnd(random_device{}());template<typename T> void chkmax(T& x, T y) { x = max(x, y); }template<typename T> void chkmin(T& x, T y) { x = min(x, y); }template<typename T> T abs(T x) { return (x < 0) ? -x : x; }64 行未改动}} else {below[i][j] = below[i + 1][j];rightlen[i][j] = downlen[i][j] = 0;if (mp[i][j + 1] == 1)st[top = 1] = Node(j + 1, 0), sufsum[1] = 0, cur = 0;int h = below[i][j] - i;for (; top > 0 && h <= st[top].h; top --)cur -= st[top].h * (st[top - 1].x - st[top].x);31 行未改动#define rson mid + 1, r, rt << 1 | 1#define BCNT __builtin_popcount#define cost_time (1e3 * clock() / CLOCKS_PER_SEC) << "ms"#define cost_space (abs(&MemoryST - &MemoryED) / 1024.0 / 1024.0) << "MB"const int inf = 0x3f3f3f3f;const ll linf = 1e18;mt19937 rnd(random_device{}());template<typename T> void chkmax(T& x, T y) { x = max(x, y); }template<typename T> void chkmin(T& x, T y) { x = min(x, y); }template<typename T> T abs(T x) { return (x < 0) ? -x : x; }6 行未改动for (int i = 1; i <= n; i ++) scanf("%d", &a[i]);f[0].reset(), f[0][0] = 1; int o = 0;for (; m | s; s >>= 1, m >>= 1) {if (m & 1) {f[o ^= 1].reset();for (int x = f[o ^ 1]._Find_next(-1); x <= 200000; x = f[o ^ 1]._Find_next(x))for (int i = 1; i <= n; i ++)f[o].flip(a[i] + x);} f[o ^= 1].reset();7 行未改动