版本比较
P15588 [KTSC 2026] 飞扬的松鼠 2 / Flying Squirrel 2
正文
增加 4 行删除 4 行
55 行未改动56575859606162636427 行未改动92939495969798991003 行未改动1041051061071081091101111123 行未改动116117118119120121122123124103 行未改动全部展开55 行未改动struct node {int c0, c1, c2, c01, c12, c012;pll x1, x2, mn;node() {c0 = c1 = c2 = c01 = c12 = c012 = 0;x1 = x2 = mn = pll(inf, 0);}27 行未改动namespace SGT {node a[maxn << 2];int N;inline void init() {N = (1 << (__lg(n + 1) + 1));for (int i = 1; i <= n; ++i) {a[N + i].c0 = a[N + i].c01 = f[i];3 行未改动for (int i = N; i; --i) {a[i] = a[i << 1] + a[i << 1 | 1];}}inline void update(int x, int y, pll z) {x += N;a[x].c1 += y;a[x].c01 = max(a[x].c0, a[x].c1);3 行未改动while (x >>= 1) {a[x] = a[x << 1] + a[x << 1 | 1];}}inline node query(int l, int r) {if (l > r) {return node();}103 行未改动全部展开55 行未改动56575859606162636427 行未改动92939495969798991003 行未改动1041051061071081091101111123 行未改动116117118119120121122123124103 行未改动全部展开55 行未改动struct node {int c0, c1, c2, c01, c12, c012;pll x1, x2, mn;node() {c0 = c1 = c2 = c01 = c12 = c012 = 0;x1 = x2 = mn = pll(inf, 0);}27 行未改动namespace SGT {node a[maxn << 2];int N;inline void init() {N = (1 << (__lg(n + 1) + 1));for (int i = 1; i <= n; ++i) {a[N + i].c0 = a[N + i].c01 = f[i];3 行未改动for (int i = N; i; --i) {a[i] = a[i << 1] + a[i << 1 | 1];}}inline void update(int x, int y, pll z) {x += N;a[x].c1 += y;a[x].c01 = max(a[x].c0, a[x].c1);3 行未改动while (x >>= 1) {a[x] = a[x << 1] + a[x << 1 | 1];}}inline node query(int l, int r) {if (l > r) {return node();}103 行未改动全部展开