版本比较
P12478 [集训队互测 2024] Désive
正文
增加 13 行删除 13 行
27 行未改动28293031323334353611 行未改动48495051525354555613 行未改动7071727374757677785 行未改动8485868788899091929 行未改动1021031041051061071081091104 行未改动11511611711811912012112212312412512612712812913 行未改动143144145146147148149150151152153154155156157128 行未改动全部展开28628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631788 行未改动27 行未改动// Contest: Luogu// URL: https://www.luogu.com.cn/problem/P12478// Memory Limit: 512 MB// Time Limit: 6000 ms//// Powered by CP Editor (https://cpeditor.org)#include <bits/stdc++.h>#define pb emplace_back11 行未改动using pll = pair<ll, ll>;namespace IO {const int maxn = 1 << 20;char ibuf[maxn], *iS, *iT, obuf[maxn], *oS = obuf;inline char gc() {return (iS == iT ? iT = (iS = ibuf) + fread(ibuf, 1, maxn, stdin), (iS == iT ? EOF : *iS++) : *iS++);13 行未改动c = gc();}return f ? ~(x - 1) : x;}inline int reads(char *s) {char c = gc();int len = 0;while (isspace(c)) {5 行未改动}s[len] = '\0';return len;}inline string reads() {char c = gc();string s;while (isspace(c)) {9 行未改动inline void flush() {fwrite(obuf, 1, oS - obuf, stdout);oS = obuf;}struct Flusher {~Flusher() {flush();}4 行未改动flush();}*oS++ = ch;}inline void write(char *s) {for (int i = 0; s[i]; ++i) {pc(s[i]);}}inline void write(const char *s) {for (int i = 0; s[i]; ++i) {pc(s[i]);}13 行未改动while (tp != stk) {pc((*--tp) | 48);}}template<typename T>inline void writesp(T x) {write(x);pc(' ');}template<typename T>inline void writeln(T x) {write(x);pc('\n');128 行未改动全部展开}struct BIT {ll a[maxn], b[maxn];inline void update(int x, ll d) {for (int i = x; i <= (1 << n); i += (i & (-i))) {a[i] += d;b[i] += x * d;}}inline void update(int l, int r, ll x) {if (!x) {return;}update(l, x);update(r + 1, -x);}inline ll query(int x) {ll res = 0;for (int i = x; i; i -= (i & (-i))) {res += a[i] * (x + 1) - b[i];}return res;}inline ll query(int l, int r) {return query(r) - query(l - 1);}} T1, T2;88 行未改动27 行未改动28293031323334353611 行未改动48495051525354555613 行未改动7071727374757677785 行未改动8485868788899091929 行未改动1021031041051061071081091104 行未改动11511611711811912012112212312412512612712812913 行未改动143144145146147148149150151152153154155156157128 行未改动全部展开28628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631788 行未改动27 行未改动// Contest: Luogu// URL: https://www.luogu.com.cn/problem/P12478// Memory Limit: 512 MB// Time Limit: 6000 ms//// Powered by CP Editor (https://cpeditor.org)#include <bits/stdc++.h>#define pb emplace_back11 行未改动using pll = pair<ll, ll>;namespace IO {const int maxn = 1 << 20;char ibuf[maxn], *iS, *iT, obuf[maxn], *oS = obuf;inline char gc() {return (iS == iT ? iT = (iS = ibuf) + fread(ibuf, 1, maxn, stdin), (iS == iT ? EOF : *iS++) : *iS++);13 行未改动c = gc();}return f ? ~(x - 1) : x;}inline int reads(char *s) {char c = gc();int len = 0;while (isspace(c)) {5 行未改动}s[len] = '\0';return len;}inline string reads() {char c = gc();string s;while (isspace(c)) {9 行未改动inline void flush() {fwrite(obuf, 1, oS - obuf, stdout);oS = obuf;}struct Flusher {~Flusher() {flush();}4 行未改动flush();}*oS++ = ch;}inline void write(char *s) {for (int i = 0; s[i]; ++i) {pc(s[i]);}}inline void write(const char *s) {for (int i = 0; s[i]; ++i) {pc(s[i]);}13 行未改动while (tp != stk) {pc((*--tp) | 48);}}template<typename T>inline void writesp(T x) {write(x);pc(' ');}template<typename T>inline void writeln(T x) {write(x);pc('\n');128 行未改动全部展开}struct BIT {ll a[maxn], b[maxn];inline void update(int x, ll d) {for (int i = x; i <= (1 << n); i += (i & (-i))) {a[i] += d;b[i] += x * d;}}inline void update(int l, int r, ll x) {if (!x) {return;}update(l, x);update(r + 1, -x);}inline ll query(int x) {ll res = 0;for (int i = x; i; i -= (i & (-i))) {res += a[i] * (x + 1) - b[i];}return res;}inline ll query(int l, int r) {return query(r) - query(l - 1);}} T1, T2;88 行未改动