版本比较
FHQ-Treap 模板
正文
增加 1 行删除 1 行
26 行未改动27282930313132333435175 行未改动全部展开26 行未改动 struct O {FILE *out; char obuf[N], *p3; O() {p3 = obuf, out = stdout;} O(FILE *f) {p3 = obuf, out = f;} ~O() {flush();} O & operator = (FILE *f) {return flush(), out = f, *this;} void flush() {fwrite(obuf, p3 - obuf, 1, out), p3 = obuf;} int close() {return flush(), fclose(out);} void pc(char x) {*p3 ++ = x; if (p3 - obuf == N) flush();} template<typename ...Args> int printf(const char *format, Args ...args) {char s[1 << 23], *t = s; sprintf(s, format, args...); while (*t) pc(*t ++ ); return t - s;} template<typename T> void writeint(const T &x) {T y = x; if (!y) return pc('0'); if (y < 0) pc('-'), y = -y; char c[1 << 6]; int len = 0; while (y) c[ ++ len] = y % 10 + '0', y /= 10; while (len) pc(c[len -- ]);} template<typename T> void operator () (const T &x) {writeint<T>(x);} void operator () (const char &x) {pc(x);} void operator () (const std :: string &s) {for (char i : s) pc(i);} void operator () (char *s) {while (*s) pc(*s ++ );} void operator () (const char *s) {while (*s) pc(*s ++ );} template<typename T> void writefloat(const flt<T> &x) {T y = x.num; int r = x.pcs; if (y < 0) pc('-'), y = -y; T f = 5; for (int i = 1; i <= r + 1; i ++ ) f *= 0.1; y += f; char c[1 << 8]; int len = 0; if (y < 1) pc('0'); for (T t = std :: floor(y); t >= 1; t = std :: floor(t * 0.1)) c[ ++ len] = (int)(t - std :: floor(t * 0.1) * 10) + '0'; while (len) pc(c[len -- ]); if (!r) return ; pc('.'); for (T t = (y - std :: floor(y)) * 10; r; t = (t - std :: floor(t)) * 10, r -- ) pc((int)t + '0');} template<typename T> void operator () (const flt<T> &x) {writefloat<T>(x);} void operator () (const float &x) {writefloat(flt<float>(x, 6));} void operator () (const double &x) {writefloat(flt<double>(x, 6));} void operator () (const long double &x) {writefloat(flt<long double>(x, 6));} template<typename T, typename ...Args> void operator () (const T &x, const Args &...args) {operator () (x), operator () (args...);}};} IO :: I read; IO :: O write, debug = stderr; using IO :: flt;inline void initialize(){
}namespace solve{ const int N = 1e5;175 行未改动全部展开