版本比较
P15810 [JOI 2013 Final] 冒泡排序 / Bubble Sort
正文
增加 7 行删除 7 行
15 行未改动1617181920202122232422 行未改动47484950515152535455565757585960613 行未改动65666768696970717273737475767778787980818283848586878788899091178 行未改动全部展开15 行未改动// Contest: Luogu// URL: https://www.luogu.com.cn/problem/P15810// Memory Limit: 256 MB// Time Limit: 1000 ms// //// Powered by CP Editor (https://cpeditor.org)
#include <bits/stdc++.h>#define pb emplace_back22 行未改动vector<line> md[maxn];
namespace BIT { int c[maxn];
inline void update(int x, int d) { for (int i = x; i <= tot; i += (i & (-i))) { c[i] += d; } }
inline int query(int x) { int res = 0; for (int i = x; i; i -= (i & (-i))) { res += c[i];3 行未改动}
namespace SGT { int a[maxn << 2], tag[maxn << 2];
inline void pushup(int x) { a[x] = max(a[x << 1], a[x << 1 | 1]); }
inline void pushtag(int x, int y) { a[x] += y; tag[x] += y; }
inline void pushdown(int x) { if (!tag[x]) { return; } pushtag(x << 1, tag[x]); pushtag(x << 1 | 1, tag[x]); tag[x] = 0; }
void update(int rt, int l, int r, int ql, int qr, int x) { if (ql <= l && r <= qr) { pushtag(rt, x); return;178 行未改动全部展开