diff --git a/.clang-format b/.clang-format index 5e59cc3e..433f8e78 100644 --- a/.clang-format +++ b/.clang-format @@ -5,11 +5,37 @@ ColumnLimit: 0 IndentWidth: 4 AccessModifierOffset: -2 NamespaceIndentation: All +AlignOperands: AlignAfterOperator AllowShortLoopsOnASingleLine: true AllowShortBlocksOnASingleLine: true AllowShortFunctionsOnASingleLine: Empty AllowShortCaseLabelsOnASingleLine: true -AllowShortIfStatementsOnASingleLine: true +AllowShortIfStatementsOnASingleLine: AllIfsAndElse EmptyLineBeforeAccessModifier: LogicalBlock SeparateDefinitionBlocks: Always PointerAlignment: Right +BinPackArguments: false +BinPackParameters: false +PackConstructorInitializers: CurrentLine +IncludeCategories: + - Regex: '^' + Priority: 2 + SortPriority: 0 + CaseSensitive: false + - Regex: '^<.*\.h>' + Priority: 1 + SortPriority: 0 + CaseSensitive: false + - Regex: '^<(iostream|cstdio)>' + Priority: 2 + SortPriority: 1 + CaseSensitive: false + - Regex: '^<.*' + Priority: 2 + SortPriority: 0 + CaseSensitive: false + - Regex: '.*' + Priority: 3 + SortPriority: 0 + CaseSensitive: false +# InsertBraces: true ## clang-format 15 diff --git a/.prettierrc b/.prettierrc index f37b9d11..ee7252bd 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,17 +1,36 @@ { - "tabWidth": 4, - "overrides": [ - { - "files": "*.md", - "options": { - "tabWidth": 2 - } - }, - { - "files": "*.y{,a}ml", - "options": { - "tabWidth": 2 - } - } - ] + "tabWidth": 4, + "singleQuote": true, + "overrides": [ + { + "files": "*.md", + "options": { + "tabWidth": 2 + } + }, + { + "files": "*.y{,a}ml", + "options": { + "tabWidth": 2 + } + }, + { + "files": "*.json", + "options": { + "tabWidth": 2 + } + }, + { + "files": ".prettierrc", + "options": { + "tabWidth": 2 + } + }, + { + "files": ".clang-format", + "options": { + "tabWidth": 2 + } + } + ] } diff --git a/AcWing/1183/1183.cpp b/AcWing/1183/1183.cpp index 51122fb7..a4538de2 100644 --- a/AcWing/1183/1183.cpp +++ b/AcWing/1183/1183.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include #include diff --git a/AcWing/1279/1279.cpp b/AcWing/1279/1279.cpp index 8f1716f3..d5dc4992 100644 --- a/AcWing/1279/1279.cpp +++ b/AcWing/1279/1279.cpp @@ -104,10 +104,20 @@ struct node { int l, r, s, d, lc, rc; node() - : l(0), r(0), s(0), d(0), lc(0), rc(0) {} + : l(0), + r(0), + s(0), + d(0), + lc(0), + rc(0) {} node(int _l, int _r) - : l(_l), r(_r), s(0), d(0), lc(0), rc(0) {} + : l(_l), + r(_r), + s(0), + d(0), + lc(0), + rc(0) {} } tr[N << 2]; inline void pushup(int u) { diff --git a/AcWing/1302/1302.cpp b/AcWing/1302/1302.cpp index 893430bd..3786dcee 100644 --- a/AcWing/1302/1302.cpp +++ b/AcWing/1302/1302.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/AcWing/202/202.cpp b/AcWing/202/202.cpp index 084f335e..700deb54 100644 --- a/AcWing/202/202.cpp +++ b/AcWing/202/202.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include using std::cin; diff --git a/AcWing/2041/2041.cpp b/AcWing/2041/2041.cpp index 801b043c..db785dcc 100644 --- a/AcWing/2041/2041.cpp +++ b/AcWing/2041/2041.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/AcWing/205/205.cpp b/AcWing/205/205.cpp index 011c0ba9..e2a9e5aa 100644 --- a/AcWing/205/205.cpp +++ b/AcWing/205/205.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/AcWing/207/207.cpp b/AcWing/207/207.cpp index 8ee06aef..250a84f0 100644 --- a/AcWing/207/207.cpp +++ b/AcWing/207/207.cpp @@ -1,7 +1,7 @@ +#include #include #include #include -#include using std::cin; using std::cout; diff --git a/AcWing/208/208.cpp b/AcWing/208/208.cpp index 0f203efb..db2ae963 100644 --- a/AcWing/208/208.cpp +++ b/AcWing/208/208.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/AcWing/2171/2171.cpp b/AcWing/2171/2171.cpp index 4ba375c0..3a20a71d 100644 --- a/AcWing/2171/2171.cpp +++ b/AcWing/2171/2171.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include #include diff --git a/AcWing/2172/2172.cpp b/AcWing/2172/2172.cpp index 7eeea751..56baf210 100644 --- a/AcWing/2172/2172.cpp +++ b/AcWing/2172/2172.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include using std::cin; diff --git a/AcWing/2173/2173.cpp b/AcWing/2173/2173.cpp index f93fb07b..0faf427a 100644 --- a/AcWing/2173/2173.cpp +++ b/AcWing/2173/2173.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include using std::cin; diff --git a/AcWing/2234/2234.cpp b/AcWing/2234/2234.cpp index 199b82e2..6e239c2c 100644 --- a/AcWing/2234/2234.cpp +++ b/AcWing/2234/2234.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include #include diff --git a/AcWing/2437/2437.cpp b/AcWing/2437/2437.cpp index aaa6b1a0..638c788a 100644 --- a/AcWing/2437/2437.cpp +++ b/AcWing/2437/2437.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; @@ -14,10 +14,20 @@ struct node { bool d; node() - : l(0), r(0), s(0), v(0), d(false), k(rand()) {} + : l(0), + r(0), + s(0), + v(0), + d(false), + k(rand()) {} node(int _v) - : l(0), r(0), s(1), v(_v), d(false), k(rand()) {} + : l(0), + r(0), + s(1), + v(_v), + d(false), + k(rand()) {} } tr[N]; void pushup(int u) { diff --git a/AcWing/247/247.cpp b/AcWing/247/247.cpp index 918f7f6c..b510273b 100644 --- a/AcWing/247/247.cpp +++ b/AcWing/247/247.cpp @@ -10,10 +10,16 @@ struct segment { int k; segment() - : x(0), y1(0), y2(0), k(0) {} + : x(0), + y1(0), + y2(0), + k(0) {} segment(double _x, double _y1, double _y2, int _k) - : x(_x), y1(_y1), y2(_y2), k(_k) {} + : x(_x), + y1(_y1), + y2(_y2), + k(_k) {} bool operator<(const segment& b) const { return x < b.x; @@ -25,10 +31,16 @@ struct node { double len; node() - : l(0), r(0), cnt(0), len(0) {} + : l(0), + r(0), + cnt(0), + len(0) {} node(int _l, int _r) - : l(_l), r(_r), cnt(0), len(0) {} + : l(_l), + r(_r), + cnt(0), + len(0) {} } tr[10005 << 3]; int find(double y) { diff --git a/AcWing/252/252.cpp b/AcWing/252/252.cpp index 873b326d..8cfb17ad 100644 --- a/AcWing/252/252.cpp +++ b/AcWing/252/252.cpp @@ -1,6 +1,6 @@ +#include #include #include -#include #include using std::cin; diff --git a/AcWing/253/253.cpp b/AcWing/253/253.cpp index fac60340..49b0a674 100644 --- a/AcWing/253/253.cpp +++ b/AcWing/253/253.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; @@ -45,10 +45,18 @@ struct node { int l, r, s, v, k; node() - : l(0), r(0), s(0), v(0), k(rand()) {} + : l(0), + r(0), + s(0), + v(0), + k(rand()) {} node(int _v) - : l(0), r(0), s(1), v(_v), k(rand()) {} + : l(0), + r(0), + s(1), + v(_v), + k(rand()) {} } tr[N]; inline void pushup(int u) { diff --git a/AcWing/255/255.cpp b/AcWing/255/255.cpp index d72da705..23570b39 100644 --- a/AcWing/255/255.cpp +++ b/AcWing/255/255.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include #include @@ -52,7 +52,9 @@ struct node { int l, r, c; node() - : l(0), r(0), c(0) {} + : l(0), + r(0), + c(0) {} } tr[N << 5]; int build(int l, int r) { diff --git a/AcWing/2568/2568.cpp b/AcWing/2568/2568.cpp index 87f911f4..64f7a20d 100644 --- a/AcWing/2568/2568.cpp +++ b/AcWing/2568/2568.cpp @@ -11,10 +11,16 @@ struct node { long long s, d; node() - : l(0), r(0), s(0), d(0) {} + : l(0), + r(0), + s(0), + d(0) {} node(int _l, int _r) - : l(_l), r(_r), s(0), d(0) {} + : l(_l), + r(_r), + s(0), + d(0) {} } tr[100005 << 2]; void dfs1(int u, int father) { diff --git a/AcWing/281/281.cpp b/AcWing/281/281.cpp index f7a9fb0f..504a19ff 100644 --- a/AcWing/281/281.cpp +++ b/AcWing/281/281.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/AcWing/2815/2815.cpp b/AcWing/2815/2815.cpp index 9b78fc80..edc5c8c9 100644 --- a/AcWing/2815/2815.cpp +++ b/AcWing/2815/2815.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; @@ -11,10 +11,18 @@ struct node { int a, b, c, cnt, res; node() - : a(0), b(0), c(0), cnt(0), res(0) {} + : a(0), + b(0), + c(0), + cnt(0), + res(0) {} node(int _a, int _b, int _c) - : a(_a), b(_b), c(_c), cnt(1), res(0) {} + : a(_a), + b(_b), + c(_c), + cnt(1), + res(0) {} bool operator<(const node& x) const { return a == x.a ? b == x.b ? c < x.c : b < x.b : a < x.a; diff --git a/AcWing/283/283.cpp b/AcWing/283/283.cpp index 902f0f7e..b3ec8594 100644 --- a/AcWing/283/283.cpp +++ b/AcWing/283/283.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include using std::cin; diff --git a/AcWing/3068/3068.cpp b/AcWing/3068/3068.cpp index 5deffd3e..6737eae9 100644 --- a/AcWing/3068/3068.cpp +++ b/AcWing/3068/3068.cpp @@ -10,10 +10,16 @@ struct segment { int x, y1, y2, k; segment() - : x(0), y1(0), y2(0), k(0) {} + : x(0), + y1(0), + y2(0), + k(0) {} segment(int _x, int _y1, int _y2, int _k) - : x(_x), y1(_y1), y2(_y2), k(_k) {} + : x(_x), + y1(_y1), + y2(_y2), + k(_k) {} bool operator<(const segment& b) const { return x < b.x; @@ -25,10 +31,16 @@ struct node { long long cnt, len; node() - : l(0), r(0), cnt(0), len(0) {} + : l(0), + r(0), + cnt(0), + len(0) {} node(int _l, int _r) - : l(_l), r(_r), cnt(0), len(0) {} + : l(_l), + r(_r), + cnt(0), + len(0) {} } tr[100005 << 3]; int find(int y) { diff --git a/AcWing/381/381.cpp b/AcWing/381/381.cpp index 97b71e72..bc2dbe1f 100644 --- a/AcWing/381/381.cpp +++ b/AcWing/381/381.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include #include diff --git a/AcWing/739/739.cpp b/AcWing/739/739.cpp index 6f03ef02..62d0b5c5 100644 --- a/AcWing/739/739.cpp +++ b/AcWing/739/739.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/AcWing/802/802.cpp b/AcWing/802/802.cpp index 130a4180..b578db18 100644 --- a/AcWing/802/802.cpp +++ b/AcWing/802/802.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include using std::cin; diff --git a/AcWing/808/808.cpp b/AcWing/808/808.cpp index cbc78e01..d6093df9 100644 --- a/AcWing/808/808.cpp +++ b/AcWing/808/808.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/AcWing/883/883.cpp b/AcWing/883/883.cpp index 94366cd2..19208b7d 100644 --- a/AcWing/883/883.cpp +++ b/AcWing/883/883.cpp @@ -1,6 +1,6 @@ +#include #include #include -#include using std::cin; using std::cout; diff --git a/AcWing/884/884.cpp b/AcWing/884/884.cpp index 138f011e..1142398a 100644 --- a/AcWing/884/884.cpp +++ b/AcWing/884/884.cpp @@ -1,6 +1,6 @@ +#include #include #include -#include using std::cin; using std::cout; diff --git a/AcWing/899/899.cpp b/AcWing/899/899.cpp index 581563d7..84a3fe86 100644 --- a/AcWing/899/899.cpp +++ b/AcWing/899/899.cpp @@ -1,6 +1,6 @@ +#include #include #include -#include using std::cin; using std::cout; diff --git a/AcWing/9/9.cpp b/AcWing/9/9.cpp index 21bd38ac..f5e8c2ef 100644 --- a/AcWing/9/9.cpp +++ b/AcWing/9/9.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include using std::cin; diff --git a/AcWing/902/902.cpp b/AcWing/902/902.cpp index 30bcc6da..d3b35c26 100644 --- a/AcWing/902/902.cpp +++ b/AcWing/902/902.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/AcWing/918/918.cpp b/AcWing/918/918.cpp index 62fcbd47..baea57ce 100644 --- a/AcWing/918/918.cpp +++ b/AcWing/918/918.cpp @@ -101,10 +101,16 @@ struct node { int l, r, s, d; node() - : l(0), r(0), s(0), d(-1) {} + : l(0), + r(0), + s(0), + d(-1) {} node(int _l, int _r) - : l(_l), r(_r), s(0), d(-1) {} + : l(_l), + r(_r), + s(0), + d(-1) {} } tr[N << 2]; inline void pushup(int u) { diff --git a/AtCoder/ABC231/A/A.cpp b/AtCoder/ABC231/A/A.cpp index 21f64d05..04dc59b6 100644 --- a/AtCoder/ABC231/A/A.cpp +++ b/AtCoder/ABC231/A/A.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/AtCoder/ABC231/C/C.cpp b/AtCoder/ABC231/C/C.cpp index 02f36a94..526609d9 100644 --- a/AtCoder/ABC231/C/C.cpp +++ b/AtCoder/ABC231/C/C.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/AtCoder/ABC242/A/A.cpp b/AtCoder/ABC242/A/A.cpp index f66f231d..cd38b4a4 100644 --- a/AtCoder/ABC242/A/A.cpp +++ b/AtCoder/ABC242/A/A.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/AtCoder/ABC242/B/B.cpp b/AtCoder/ABC242/B/B.cpp index a34db960..324393f0 100644 --- a/AtCoder/ABC242/B/B.cpp +++ b/AtCoder/ABC242/B/B.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include using std::cin; diff --git a/AtCoder/ABC243/B/B.cpp b/AtCoder/ABC243/B/B.cpp index 57bc9385..dd6a614f 100644 --- a/AtCoder/ABC243/B/B.cpp +++ b/AtCoder/ABC243/B/B.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/AtCoder/ABC243/D/D.cpp b/AtCoder/ABC243/D/D.cpp index f383d980..d16947ff 100644 --- a/AtCoder/ABC243/D/D.cpp +++ b/AtCoder/ABC243/D/D.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include #include diff --git a/AtCoder/ABC245/B/B.cpp b/AtCoder/ABC245/B/B.cpp index 1247c6db..865cb1e9 100644 --- a/AtCoder/ABC245/B/B.cpp +++ b/AtCoder/ABC245/B/B.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/AtCoder/ABC245/C/C.cpp b/AtCoder/ABC245/C/C.cpp index ddbcaa52..52054275 100644 --- a/AtCoder/ABC245/C/C.cpp +++ b/AtCoder/ABC245/C/C.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/AtCoder/ABC245/F/F.cpp b/AtCoder/ABC245/F/F.cpp index 7086b0f6..2ecad8d1 100644 --- a/AtCoder/ABC245/F/F.cpp +++ b/AtCoder/ABC245/F/F.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include #include diff --git a/AtCoder/ABC246/B/B.cpp b/AtCoder/ABC246/B/B.cpp index 67a92574..865f5beb 100644 --- a/AtCoder/ABC246/B/B.cpp +++ b/AtCoder/ABC246/B/B.cpp @@ -1,6 +1,6 @@ +#include #include #include -#include using std::cin; using std::cout; diff --git a/AtCoder/ABC246/C/C.cpp b/AtCoder/ABC246/C/C.cpp index 1c263e02..5ff654ca 100644 --- a/AtCoder/ABC246/C/C.cpp +++ b/AtCoder/ABC246/C/C.cpp @@ -1,6 +1,6 @@ +#include #include #include -#include using std::cin; using std::cout; diff --git a/AtCoder/ABC246/D/D.cpp b/AtCoder/ABC246/D/D.cpp index 22267027..84850ab2 100644 --- a/AtCoder/ABC246/D/D.cpp +++ b/AtCoder/ABC246/D/D.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include using std::cin; diff --git a/AtCoder/ABC251/E/E.cpp b/AtCoder/ABC251/E/E.cpp index bcf8a9df..c7b3002d 100644 --- a/AtCoder/ABC251/E/E.cpp +++ b/AtCoder/ABC251/E/E.cpp @@ -1,6 +1,6 @@ +#include #include #include -#include using std::cin; using std::cout; diff --git a/BZOJ/1013/1013.cpp b/BZOJ/1013/1013.cpp index c48179c4..749d7666 100644 --- a/BZOJ/1013/1013.cpp +++ b/BZOJ/1013/1013.cpp @@ -1,8 +1,8 @@ #pragma GCC optimize("Ofast") +#include #include #include -#include const int N = 15; const double eps = 1e-6; diff --git a/BZOJ/1257/1257.cpp b/BZOJ/1257/1257.cpp index 6c149f92..0e6a3dcd 100644 --- a/BZOJ/1257/1257.cpp +++ b/BZOJ/1257/1257.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/BZOJ/1475/1475.cpp b/BZOJ/1475/1475.cpp index 8a86cf2e..da0e7502 100644 --- a/BZOJ/1475/1475.cpp +++ b/BZOJ/1475/1475.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include #include diff --git a/BZOJ/2243/2243.cpp b/BZOJ/2243/2243.cpp index d088793b..887d6767 100644 --- a/BZOJ/2243/2243.cpp +++ b/BZOJ/2243/2243.cpp @@ -104,10 +104,20 @@ struct node { int l, r, s, d, lc, rc; node() - : l(0), r(0), s(0), d(0), lc(0), rc(0) {} + : l(0), + r(0), + s(0), + d(0), + lc(0), + rc(0) {} node(int _l, int _r) - : l(_l), r(_r), s(0), d(0), lc(0), rc(0) {} + : l(_l), + r(_r), + s(0), + d(0), + lc(0), + rc(0) {} } tr[N << 2]; inline void pushup(int u) { diff --git a/BZOJ/2662/2662.cpp b/BZOJ/2662/2662.cpp index 1a263bc8..daef0658 100644 --- a/BZOJ/2662/2662.cpp +++ b/BZOJ/2662/2662.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include #include diff --git a/BZOJ/2763/2763.cpp b/BZOJ/2763/2763.cpp index 69d679a0..e773f6c0 100644 --- a/BZOJ/2763/2763.cpp +++ b/BZOJ/2763/2763.cpp @@ -1,6 +1,6 @@ +#include #include #include -#include #include #include diff --git a/BZOJ/4378/4378.cpp b/BZOJ/4378/4378.cpp index 26591b99..fe125642 100644 --- a/BZOJ/4378/4378.cpp +++ b/BZOJ/4378/4378.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include using std::cin; diff --git a/Codeforces/1660/B/B.cpp b/Codeforces/1660/B/B.cpp index 33199e82..d9562b43 100644 --- a/Codeforces/1660/B/B.cpp +++ b/Codeforces/1660/B/B.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/Codeforces/1660/C/C.cpp b/Codeforces/1660/C/C.cpp index 9d09baa2..a2523eda 100644 --- a/Codeforces/1660/C/C.cpp +++ b/Codeforces/1660/C/C.cpp @@ -1,6 +1,6 @@ +#include #include #include -#include #include using std::cin; diff --git a/Codeforces/1661/A/A.cpp b/Codeforces/1661/A/A.cpp index f504096a..f92b2ff6 100644 --- a/Codeforces/1661/A/A.cpp +++ b/Codeforces/1661/A/A.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/Codeforces/1661/B/B.cpp b/Codeforces/1661/B/B.cpp index 279b93d7..03cb62fb 100644 --- a/Codeforces/1661/B/B.cpp +++ b/Codeforces/1661/B/B.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include using std::cin; diff --git a/Codeforces/1661/D/D.cpp b/Codeforces/1661/D/D.cpp index 91326cee..611a2d7d 100644 --- a/Codeforces/1661/D/D.cpp +++ b/Codeforces/1661/D/D.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; @@ -12,10 +12,16 @@ struct node { long long s, d; node() - : l(0), r(0), s(0), d(0) {} + : l(0), + r(0), + s(0), + d(0) {} node(int _l, int _r) - : l(_l), r(_r), s(0), d(0) {} + : l(_l), + r(_r), + s(0), + d(0) {} } tr[N << 2]; int n, k; diff --git a/Codeforces/1663/B/B.cpp b/Codeforces/1663/B/B.cpp index 15bd1884..d76a929b 100644 --- a/Codeforces/1663/B/B.cpp +++ b/Codeforces/1663/B/B.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/Codeforces/1663/G/G.js b/Codeforces/1663/G/G.js index 54536163..1b495844 100644 --- a/Codeforces/1663/G/G.js +++ b/Codeforces/1663/G/G.js @@ -4,18 +4,18 @@ const MIN = 32, MAX = 126; const SIMPLE = { - false: "![]", - true: "!![]", - undefined: "[][[]]", - NaN: "+[![]]", - Infinity: "+(+!+[]+(!+[]+[])[!+[]+!+[]+!+[]]+[+!+[]]+[+[]]+[+[]]+[+[]])", // +"1e1000" + false: '![]', + true: '!![]', + undefined: '[][[]]', + NaN: '+[![]]', + Infinity: '+(+!+[]+(!+[]+[])[!+[]+!+[]+!+[]]+[+!+[]]+[+[]]+[+[]]+[+[]])', // +"1e1000" }; const CONSTRUCTORS = { - Array: "[]", - Number: "(+[])", - String: "([]+[])", - Boolean: "(![])", + Array: '[]', + Number: '(+[])', + String: '([]+[])', + Boolean: '(![])', Function: '[]["flat"]', RegExp: 'Function("return/"+false+"/")()', Object: '[]["entries"]()', @@ -28,9 +28,9 @@ const MAPPING = { d: '(undefined+"")[2]', e: '(true+"")[3]', f: '(false+"")[0]', - g: "(false+[0]+String)[20]", + g: '(false+[0]+String)[20]', h: '(+(101))["to"+String["name"]](21)[1]', - i: "([false]+undefined)[10]", + i: '([false]+undefined)[10]', j: '([]["entries"]()+"")[3]', k: '(+(20))["to"+String["name"]](21)', l: '(false+"")[2]', @@ -46,15 +46,15 @@ const MAPPING = { v: '(+(31))["to"+String["name"]](32)', w: '(+(32))["to"+String["name"]](33)', x: '(+(101))["to"+String["name"]](34)[1]', - y: "(NaN+[Infinity])[10]", + y: '(NaN+[Infinity])[10]', z: '(+(35))["to"+String["name"]](36)', A: '(NaN+[]["entries"]())[11]', - B: "(+[]+Boolean)[10]", + B: '(+[]+Boolean)[10]', C: 'Function("return escape")()(("")["italics"]())[2]', D: 'Function("return escape")()([]["flat"])["slice"]("-1")', E: '(RegExp+"")[12]', - F: "(+[]+Function)[10]", + F: '(+[]+Function)[10]', G: '(false+Function("return Date")()())[30]', H: null, I: '(Infinity+"")[0]', @@ -63,11 +63,11 @@ const MAPPING = { L: null, M: '(true+Function("return Date")()())[30]', N: '(NaN+"")[0]', - O: "(+[]+Object)[10]", + O: '(+[]+Object)[10]', P: null, Q: null, - R: "(+[]+RegExp)[10]", - S: "(+[]+String)[10]", + R: '(+[]+RegExp)[10]', + S: '(+[]+String)[10]', T: '(NaN+Function("return Date")()())[30]', U: '(NaN+Object()["to"+String["name"]]["call"]())[11]', V: null, @@ -76,39 +76,39 @@ const MAPPING = { Y: null, Z: null, - " ": '(NaN+[]["flat"])[11]', - "!": null, + ' ': '(NaN+[]["flat"])[11]', + '!': null, '"': '("")["fontcolor"]()[12]', - "#": null, + '#': null, $: null, - "%": 'Function("return escape")()([]["flat"])[21]', - "&": '("")["fontcolor"](")[13]', + '%': 'Function("return escape")()([]["flat"])[21]', + '&': '("")["fontcolor"](")[13]', "'": null, - "(": '([]["flat"]+"")[13]', - ")": '([0]+false+[]["flat"])[20]', - "*": null, - "+": "(+(+!+[]+(!+[]+[])[!+[]+!+[]+!+[]]+[+!+[]]+[+[]]+[+[]])+[])[2]", - ",": '[[]]["concat"]([[]])+""', - "-": '(+(.+[0000001])+"")[2]', - ".": "(+(+!+[]+[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+[!+[]+!+[]]+[+[]])+[])[+!+[]]", - "/": '(false+[0])["italics"]()[10]', - ":": '(RegExp()+"")[3]', - ";": '("")["fontcolor"](NaN+")[21]', - "<": '("")["italics"]()[0]', - "=": '("")["fontcolor"]()[11]', - ">": '("")["italics"]()[2]', - "?": '(RegExp()+"")[2]', - "@": null, - "[": '([]["entries"]()+"")[0]', - "\\": '(RegExp("/")+"")[1]', - "]": '([]["entries"]()+"")[22]', - "^": null, + '(': '([]["flat"]+"")[13]', + ')': '([0]+false+[]["flat"])[20]', + '*': null, + '+': '(+(+!+[]+(!+[]+[])[!+[]+!+[]+!+[]]+[+!+[]]+[+[]]+[+[]])+[])[2]', + ',': '[[]]["concat"]([[]])+""', + '-': '(+(.+[0000001])+"")[2]', + '.': '(+(+!+[]+[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+[!+[]+!+[]]+[+[]])+[])[+!+[]]', + '/': '(false+[0])["italics"]()[10]', + ':': '(RegExp()+"")[3]', + ';': '("")["fontcolor"](NaN+")[21]', + '<': '("")["italics"]()[0]', + '=': '("")["fontcolor"]()[11]', + '>': '("")["italics"]()[2]', + '?': '(RegExp()+"")[2]', + '@': null, + '[': '([]["entries"]()+"")[0]', + '\\': '(RegExp("/")+"")[1]', + ']': '([]["entries"]()+"")[22]', + '^': null, _: null, - "`": null, - "{": '(true+[]["flat"])[20]', - "|": null, - "}": '([]["flat"]+"")["slice"]("-1")', - "~": null, + '`': null, + '{': '(true+[]["flat"])[20]', + '|': null, + '}': '([]["flat"]+"")["slice"]("-1")', + '~': null, }; const GLOBAL = 'Function("return this")()'; @@ -117,30 +117,30 @@ function fillMissingDigits() { var output, number, i; for (number = 0; number < 10; number++) { - output = "+[]"; + output = '+[]'; if (number > 0) { - output = "+!" + output; + output = '+!' + output; } for (i = 1; i < number; i++) { - output = "+!+[]" + output; + output = '+!+[]' + output; } if (number > 1) { output = output.substr(1); } - MAPPING[number] = "[" + output + "]"; + MAPPING[number] = '[' + output + ']'; } } function replaceMap() { - var character = "", + var character = '', value, i, key; function replace(pattern, replacement) { - value = value.replace(new RegExp(pattern, "gi"), replacement); + value = value.replace(new RegExp(pattern, 'gi'), replacement); } function digitReplacer(_, x) { @@ -148,15 +148,15 @@ function replaceMap() { } function numberReplacer(_, y) { - var values = y.split(""); + var values = y.split(''); var head = +values.shift(); - var output = "+[]"; + var output = '+[]'; if (head > 0) { - output = "+!" + output; + output = '+!' + output; } for (i = 1; i < head; i++) { - output = "+!+[]" + output; + output = '+!+[]' + output; } if (head > 1) { output = output.substr(1); @@ -164,7 +164,7 @@ function replaceMap() { return [output] .concat(values) - .join("+") + .join('+') .replace(/(\d)/g, digitReplacer); } @@ -176,20 +176,20 @@ function replaceMap() { } for (key in CONSTRUCTORS) { - replace("\\b" + key, CONSTRUCTORS[key] + '["constructor"]'); + replace('\\b' + key, CONSTRUCTORS[key] + '["constructor"]'); } for (key in SIMPLE) { replace(key, SIMPLE[key]); } - replace("(\\d\\d+)", numberReplacer); - replace("\\((\\d)\\)", digitReplacer); - replace("\\[(\\d)\\]", digitReplacer); + replace('(\\d\\d+)', numberReplacer); + replace('\\((\\d)\\)', digitReplacer); + replace('\\[(\\d)\\]', digitReplacer); - replace("GLOBAL", GLOBAL); - replace('\\+""', "+[]"); - replace('""', "[]+[]"); + replace('GLOBAL', GLOBAL); + replace('\\+""', '+[]'); + replace('""', '[]+[]'); MAPPING[character] = value; } @@ -222,7 +222,7 @@ function replaceStrings() { } function mappingReplacer(a, b) { - return b.split("").join("+"); + return b.split('').join('+'); } function valueReplacer(c) { @@ -248,7 +248,7 @@ function replaceStrings() { } if (count-- === 0) { - console.error("Could not compile the following chars:", missing); + console.error('Could not compile the following chars:', missing); } } } @@ -256,32 +256,32 @@ function replaceStrings() { function escapeSequence(c) { var cc = c.charCodeAt(0); if (cc < 256) { - return "\\" + cc.toString(8); + return '\\' + cc.toString(8); } else { var cc16 = cc.toString(16); - return "\\u" + ("0000" + cc16).substring(cc16.length); + return '\\u' + ('0000' + cc16).substring(cc16.length); } } function escapeSequenceForReplace(c) { - return escapeSequence(c).replace("\\", "t"); + return escapeSequence(c).replace('\\', 't'); } function encode(input, wrapWithEval, runInParentScope) { var output = []; if (!input) { - return ""; + return ''; } - var unmappped = ""; + var unmappped = ''; for (var k in MAPPING) { if (MAPPING[k]) { unmappped += k; } } - unmappped = unmappped.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); - unmappped = new RegExp("[^" + unmappped + "]", "g"); + unmappped = unmappped.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); + unmappped = new RegExp('[^' + unmappped + ']', 'g'); var unmappedCharactersCount = (input.match(unmappped) || []).length; if (unmappedCharactersCount > 1) { // Without this optimization one unmapped caracter has encoded length @@ -316,91 +316,91 @@ function encode(input, wrapWithEval, runInParentScope) { input = input.replace(unmappped, escapeSequence); } - var r = ""; + var r = ''; for (var i in SIMPLE) { - r += i + "|"; + r += i + '|'; } - r += "."; + r += '.'; - input.replace(new RegExp(r, "g"), function (c) { + input.replace(new RegExp(r, 'g'), function (c) { var replacement = SIMPLE[c]; if (replacement) { - output.push("(" + replacement + "+[])"); + output.push('(' + replacement + '+[])'); } else { replacement = MAPPING[c]; if (replacement) { output.push(replacement); } else { - throw new Error("Found unmapped character: " + c); + throw new Error('Found unmapped character: ' + c); } } }); - output = output.join("+"); + output = output.join('+'); if (/^\d$/.test(input)) { - output += "+[]"; + output += '+[]'; } if (unmappedCharactersCount > 1) { // replace `t` with `\\` output = - "(" + + '(' + output + - ")[" + - encode("split") + - "](" + - encode("t") + - ")[" + - encode("join") + - "](" + - encode("\\") + - ")"; + ')[' + + encode('split') + + '](' + + encode('t') + + ')[' + + encode('join') + + '](' + + encode('\\') + + ')'; } if (unmappedCharactersCount > 0) { output = - "[][" + - encode("flat") + - "]" + - "[" + - encode("constructor") + - "]" + - "(" + + '[][' + + encode('flat') + + ']' + + '[' + + encode('constructor') + + ']' + + '(' + encode('return"') + - "+" + + '+' + output + - "+" + + '+' + encode('"') + - ")()"; + ')()'; } if (wrapWithEval) { if (runInParentScope) { output = - "[][" + - encode("flat") + - "]" + - "[" + - encode("constructor") + - "]" + - "(" + - encode("return eval") + - ")()" + - "(" + + '[][' + + encode('flat') + + ']' + + '[' + + encode('constructor') + + ']' + + '(' + + encode('return eval') + + ')()' + + '(' + output + - ")"; + ')'; } else { output = - "[][" + - encode("flat") + - "]" + - "[" + - encode("constructor") + - "]" + - "(" + + '[][' + + encode('flat') + + ']' + + '[' + + encode('constructor') + + ']' + + '(' + output + - ")()"; + ')()'; } } diff --git a/Codeforces/1675/B/B.cpp b/Codeforces/1675/B/B.cpp index 96bfae64..57106a3c 100644 --- a/Codeforces/1675/B/B.cpp +++ b/Codeforces/1675/B/B.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include using std::cin; diff --git a/Codeforces/1678/A/A.cpp b/Codeforces/1678/A/A.cpp index 6dd9f518..b0148885 100644 --- a/Codeforces/1678/A/A.cpp +++ b/Codeforces/1678/A/A.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/Codeforces/1679/A/A.cpp b/Codeforces/1679/A/A.cpp index b480a5e2..c974b369 100644 --- a/Codeforces/1679/A/A.cpp +++ b/Codeforces/1679/A/A.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/Codeforces/1681/C/C.cpp b/Codeforces/1681/C/C.cpp index 6629ef0a..967f0bb5 100644 --- a/Codeforces/1681/C/C.cpp +++ b/Codeforces/1681/C/C.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include using std::cin; diff --git a/Codeforces/1681/D/D.cpp b/Codeforces/1681/D/D.cpp index 74aa5cee..4608e830 100644 --- a/Codeforces/1681/D/D.cpp +++ b/Codeforces/1681/D/D.cpp @@ -1,7 +1,7 @@ #pragma GCC optimize("Ofast") -#include #include +#include #include #include #include diff --git a/Codeforces/1682/B/B.cpp b/Codeforces/1682/B/B.cpp index 12e94135..d82f7404 100644 --- a/Codeforces/1682/B/B.cpp +++ b/Codeforces/1682/B/B.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/Codeforces/1682/C/C.cpp b/Codeforces/1682/C/C.cpp index 459b780a..2b17964c 100644 --- a/Codeforces/1682/C/C.cpp +++ b/Codeforces/1682/C/C.cpp @@ -1,6 +1,6 @@ +#include #include #include -#include using std::cin; using std::cout; diff --git a/Gym/103081/I/I.cpp b/Gym/103081/I/I.cpp index e461456b..73dc4918 100644 --- a/Gym/103081/I/I.cpp +++ b/Gym/103081/I/I.cpp @@ -1,6 +1,6 @@ +#include #include #include -#include #include #include diff --git a/Gym/103427/H/H.cpp b/Gym/103427/H/H.cpp index eaae2c59..df4a36c5 100644 --- a/Gym/103427/H/H.cpp +++ b/Gym/103427/H/H.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/Gym/103698/C/C.cpp b/Gym/103698/C/C.cpp index 05e271fb..507ff943 100644 --- a/Gym/103698/C/C.cpp +++ b/Gym/103698/C/C.cpp @@ -1,6 +1,6 @@ +#include #include #include -#include using std::cin; using std::cout; diff --git a/Hydro/system/H1005/H1005.cpp b/Hydro/system/H1005/H1005.cpp index eb75075c..ade4aa61 100644 --- a/Hydro/system/H1005/H1005.cpp +++ b/Hydro/system/H1005/H1005.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/Hydro/system_test/2/data/config.yaml b/Hydro/system_test/2/data/config.yaml index cfaaa073..93ec106a 100644 --- a/Hydro/system_test/2/data/config.yaml +++ b/Hydro/system_test/2/data/config.yaml @@ -1,4 +1,3 @@ -type: default - -time: 0.5s -memory: 256m \ No newline at end of file +version https://git-lfs.github.com/spec/v1 +oid sha256:afaf5aefd2b6a66b9109dc611fc0f9b5e21a07b236a8ed2f04e9f859b4d7026b +size 39 diff --git a/Hydro/system_test/3/data/config.yaml b/Hydro/system_test/3/data/config.yaml index a5a235d0..c576eb43 100644 --- a/Hydro/system_test/3/data/config.yaml +++ b/Hydro/system_test/3/data/config.yaml @@ -1,19 +1,3 @@ -type: default - -time: 1s -memory: 256m - -checker_type: testlib -checker: checker.cc - -cases: - - input: data1.in - - input: data2.in - - input: data3.in - - input: data4.in - - input: data5.in - - input: data6.in - - input: data7.in - - input: data8.in - - input: data9.in - - input: data10.in \ No newline at end of file +version https://git-lfs.github.com/spec/v1 +oid sha256:daa41ad5eb5f2b97ed9015a3e01dbc3ee83cb2f5b5e9faf482e648e206c285e2 +size 289 diff --git a/Hydro/system_test/6/data/config.yaml b/Hydro/system_test/6/data/config.yaml index c926f6b4..c37f8d6c 100644 --- a/Hydro/system_test/6/data/config.yaml +++ b/Hydro/system_test/6/data/config.yaml @@ -1,3 +1,3 @@ -time: 100ms -memory: 64m -filename: a+b \ No newline at end of file +version https://git-lfs.github.com/spec/v1 +oid sha256:56aa1ad4ed6f59c67f841ae057ee2eeef3a9eff155ed76214be120d152513fac +size 38 diff --git a/Hydro/system_test/8/data/config.yaml b/Hydro/system_test/8/data/config.yaml index 65f4abc8..c32b5f85 100644 --- a/Hydro/system_test/8/data/config.yaml +++ b/Hydro/system_test/8/data/config.yaml @@ -1,7 +1,3 @@ -type: default -score: 5 -time: 100ms -memory: 64m - -checker_type: testlib -checker: checker.cc \ No newline at end of file +version https://git-lfs.github.com/spec/v1 +oid sha256:e337a949d4e1015b7548ef06ecd75e25034b39392f55e6bd387f919437e76e6e +size 90 diff --git a/LibreOJ/100/100.cpp b/LibreOJ/100/100.cpp index eb75075c..ade4aa61 100644 --- a/LibreOJ/100/100.cpp +++ b/LibreOJ/100/100.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/LibreOJ/10014/data/divide_b.cpp b/LibreOJ/10014/data/divide_b.cpp index 297aebc1..8174ca9d 100644 --- a/LibreOJ/10014/data/divide_b.cpp +++ b/LibreOJ/10014/data/divide_b.cpp @@ -1,40 +1,3 @@ -#include -#include -using namespace std; -const int MXN = 100000; -int n, m; -int a[MXN]; -int check (int m) { - int t, ans; - t = 0; - ans = 1; - for (int i = 0; i < n; i++) { - if (t + a[i] <= m) - t += a[i]; - else { - t = a[i]; - ans ++; - } - } - return ans; -} -int main() { - freopen("divide_b4.in", "r", stdin); - freopen("divide_b4.out", "w", stdout); - scanf ("%d%d", &n, &m); - int l = 0; - int r = 0; - for (int i = 0; i < n; i++) { - scanf ("%d", &a[i]); - r += a[i]; - l = max (l, a[i]); - } - while (l < r) { - int mid = (l + r) / 2; - if (check(mid) <= m) - r = mid; - else - l = mid + 1; - } - printf ("%d\n", l); -} +version https://git-lfs.github.com/spec/v1 +oid sha256:55af25ea373b7e25cbcf3339be93ed5f65fe39df9d3e9817ac21565bf047fbb2 +size 820 diff --git a/LibreOJ/101/101.cpp b/LibreOJ/101/101.cpp index de20fbbb..8829dbb8 100644 --- a/LibreOJ/101/101.cpp +++ b/LibreOJ/101/101.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include #include diff --git a/LibreOJ/10138/10138.cpp b/LibreOJ/10138/10138.cpp index f95a3af5..20dd39a0 100644 --- a/LibreOJ/10138/10138.cpp +++ b/LibreOJ/10138/10138.cpp @@ -106,10 +106,16 @@ struct node { int l, r, sum, max; node() - : l(0), r(0), sum(0), max(numeric_limits::min()) {} + : l(0), + r(0), + sum(0), + max(numeric_limits::min()) {} node(int _l, int _r) - : l(_l), r(_r), sum(0), max(numeric_limits::min()) {} + : l(_l), + r(_r), + sum(0), + max(numeric_limits::min()) {} } tr[N << 2]; void pushup(int u) { diff --git a/LibreOJ/10141/10141.cpp b/LibreOJ/10141/10141.cpp index 8f1716f3..d5dc4992 100644 --- a/LibreOJ/10141/10141.cpp +++ b/LibreOJ/10141/10141.cpp @@ -104,10 +104,20 @@ struct node { int l, r, s, d, lc, rc; node() - : l(0), r(0), s(0), d(0), lc(0), rc(0) {} + : l(0), + r(0), + s(0), + d(0), + lc(0), + rc(0) {} node(int _l, int _r) - : l(_l), r(_r), s(0), d(0), lc(0), rc(0) {} + : l(_l), + r(_r), + s(0), + d(0), + lc(0), + rc(0) {} } tr[N << 2]; inline void pushup(int u) { diff --git a/LibreOJ/10145/10145.cpp b/LibreOJ/10145/10145.cpp index 9a54ca33..49d38846 100644 --- a/LibreOJ/10145/10145.cpp +++ b/LibreOJ/10145/10145.cpp @@ -17,10 +17,18 @@ struct node { int l, r, s, v, k; node() - : l(0), r(0), s(0), v(0), k(rand()) {} + : l(0), + r(0), + s(0), + v(0), + k(rand()) {} node(int _v) - : l(0), r(0), s(1), v(_v), k(rand()) {} + : l(0), + r(0), + s(1), + v(_v), + k(rand()) {} } tr[N]; void pushup(int u) { diff --git a/LibreOJ/10173/10173.cpp b/LibreOJ/10173/10173.cpp index 02de12b2..bfc66a67 100644 --- a/LibreOJ/10173/10173.cpp +++ b/LibreOJ/10173/10173.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/LibreOJ/10194/data/1.cpp b/LibreOJ/10194/data/1.cpp index e8e88405..15d531f8 100644 --- a/LibreOJ/10194/data/1.cpp +++ b/LibreOJ/10194/data/1.cpp @@ -1,17 +1,3 @@ -#include -using namespace std; -int a,b,m; -int Ksm(int x,int d) -{ - int res=1; - for (; d; d/=2,x=1ll*x*x%m) - if (d%2) res=1ll*res*x%m; - return res; -} -int main() -{ - freopen("data10.in","r",stdin); - freopen("data10.out","w",stdout); - scanf("%d%d%d",&a,&b,&m); - printf("%d",Ksm(a,b)); -} +version https://git-lfs.github.com/spec/v1 +oid sha256:01dc2f0f9e8d9a2f0b8939e3f2ab8490a54d6a69216aed7d6b6da8c43958505c +size 372 diff --git a/LibreOJ/10194/data/gen.cpp b/LibreOJ/10194/data/gen.cpp index 2bf0c01a..c179119e 100644 --- a/LibreOJ/10194/data/gen.cpp +++ b/LibreOJ/10194/data/gen.cpp @@ -1,17 +1,3 @@ -#include -#include -#include -using namespace std; -int N=1e9; -int Rand() -{ - int x=rand(); - return (x*rand()+rand())%N+1; -} -int main() -{ - freopen("data10.in","w",stdout); - srand(time(0)); - printf("%d %d %d",Rand(),Rand(),Rand()); -} - +version https://git-lfs.github.com/spec/v1 +oid sha256:c1cf7cb61d909cd3fd7c296d50f5d2f69053a45fb59cafaf09476168e9ff46ec +size 305 diff --git a/LibreOJ/102/102.cpp b/LibreOJ/102/102.cpp index 5635452e..6694073f 100644 --- a/LibreOJ/102/102.cpp +++ b/LibreOJ/102/102.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include #include diff --git a/LibreOJ/10215/10215.cpp b/LibreOJ/10215/10215.cpp index 50754762..cf486501 100644 --- a/LibreOJ/10215/10215.cpp +++ b/LibreOJ/10215/10215.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include using std::cin; diff --git a/LibreOJ/104/104.cpp b/LibreOJ/104/104.cpp index 9774df49..ebc73e04 100644 --- a/LibreOJ/104/104.cpp +++ b/LibreOJ/104/104.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; @@ -14,10 +14,18 @@ class Treap { int size, val, key; node() - : left(nullptr), right(nullptr), size(1), val(0), key(rand()) {} + : left(nullptr), + right(nullptr), + size(1), + val(0), + key(rand()) {} node(int _val) - : left(nullptr), right(nullptr), size(1), val(_val), key(rand()) {} + : left(nullptr), + right(nullptr), + size(1), + val(_val), + key(rand()) {} ~node() { delete left, right; diff --git a/LibreOJ/105/105.cpp b/LibreOJ/105/105.cpp index aaa6b1a0..638c788a 100644 --- a/LibreOJ/105/105.cpp +++ b/LibreOJ/105/105.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; @@ -14,10 +14,20 @@ struct node { bool d; node() - : l(0), r(0), s(0), v(0), d(false), k(rand()) {} + : l(0), + r(0), + s(0), + v(0), + d(false), + k(rand()) {} node(int _v) - : l(0), r(0), s(1), v(_v), d(false), k(rand()) {} + : l(0), + r(0), + s(1), + v(_v), + d(false), + k(rand()) {} } tr[N]; void pushup(int u) { diff --git a/LibreOJ/2/data/spj_cpp.cpp b/LibreOJ/2/data/spj_cpp.cpp index c1140b5b..3c34820a 100644 --- a/LibreOJ/2/data/spj_cpp.cpp +++ b/LibreOJ/2/data/spj_cpp.cpp @@ -1,31 +1,3 @@ -#include -#include -#include -#include - -int main() { - std::ifstream fout("user_out"); - std::ifstream fans("answer"); - - std::string s1, s2; - std::getline(fout, s1); - std::getline(fans, s2); - - bool ok = true; - - if (s1.length() != s2.length()) { - std::cerr << "Output length differs." << std::endl; - ok = false; - } else { - for (size_t i = 0; i < s1.length(); i++) { - if (tolower(s1[i]) != tolower(s2[i])) { - std::cerr << "The " << i + 1 << "-th character differs. Expected '" << s2[i] << "'; got '" << s1[i] << "'." << std::endl; - ok = false; - } - } - } - if (ok) { - std::cerr << "OK!" << std::endl; - } - std::cout << (ok ? 100 : 0) << std::endl; -} +version https://git-lfs.github.com/spec/v1 +oid sha256:308fddbd421d9c2c04725740a96ebb4eab40504d4581b01fe8faacf4b86acb00 +size 801 diff --git a/LibreOJ/2054/2054.cpp b/LibreOJ/2054/2054.cpp index 1aa8b0b3..bf164b31 100644 --- a/LibreOJ/2054/2054.cpp +++ b/LibreOJ/2054/2054.cpp @@ -93,10 +93,14 @@ struct node { int l, r, d; node() - : l(0), r(0), d(-1) {} + : l(0), + r(0), + d(-1) {} node(int _l, int _r) - : l(_l), r(_r), d(-1) {} + : l(_l), + r(_r), + d(-1) {} } tr[N << 2]; inline void pushup(int u) { diff --git a/LibreOJ/2125/2125.cpp b/LibreOJ/2125/2125.cpp index 2d4e41b5..3784c34e 100644 --- a/LibreOJ/2125/2125.cpp +++ b/LibreOJ/2125/2125.cpp @@ -113,10 +113,16 @@ struct node { long long s, d; node() - : l(0), r(0), s(0), d(0) {} + : l(0), + r(0), + s(0), + d(0) {} node(int _l, int _r) - : l(_l), r(_r), s(0), d(0) {} + : l(_l), + r(_r), + s(0), + d(0) {} } tr[N << 2]; inline void pushup(int u) { diff --git a/LibreOJ/2130/2130.cpp b/LibreOJ/2130/2130.cpp index 62fcbd47..baea57ce 100644 --- a/LibreOJ/2130/2130.cpp +++ b/LibreOJ/2130/2130.cpp @@ -101,10 +101,16 @@ struct node { int l, r, s, d; node() - : l(0), r(0), s(0), d(-1) {} + : l(0), + r(0), + s(0), + d(-1) {} node(int _l, int _r) - : l(_l), r(_r), s(0), d(-1) {} + : l(_l), + r(_r), + s(0), + d(-1) {} } tr[N << 2]; inline void pushup(int u) { diff --git a/LibreOJ/2279/2279.cpp b/LibreOJ/2279/2279.cpp index 6b4b3b14..3f62d055 100644 --- a/LibreOJ/2279/2279.cpp +++ b/LibreOJ/2279/2279.cpp @@ -6,10 +6,14 @@ struct node { int l, r, max; node() - : l(0), r(0), max(0) {} + : l(0), + r(0), + max(0) {} node(int _l, int _r) - : l(_l), r(_r), max(0) {} + : l(_l), + r(_r), + max(0) {} } tr[50005 << 2]; int n, m, x, y, a[50005]; diff --git a/LibreOJ/2606/2606.cpp b/LibreOJ/2606/2606.cpp index 3a22f44a..ce5e4ecc 100644 --- a/LibreOJ/2606/2606.cpp +++ b/LibreOJ/2606/2606.cpp @@ -39,10 +39,16 @@ struct node { int l, r, m, d; node() - : l(0), r(0), m(std::numeric_limits::max()), d(0) {} + : l(0), + r(0), + m(std::numeric_limits::max()), + d(0) {} node(int _l, int _r) - : l(_l), r(_r), m(std::numeric_limits::max()), d(0) {} + : l(_l), + r(_r), + m(std::numeric_limits::max()), + d(0) {} } tr[1000005 << 1]; void pushup(int u) { diff --git a/LibreOJ/2608/data/std.cpp b/LibreOJ/2608/data/std.cpp index 625585ff..39d9b6df 100644 --- a/LibreOJ/2608/data/std.cpp +++ b/LibreOJ/2608/data/std.cpp @@ -1,42 +1,3 @@ -#include -#include -#include -#include - -using namespace std; - -long long n, m, k, x; -long long remainder; - - - -long long Power(long long x, long long y, long long k) -{ - long long result = 1; - remainder = x % k; - while(y > 0) - { - if(y % 2 == 1) - result = (result * remainder) % k; - remainder = (remainder * remainder) % k; - y = y / 2; - } - return result; -} - - -int main(void) -{ -// freopen("circle.in", "r", stdin); -// freopen("circle.out", "w", stdout); - - - scanf("%lld%lld%lld%lld", &n, &m, &k, &x); - - long long result = Power(10, k, n); - result = (result * m + x) % n; - - printf("%lld\n", result); - - return 0; -} +version https://git-lfs.github.com/spec/v1 +oid sha256:42ad87c8889633e36b073134d938f493b0785aae82905d7416b232f025ee1b5a +size 742 diff --git a/LibreOJ/2608/data/val.cpp b/LibreOJ/2608/data/val.cpp index 4a6dc4f1..d2966cad 100644 --- a/LibreOJ/2608/data/val.cpp +++ b/LibreOJ/2608/data/val.cpp @@ -1,13 +1,3 @@ -#include "testlib.h" - -int main() -{ - registerValidation(); - int n = inf.readInt(2, 1e6 - 1); inf.readSpace(); - inf.readInt(1, n - 1); inf.readSpace(); - inf.readInt(1, 1e9 - 1); inf.readSpace(); - inf.readInt(1, n); inf.readEoln(); - inf.readEof(); - return 0; -} - +version https://git-lfs.github.com/spec/v1 +oid sha256:80765e83ddd7a625671b5b2274a69dd73de32352b8b03f22cad1b8dd4cb96188 +size 295 diff --git a/LibreOJ/2633/2633.cpp b/LibreOJ/2633/2633.cpp index 50d4ceb3..9a18b4bc 100644 --- a/LibreOJ/2633/2633.cpp +++ b/LibreOJ/2633/2633.cpp @@ -13,19 +13,29 @@ struct node { int x, y, step; node() - : x(0), y(0), step(0) {} + : x(0), + y(0), + step(0) {} node(int _x, int _y) - : x(_x), y(_y), step(0) {} + : x(_x), + y(_y), + step(0) {} node(pair _point) - : x(_point.first), y(_point.second), step(0) {} + : x(_point.first), + y(_point.second), + step(0) {} node(pair _point, int _step) - : x(_point.first), y(_point.second), step(_step) {} + : x(_point.first), + y(_point.second), + step(_step) {} node(int _x, int _y, int _step) - : x(_x), y(_y), step(_step) {} + : x(_x), + y(_y), + step(_step) {} }; /** diff --git a/LibreOJ/2759/2759.cpp b/LibreOJ/2759/2759.cpp index 6f4f43e8..8af1ce5f 100644 --- a/LibreOJ/2759/2759.cpp +++ b/LibreOJ/2759/2759.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include #include diff --git a/LibreOJ/4/data/spj.js b/LibreOJ/4/data/spj.js index f50b39ec..283e2170 100644 --- a/LibreOJ/4/data/spj.js +++ b/LibreOJ/4/data/spj.js @@ -1,6 +1,3 @@ -exports.main = () => { - code = code.trim().split('\r\n').join('\n'); - let outputCode = user_out.trim().split('\r\n').join('\n'); - if (code.length >= 10 && code === outputCode) exit({ score: 100 }); - else exit({ score: 0 }); -} +version https://git-lfs.github.com/spec/v1 +oid sha256:523c889987f6dce074b1a4de4abb9b08bb9a14aec86f85d2f1db6836ec92c6e4 +size 239 diff --git a/LibreOJ/4/data/spj_nodejs.js b/LibreOJ/4/data/spj_nodejs.js index c604706b..612d6df4 100644 --- a/LibreOJ/4/data/spj_nodejs.js +++ b/LibreOJ/4/data/spj_nodejs.js @@ -1,19 +1,3 @@ -exports.main = () => { - code = code.trim().split('\r\n').join('\n'); - let outputCode = user_out.trim().split('\r\n').join('\n'); - if (code.length >= 10 && code === outputCode) exit({ score: 100 }); - else exit({ score: 0 }); -} - -function exit(obj) { - process.stdout.write(String(obj.score)); - if (obj.message) process.stderr.write(String(obj.message)); - process.exit(); -} - -let fs = require('fs'); -let input = fs.readFileSync('input').toString(); -let user_out = fs.readFileSync('user_out').toString(); -let answer = fs.readFileSync('answer').toString(); -let code = fs.readFileSync('code').toString(); -exports.main(); +version https://git-lfs.github.com/spec/v1 +oid sha256:d18d848e57ef69187a5b4d4ba20143b35727f0125323d54a7f2acf895c15ea4b +size 635 diff --git a/LibreOJ/5/data/spj_cpp.cpp b/LibreOJ/5/data/spj_cpp.cpp index 8ed671dc..7d51489c 100644 --- a/LibreOJ/5/data/spj_cpp.cpp +++ b/LibreOJ/5/data/spj_cpp.cpp @@ -1,27 +1,3 @@ -#include -#include -using namespace std; -int main() { - ifstream score_in("input"); - ifstream std("answer"); - ifstream usr("user_out"); - - long long score, answer, user_answer; - score_in >> score; - std >> answer; - usr >> user_answer; - - if (!usr) { - cerr << "Failed to read any number from user output. Exiting." << endl; - cout << 0; - } else if (user_answer == 0) { - cerr << "Commiserations. Score is " << score << "." << endl; - cout << score; - } else if (user_answer == answer) { - cerr << "Correct!" << endl; - cout << 100; - } else { - cerr << "Sorry, incorrect date." << endl; - cout << 0; - } -} +version https://git-lfs.github.com/spec/v1 +oid sha256:14df15671d508526e8d8ada3a0442bd94a9cb72264d024386d04fbc102e985a6 +size 703 diff --git a/LibreOJ/6/data/interactor.cpp b/LibreOJ/6/data/interactor.cpp index 8601845b..8e8e3d26 100644 --- a/LibreOJ/6/data/interactor.cpp +++ b/LibreOJ/6/data/interactor.cpp @@ -1,71 +1,3 @@ -#include -#include -#include -#include -#include - -int main(int argc, char **argv) -{ - registerInteraction(argc, argv); - - int n = inf.readInt(), nguess = 0; - std::vector nums(n); - for (int i = 0; i < n; i++) - { - nums[i] = inf.readInt(); - } - - while (true) - { - std::string cmd = ouf.readWord(); - if (cmd == "get_num") - { - std::cout << n << std::endl << std::flush; - } - else if (cmd == "guess") - { - nguess++; - int index = ouf.readInt(), val = ouf.readInt(); - quitif(!(0 <= index && index < n), _pe, "`index` must in [0, n)!"); - - if (val < nums[index]) - { - std::cout << -1 << std::endl << std::flush; - } - else if (val > nums[index]) - { - std::cout << 1 << std::endl << std::flush; - } - else - { - std::cout << 0 << std::endl << std::flush; - } - } - else if (cmd == "submit") - { - bool wrongAnswer = false; - for (int i = 0; i < n; i++) - { - int x = ouf.readInt(); - - if (x != nums[i] && !wrongAnswer) - { - wrongAnswer = true; - quitf(_wa, "First differ on the %d-th number!", i); - } - } - - if (!wrongAnswer) - { - quitp( - std::max(std::min(100.0, (950.0 - ((double)nguess / n - 100.0)) / 950.0 * 100.0), 0.0), - "nguess = " + std::to_string(nguess) - ); - } - } - else - { - quitf(_pe, "Invalid command `%s`!", cmd.c_str()); - } - } -} +version https://git-lfs.github.com/spec/v1 +oid sha256:d56e5b5469760505999f5cb5ff7b1833bf9f36b76b951697e36a644576fbe51c +size 1745 diff --git a/LibreOJ/6/data/std.cpp b/LibreOJ/6/data/std.cpp index 0ec1249e..4842b7a5 100644 --- a/LibreOJ/6/data/std.cpp +++ b/LibreOJ/6/data/std.cpp @@ -1,21 +1,3 @@ -#include "interaction.h" - -inline int solve(int i) { - int l = 0, r = 1000000; - while (l < r) { - int mid = l + (r - l) / 2; - if (guess(i, mid) >= 0) r = mid; - else l = mid + 1; - } - return l; -} - -int main() { - int n = get_num(); - std::vector a(n); - for (int i = 0; i < n; i++) { - a[i] = solve(i); - } - - submit(a); -} +version https://git-lfs.github.com/spec/v1 +oid sha256:bcd5174f7601d4eb68d97bec18b4873ecef64e42511c0c10958a0ba961363ef4 +size 371 diff --git a/LibreOJ/6/interactor.cpp b/LibreOJ/6/interactor.cpp index 47233866..6b347f59 100644 --- a/LibreOJ/6/interactor.cpp +++ b/LibreOJ/6/interactor.cpp @@ -1,6 +1,6 @@ +#include #include #include -#include #include std::ofstream score("score.txt"); diff --git a/LibreOJ/6007/6007.cpp b/LibreOJ/6007/6007.cpp index 6ab802b4..8b3f5921 100644 --- a/LibreOJ/6007/6007.cpp +++ b/LibreOJ/6007/6007.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include #include diff --git a/LibreOJ/6013/6013.cpp b/LibreOJ/6013/6013.cpp index ee06c03f..cb249c41 100644 --- a/LibreOJ/6013/6013.cpp +++ b/LibreOJ/6013/6013.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include using std::cin; diff --git a/LibreOJ/6248/6248.cpp b/LibreOJ/6248/6248.cpp index a7ea55ba..6e1823ee 100644 --- a/LibreOJ/6248/6248.cpp +++ b/LibreOJ/6248/6248.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/LibreOJ/6277/6277.cpp b/LibreOJ/6277/6277.cpp index d09f9364..7f80f3a9 100644 --- a/LibreOJ/6277/6277.cpp +++ b/LibreOJ/6277/6277.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/LibreOJ/6278/6278.cpp b/LibreOJ/6278/6278.cpp index f412cf8f..f5c019c0 100644 --- a/LibreOJ/6278/6278.cpp +++ b/LibreOJ/6278/6278.cpp @@ -1,6 +1,6 @@ +#include #include #include -#include using std::cin; using std::cout; diff --git a/LibreOJ/6279/6279.cpp b/LibreOJ/6279/6279.cpp index 4a654bac..e3c695da 100644 --- a/LibreOJ/6279/6279.cpp +++ b/LibreOJ/6279/6279.cpp @@ -1,6 +1,6 @@ +#include #include #include -#include #include using std::cin; @@ -17,8 +17,7 @@ inline void process(int x) { } void change(int l, int r, int c) { - int p = pos[l], - q = pos[r]; + int p = pos[l], q = pos[r]; if (p == q) { for (int i = l; i <= r; i++) a[i] += c; @@ -35,8 +34,7 @@ void change(int l, int r, int c) { } int query(int l, int r, int c) { - int p = pos[l], - q = pos[r]; + int p = pos[l], q = pos[r]; int res = std::numeric_limits::min(); if (p == q) { @@ -52,7 +50,8 @@ int query(int l, int r, int c) { } for (int i = p + 1; i <= q - 1; i++) { - int _ = std::lower_bound(b + st[i], b + ed[i] + 1, c - add[i]) - b - 1; + int _ = + std::lower_bound(b + st[i], b + ed[i] + 1, c - add[i]) - b - 1; if (st[i] <= _ && _ <= ed[i]) res = std::max(res, b[_] + add[i]); } @@ -80,9 +79,7 @@ int main() { } for (int i = 1; i <= c; i++) { - for (int j = st[i]; j <= ed[i]; j++) { - pos[j] = i; - } + for (int j = st[i]; j <= ed[i]; j++) { pos[j] = i; } std::sort(b + st[i], b + ed[i] + 1); } diff --git a/LibreOJ/6280/6280.cpp b/LibreOJ/6280/6280.cpp index 9423c61b..17757ba9 100644 --- a/LibreOJ/6280/6280.cpp +++ b/LibreOJ/6280/6280.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/LibreOJ/6281/6281.cpp b/LibreOJ/6281/6281.cpp index 68c90551..ab7f7e29 100644 --- a/LibreOJ/6281/6281.cpp +++ b/LibreOJ/6281/6281.cpp @@ -1,6 +1,6 @@ +#include #include #include -#include using std::cin; using std::cout; diff --git a/LibreOJ/6283/6283.cpp b/LibreOJ/6283/6283.cpp index 8bfdfb91..00d60a4d 100644 --- a/LibreOJ/6283/6283.cpp +++ b/LibreOJ/6283/6283.cpp @@ -1,6 +1,6 @@ +#include #include #include -#include using std::cin; using std::cout; diff --git a/LibreOJ/6284/6284.cpp b/LibreOJ/6284/6284.cpp index b085d369..60ddfe7b 100644 --- a/LibreOJ/6284/6284.cpp +++ b/LibreOJ/6284/6284.cpp @@ -1,6 +1,6 @@ +#include #include #include -#include using std::cin; using std::cout; diff --git a/LibreOJ/6285/6285.cpp b/LibreOJ/6285/6285.cpp index 54118f7d..45bdf5dd 100644 --- a/LibreOJ/6285/6285.cpp +++ b/LibreOJ/6285/6285.cpp @@ -1,7 +1,7 @@ +#include #include #include #include -#include #include using std::cin; diff --git a/Luogu/B2023/B2023.cpp b/Luogu/B2023/B2023.cpp index 57ce24a5..57e5d13d 100644 --- a/Luogu/B2023/B2023.cpp +++ b/Luogu/B2023/B2023.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/Luogu/B2024/B2024.cpp b/Luogu/B2024/B2024.cpp index 8e7f4bd1..d216d17d 100644 --- a/Luogu/B2024/B2024.cpp +++ b/Luogu/B2024/B2024.cpp @@ -9,6 +9,9 @@ int main() { "%.5f\n" "%e\n" "%g\n", - x, x, x, x); + x, + x, + x, + x); return 0; } diff --git a/Luogu/B2026/B2026.cpp b/Luogu/B2026/B2026.cpp index db9b7a57..bd359af5 100644 --- a/Luogu/B2026/B2026.cpp +++ b/Luogu/B2026/B2026.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/Luogu/B2027/B2027.cpp b/Luogu/B2027/B2027.cpp index aaa60158..78242528 100644 --- a/Luogu/B2027/B2027.cpp +++ b/Luogu/B2027/B2027.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/Luogu/B2120/B2120.js b/Luogu/B2120/B2120.js index 73b1b99c..c5714600 100644 --- a/Luogu/B2120/B2120.js +++ b/Luogu/B2120/B2120.js @@ -1,9 +1,9 @@ -const fs = require('fs') +const fs = require('fs'); let str = fs.readFileSync(0).toString().replace(/\s+/g, ' ').split(' '); -let ans = [] +let ans = []; -str.forEach(word => { +str.forEach((word) => { ans.push(word.length); }); diff --git a/Luogu/B3606/B3606.cpp b/Luogu/B3606/B3606.cpp index d2e90d18..4990980a 100644 --- a/Luogu/B3606/B3606.cpp +++ b/Luogu/B3606/B3606.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include using std::cin; diff --git a/Luogu/B3607/B3607.cpp b/Luogu/B3607/B3607.cpp index d2e90d18..4990980a 100644 --- a/Luogu/B3607/B3607.cpp +++ b/Luogu/B3607/B3607.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include using std::cin; diff --git a/Luogu/CF19B/CF19B.cpp b/Luogu/CF19B/CF19B.cpp index b36e77ad..0176f31e 100644 --- a/Luogu/CF19B/CF19B.cpp +++ b/Luogu/CF19B/CF19B.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/Luogu/CF294B/CF294B.cpp b/Luogu/CF294B/CF294B.cpp index d3ad2595..45caacf5 100644 --- a/Luogu/CF294B/CF294B.cpp +++ b/Luogu/CF294B/CF294B.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/Luogu/CF383C/CF383C.cpp b/Luogu/CF383C/CF383C.cpp index 6c97e2e6..b2492a81 100644 --- a/Luogu/CF383C/CF383C.cpp +++ b/Luogu/CF383C/CF383C.cpp @@ -84,10 +84,14 @@ struct node { int l, r, d; node() - : l(0), r(0), d(0) {} + : l(0), + r(0), + d(0) {} node(int _l, int _r) - : l(_l), r(_r), d(0) {} + : l(_l), + r(_r), + d(0) {} } tr[N << 2]; void pushdown(int u) { diff --git a/Luogu/CF438D/CF438D.cpp b/Luogu/CF438D/CF438D.cpp index 01f5d3cc..22ee68d7 100644 --- a/Luogu/CF438D/CF438D.cpp +++ b/Luogu/CF438D/CF438D.cpp @@ -41,10 +41,16 @@ struct node { long long s, m; node() - : l(0), r(0), s(0), m(0) {} + : l(0), + r(0), + s(0), + m(0) {} node(int _l, int _r) - : l(_l), r(_r), s(0), m(0) {} + : l(_l), + r(_r), + s(0), + m(0) {} } tr[100005 << 2]; inline void pushup(int u) { diff --git a/Luogu/CF920F/CF920F.cpp b/Luogu/CF920F/CF920F.cpp index 5e64717e..05b2283d 100644 --- a/Luogu/CF920F/CF920F.cpp +++ b/Luogu/CF920F/CF920F.cpp @@ -64,10 +64,16 @@ struct node { long long s, m; node() - : l(0), r(0), s(0), m(0) {} + : l(0), + r(0), + s(0), + m(0) {} node(int _l, int _r) - : l(_l), r(_r), s(0), m(0) {} + : l(_l), + r(_r), + s(0), + m(0) {} } tr[300005 << 2]; void pushup(int u) { diff --git a/Luogu/P1059/P1059.cpp b/Luogu/P1059/P1059.cpp index 17363a7a..637fdcec 100644 --- a/Luogu/P1059/P1059.cpp +++ b/Luogu/P1059/P1059.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include using std::cin; diff --git a/Luogu/P1083/P1083.cpp b/Luogu/P1083/P1083.cpp index 3a22f44a..ce5e4ecc 100644 --- a/Luogu/P1083/P1083.cpp +++ b/Luogu/P1083/P1083.cpp @@ -39,10 +39,16 @@ struct node { int l, r, m, d; node() - : l(0), r(0), m(std::numeric_limits::max()), d(0) {} + : l(0), + r(0), + m(std::numeric_limits::max()), + d(0) {} node(int _l, int _r) - : l(_l), r(_r), m(std::numeric_limits::max()), d(0) {} + : l(_l), + r(_r), + m(std::numeric_limits::max()), + d(0) {} } tr[1000005 << 1]; void pushup(int u) { diff --git a/Luogu/P1091/P1091.cpp b/Luogu/P1091/P1091.cpp index e626637e..d7548006 100644 --- a/Luogu/P1091/P1091.cpp +++ b/Luogu/P1091/P1091.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/Luogu/P1200/solution.md b/Luogu/P1200/solution.md index e5fa4c04..a9e5e4e9 100644 --- a/Luogu/P1200/solution.md +++ b/Luogu/P1200/solution.md @@ -32,11 +32,11 @@ int main() { ## 后记 -- Update1:2019-07-10 +- Update1:2019-07-10 - 无说明。 + 无说明。 -- Update2:2020-10-12 +- Update2:2020-10-12 - - 优化代码 - - 弃用不安全的 `gets` 函数。 + - 优化代码 + - 弃用不安全的 `gets` 函数。 diff --git a/Luogu/P1231/P1231.cpp b/Luogu/P1231/P1231.cpp index b0808ef1..2518bfbe 100644 --- a/Luogu/P1231/P1231.cpp +++ b/Luogu/P1231/P1231.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include using std::cin; diff --git a/Luogu/P1383/P1383.cpp b/Luogu/P1383/P1383.cpp index e7a47270..a6cbb0d0 100644 --- a/Luogu/P1383/P1383.cpp +++ b/Luogu/P1383/P1383.cpp @@ -46,10 +46,16 @@ struct node { int l, r, s, d; node() - : l(0), r(0), s(0), d(0) {} + : l(0), + r(0), + s(0), + d(0) {} node(int _l, int _r) - : l(_l), r(_r), s(0), d(0) {} + : l(_l), + r(_r), + s(0), + d(0) {} } tr[N << 5]; int insert(int p, int l, int r, int x) { diff --git a/Luogu/P1402/P1402.cpp b/Luogu/P1402/P1402.cpp index fd099da4..7807105b 100644 --- a/Luogu/P1402/P1402.cpp +++ b/Luogu/P1402/P1402.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include using std::cin; diff --git a/Luogu/P1486/P1486.cpp b/Luogu/P1486/P1486.cpp index dc092b28..ad274a4e 100644 --- a/Luogu/P1486/P1486.cpp +++ b/Luogu/P1486/P1486.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; @@ -18,10 +18,18 @@ struct node { int l, r, s, v, k; node() - : l(0), r(0), s(0), v(0), k(rand()) {} + : l(0), + r(0), + s(0), + v(0), + k(rand()) {} node(int _v) - : l(0), r(0), s(1), v(_v), k(rand()) {} + : l(0), + r(0), + s(1), + v(_v), + k(rand()) {} } tr[N]; void pushup(int u) { diff --git a/Luogu/P1533/P1533.cpp b/Luogu/P1533/P1533.cpp index 8126b8f8..15c4d9b6 100644 --- a/Luogu/P1533/P1533.cpp +++ b/Luogu/P1533/P1533.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include using std::cin; @@ -55,7 +55,9 @@ struct node { int l, r, c; node() - : l(0), r(0), c(0) {} + : l(0), + r(0), + c(0) {} } tr[N << 5]; int build(int l, int r) { diff --git a/Luogu/P1541/P1541.cpp b/Luogu/P1541/P1541.cpp index 10f2842e..3634ad1f 100644 --- a/Luogu/P1541/P1541.cpp +++ b/Luogu/P1541/P1541.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/Luogu/P1618/P1618.cpp b/Luogu/P1618/P1618.cpp index 137399de..06d6e642 100644 --- a/Luogu/P1618/P1618.cpp +++ b/Luogu/P1618/P1618.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/Luogu/P1622/P1622.cpp b/Luogu/P1622/P1622.cpp index b6e166e4..20ba9e97 100644 --- a/Luogu/P1622/P1622.cpp +++ b/Luogu/P1622/P1622.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include using std::cin; diff --git a/Luogu/P1750/P1750.cpp b/Luogu/P1750/P1750.cpp index 866c3366..1e361095 100644 --- a/Luogu/P1750/P1750.cpp +++ b/Luogu/P1750/P1750.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include using std::cin; diff --git a/Luogu/P1789/P1789.cpp b/Luogu/P1789/P1789.cpp index 741a1c8e..2fe6e74e 100644 --- a/Luogu/P1789/P1789.cpp +++ b/Luogu/P1789/P1789.cpp @@ -4,10 +4,8 @@ using namespace std; int n, m, k, x, y, o, p, ans = 0; int dx1[13] = {2, 0, -2, 0, 1, 1, 1, 0, 0, 0, -1, -1, -1}; int dy1[13] = {0, 2, 0, -2, 0, 1, -1, 1, 0, -1, 0, 1, -1}; -int dx2[25] = {-2, -2, -2, -2, -2, -1, -1, -1, -1, -1, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2}; -int dy2[25] = {-2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, - 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2}; +int dx2[25] = {-2, -2, -2, -2, -2, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2}; +int dy2[25] = {-2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2}; int main() { cin >> n >> m >> k; diff --git a/Luogu/P1801/P1801.cpp b/Luogu/P1801/P1801.cpp index fc862cc9..f7cfee8f 100644 --- a/Luogu/P1801/P1801.cpp +++ b/Luogu/P1801/P1801.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; @@ -39,10 +39,18 @@ struct node { int l, r, s, v, k; node() - : l(0), r(0), s(0), v(0), k(rand()) {} + : l(0), + r(0), + s(0), + v(0), + k(rand()) {} node(int _v) - : l(0), r(0), s(1), v(_v), k(rand()) {} + : l(0), + r(0), + s(1), + v(_v), + k(rand()) {} } tr[N]; inline void pushup(int u) { diff --git a/Luogu/P1807/P1807.cpp b/Luogu/P1807/P1807.cpp index 924c5219..9f06988b 100644 --- a/Luogu/P1807/P1807.cpp +++ b/Luogu/P1807/P1807.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include #include diff --git a/Luogu/P1835/P1835.cpp b/Luogu/P1835/P1835.cpp index e3de06a3..8c871f66 100644 --- a/Luogu/P1835/P1835.cpp +++ b/Luogu/P1835/P1835.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/Luogu/P1880/P1880.cpp b/Luogu/P1880/P1880.cpp index 72469d5d..1c26bcb9 100644 --- a/Luogu/P1880/P1880.cpp +++ b/Luogu/P1880/P1880.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/Luogu/P1939/P1939.cpp b/Luogu/P1939/P1939.cpp index 411b52ee..028476de 100644 --- a/Luogu/P1939/P1939.cpp +++ b/Luogu/P1939/P1939.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/Luogu/P1948/P1948.cpp b/Luogu/P1948/P1948.cpp index 07040021..d54fdf44 100644 --- a/Luogu/P1948/P1948.cpp +++ b/Luogu/P1948/P1948.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include #include diff --git a/Luogu/P1972/P1972.cpp b/Luogu/P1972/P1972.cpp index 61d1e529..762b204b 100644 --- a/Luogu/P1972/P1972.cpp +++ b/Luogu/P1972/P1972.cpp @@ -1,5 +1,5 @@ -#include #include +#include const int N = 1000005; diff --git a/Luogu/P2010/P2010.cpp b/Luogu/P2010/P2010.cpp index 614c6324..2609b9e7 100644 --- a/Luogu/P2010/P2010.cpp +++ b/Luogu/P2010/P2010.cpp @@ -1,6 +1,6 @@ -#include #include #include +#include #include const int days[] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; diff --git a/Luogu/P2014/P2014.cpp b/Luogu/P2014/P2014.cpp index 34c4e9e0..e9325b83 100644 --- a/Luogu/P2014/P2014.cpp +++ b/Luogu/P2014/P2014.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include using std::cin; diff --git a/Luogu/P2045/P2045.cpp b/Luogu/P2045/P2045.cpp index 2b488bbf..e45841db 100644 --- a/Luogu/P2045/P2045.cpp +++ b/Luogu/P2045/P2045.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include using std::cin; diff --git a/Luogu/P2146/P2146.cpp b/Luogu/P2146/P2146.cpp index 62fcbd47..baea57ce 100644 --- a/Luogu/P2146/P2146.cpp +++ b/Luogu/P2146/P2146.cpp @@ -101,10 +101,16 @@ struct node { int l, r, s, d; node() - : l(0), r(0), s(0), d(-1) {} + : l(0), + r(0), + s(0), + d(-1) {} node(int _l, int _r) - : l(_l), r(_r), s(0), d(-1) {} + : l(_l), + r(_r), + s(0), + d(-1) {} } tr[N << 2]; inline void pushup(int u) { diff --git a/Luogu/P2153/P2153.cpp b/Luogu/P2153/P2153.cpp index c636aa8c..46358fa3 100644 --- a/Luogu/P2153/P2153.cpp +++ b/Luogu/P2153/P2153.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include using std::cin; diff --git a/Luogu/P2286/P2286.cpp b/Luogu/P2286/P2286.cpp index 7e71c14f..09e74280 100644 --- a/Luogu/P2286/P2286.cpp +++ b/Luogu/P2286/P2286.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include using std::cin; diff --git a/Luogu/P2343/P2343.cpp b/Luogu/P2343/P2343.cpp index 8d80601d..f81d9010 100644 --- a/Luogu/P2343/P2343.cpp +++ b/Luogu/P2343/P2343.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; @@ -38,10 +38,18 @@ struct node { int l, r, s, v, k; node() - : l(0), r(0), s(0), v(0), k(rand()) {} + : l(0), + r(0), + s(0), + v(0), + k(rand()) {} node(int _v) - : l(0), r(0), s(1), v(_v), k(rand()) {} + : l(0), + r(0), + s(1), + v(_v), + k(rand()) {} } tr[N]; inline void pushup(int u) { diff --git a/Luogu/P2389/P2389.cpp b/Luogu/P2389/P2389.cpp index 4f12a362..3ffe6e0d 100644 --- a/Luogu/P2389/P2389.cpp +++ b/Luogu/P2389/P2389.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/Luogu/P2421/P2421.cpp b/Luogu/P2421/P2421.cpp index 50754762..cf486501 100644 --- a/Luogu/P2421/P2421.cpp +++ b/Luogu/P2421/P2421.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include using std::cin; diff --git a/Luogu/P2486/P2486.cpp b/Luogu/P2486/P2486.cpp index 8f1716f3..d5dc4992 100644 --- a/Luogu/P2486/P2486.cpp +++ b/Luogu/P2486/P2486.cpp @@ -104,10 +104,20 @@ struct node { int l, r, s, d, lc, rc; node() - : l(0), r(0), s(0), d(0), lc(0), rc(0) {} + : l(0), + r(0), + s(0), + d(0), + lc(0), + rc(0) {} node(int _l, int _r) - : l(_l), r(_r), s(0), d(0), lc(0), rc(0) {} + : l(_l), + r(_r), + s(0), + d(0), + lc(0), + rc(0) {} } tr[N << 2]; inline void pushup(int u) { diff --git a/Luogu/P2590/P2590.cpp b/Luogu/P2590/P2590.cpp index f95a3af5..20dd39a0 100644 --- a/Luogu/P2590/P2590.cpp +++ b/Luogu/P2590/P2590.cpp @@ -106,10 +106,16 @@ struct node { int l, r, sum, max; node() - : l(0), r(0), sum(0), max(numeric_limits::min()) {} + : l(0), + r(0), + sum(0), + max(numeric_limits::min()) {} node(int _l, int _r) - : l(_l), r(_r), sum(0), max(numeric_limits::min()) {} + : l(_l), + r(_r), + sum(0), + max(numeric_limits::min()) {} } tr[N << 2]; void pushup(int u) { diff --git a/Luogu/P2634/P2634.cpp b/Luogu/P2634/P2634.cpp index af63cc66..6a3606b6 100644 --- a/Luogu/P2634/P2634.cpp +++ b/Luogu/P2634/P2634.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include #include diff --git a/Luogu/P2704/P2704.cpp b/Luogu/P2704/P2704.cpp index 02de12b2..bfc66a67 100644 --- a/Luogu/P2704/P2704.cpp +++ b/Luogu/P2704/P2704.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/Luogu/P2717/P2717.cpp b/Luogu/P2717/P2717.cpp index cc21ef7b..6407cb0a 100644 --- a/Luogu/P2717/P2717.cpp +++ b/Luogu/P2717/P2717.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/Luogu/P2770/P2770.cpp b/Luogu/P2770/P2770.cpp index ec3f40d7..f7e78e99 100644 --- a/Luogu/P2770/P2770.cpp +++ b/Luogu/P2770/P2770.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include #include #include diff --git a/Luogu/P2774/P2774.cpp b/Luogu/P2774/P2774.cpp index 6ab802b4..8b3f5921 100644 --- a/Luogu/P2774/P2774.cpp +++ b/Luogu/P2774/P2774.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include #include diff --git a/Luogu/P2782/P2782.cpp b/Luogu/P2782/P2782.cpp index 94c36dd9..b760c6b6 100644 --- a/Luogu/P2782/P2782.cpp +++ b/Luogu/P2782/P2782.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/Luogu/P2801/P2801.cpp b/Luogu/P2801/P2801.cpp index f7945d0a..15dd6414 100644 --- a/Luogu/P2801/P2801.cpp +++ b/Luogu/P2801/P2801.cpp @@ -1,6 +1,6 @@ +#include #include #include -#include using std::cin; using std::cout; diff --git a/Luogu/P2891/P2891.cpp b/Luogu/P2891/P2891.cpp index 047e5039..bbdb29bf 100644 --- a/Luogu/P2891/P2891.cpp +++ b/Luogu/P2891/P2891.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include using std::cin; diff --git a/Luogu/P2939/P2939.cpp b/Luogu/P2939/P2939.cpp index f318a0ea..2197cb3b 100644 --- a/Luogu/P2939/P2939.cpp +++ b/Luogu/P2939/P2939.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include #include diff --git a/Luogu/P3063/P3063.cpp b/Luogu/P3063/P3063.cpp index 89f8edb6..a40411ef 100644 --- a/Luogu/P3063/P3063.cpp +++ b/Luogu/P3063/P3063.cpp @@ -8,7 +8,9 @@ struct node { node() {} node(int _v, int _l, int _c) - : v(_v), l(_l), c(_c) {} + : v(_v), + l(_l), + c(_c) {} }; int n, m, x, u, v, l, c, tot, a[505], dist[505], ans = 0x3f3f3f3f; diff --git a/Luogu/P3157/P3157.cpp b/Luogu/P3157/P3157.cpp index 77c9cbe0..a85d81eb 100644 --- a/Luogu/P3157/P3157.cpp +++ b/Luogu/P3157/P3157.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; @@ -16,7 +16,9 @@ struct node { node() {} node(int _t, int _i, int _v) - : t(_t), i(_i), v(_v) {} + : t(_t), + i(_i), + v(_v) {} bool operator<(const node& x) { return i == x.i ? v < x.v : i < x.i; diff --git a/Luogu/P3168/P3168.cpp b/Luogu/P3168/P3168.cpp index 1b6e758c..a342512f 100644 --- a/Luogu/P3168/P3168.cpp +++ b/Luogu/P3168/P3168.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include using std::cin; @@ -22,7 +22,10 @@ struct node { long long s; node() - : l(0), r(0), c(0), s(0) {} + : l(0), + r(0), + c(0), + s(0) {} } tr[N << 6]; int build(int, int); diff --git a/Luogu/P3178/P3178.cpp b/Luogu/P3178/P3178.cpp index 2d4e41b5..3784c34e 100644 --- a/Luogu/P3178/P3178.cpp +++ b/Luogu/P3178/P3178.cpp @@ -113,10 +113,16 @@ struct node { long long s, d; node() - : l(0), r(0), s(0), d(0) {} + : l(0), + r(0), + s(0), + d(0) {} node(int _l, int _r) - : l(_l), r(_r), s(0), d(0) {} + : l(_l), + r(_r), + s(0), + d(0) {} } tr[N << 2]; inline void pushup(int u) { diff --git a/Luogu/P3369/P3369.cpp b/Luogu/P3369/P3369.cpp index a9193f63..a9935df7 100644 --- a/Luogu/P3369/P3369.cpp +++ b/Luogu/P3369/P3369.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; @@ -38,10 +38,18 @@ class Treap { // struct Treap::node Treap::node::node() - : left(nullptr), right(nullptr), size(1), val(0), key(rand()) {} + : left(nullptr), + right(nullptr), + size(1), + val(0), + key(rand()) {} Treap::node::node(int _val) - : left(nullptr), right(nullptr), size(1), val(_val), key(rand()) {} + : left(nullptr), + right(nullptr), + size(1), + val(_val), + key(rand()) {} Treap::node::~node() { delete this->left, this->right; diff --git a/Luogu/P3376/P3376.cpp b/Luogu/P3376/P3376.cpp index f271667d..a80ce228 100644 --- a/Luogu/P3376/P3376.cpp +++ b/Luogu/P3376/P3376.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include using std::cin; diff --git a/Luogu/P3381/P3381.cpp b/Luogu/P3381/P3381.cpp index 215ffcc7..8c7f335e 100644 --- a/Luogu/P3381/P3381.cpp +++ b/Luogu/P3381/P3381.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include #include diff --git a/Luogu/P3384/P3384.cpp b/Luogu/P3384/P3384.cpp index ddb85c82..6e4c819d 100644 --- a/Luogu/P3384/P3384.cpp +++ b/Luogu/P3384/P3384.cpp @@ -64,10 +64,16 @@ struct node { long long s, d; node() - : l(0), r(0), s(0), d(0) {} + : l(0), + r(0), + s(0), + d(0) {} node(int _l, int _r) - : l(_l), r(_r), s(0), d(0) {} + : l(_l), + r(_r), + s(0), + d(0) {} } tr[N << 2]; inline void pushup(int u) { diff --git a/Luogu/P3387/P3387.cpp b/Luogu/P3387/P3387.cpp index 962b96a8..fa8a4444 100644 --- a/Luogu/P3387/P3387.cpp +++ b/Luogu/P3387/P3387.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include #include #include diff --git a/Luogu/P3389/P3389.cpp b/Luogu/P3389/P3389.cpp index 8fdf7844..2a39935d 100644 --- a/Luogu/P3389/P3389.cpp +++ b/Luogu/P3389/P3389.cpp @@ -1,6 +1,6 @@ +#include #include #include -#include using std::cin; using std::cout; diff --git a/Luogu/P3390/P3390.cpp b/Luogu/P3390/P3390.cpp index f4a2f467..787c3a28 100644 --- a/Luogu/P3390/P3390.cpp +++ b/Luogu/P3390/P3390.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/Luogu/P3391/P3391.cpp b/Luogu/P3391/P3391.cpp index aaa6b1a0..638c788a 100644 --- a/Luogu/P3391/P3391.cpp +++ b/Luogu/P3391/P3391.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; @@ -14,10 +14,20 @@ struct node { bool d; node() - : l(0), r(0), s(0), v(0), d(false), k(rand()) {} + : l(0), + r(0), + s(0), + v(0), + d(false), + k(rand()) {} node(int _v) - : l(0), r(0), s(1), v(_v), d(false), k(rand()) {} + : l(0), + r(0), + s(1), + v(_v), + d(false), + k(rand()) {} } tr[N]; void pushup(int u) { diff --git a/Luogu/P3396/P3396.cpp b/Luogu/P3396/P3396.cpp index 9b2aa894..6df7ef7c 100644 --- a/Luogu/P3396/P3396.cpp +++ b/Luogu/P3396/P3396.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/Luogu/P3586/P3586.cpp b/Luogu/P3586/P3586.cpp index 26591b99..fe125642 100644 --- a/Luogu/P3586/P3586.cpp +++ b/Luogu/P3586/P3586.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include using std::cin; diff --git a/Luogu/P3810/P3810.cpp b/Luogu/P3810/P3810.cpp index 2a1672cd..260a2d95 100644 --- a/Luogu/P3810/P3810.cpp +++ b/Luogu/P3810/P3810.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; @@ -15,10 +15,18 @@ struct node { int a, b, c, cnt, res; node() - : a(0), b(0), c(0), cnt(0), res(0) {} + : a(0), + b(0), + c(0), + cnt(0), + res(0) {} node(int _a, int _b, int _c) - : a(_a), b(_b), c(_c), cnt(1), res(0) {} + : a(_a), + b(_b), + c(_c), + cnt(1), + res(0) {} bool operator<(const node& x) const { return a == x.a ? b == x.b ? c < x.c : b < x.b : a < x.a; diff --git a/Luogu/P3833/P3833.cpp b/Luogu/P3833/P3833.cpp index 632deff9..5b539e16 100644 --- a/Luogu/P3833/P3833.cpp +++ b/Luogu/P3833/P3833.cpp @@ -94,10 +94,16 @@ struct node { long long s, d; node() - : l(0), r(0), s(0), d(0) {} + : l(0), + r(0), + s(0), + d(0) {} node(int _l, int _r) - : l(_l), r(_r), s(0), d(0) {} + : l(_l), + r(_r), + s(0), + d(0) {} } tr[N << 2]; inline void pushup(int u) { diff --git a/Luogu/P3834/P3834.cpp b/Luogu/P3834/P3834.cpp index 747ffaf7..f42f7d03 100644 --- a/Luogu/P3834/P3834.cpp +++ b/Luogu/P3834/P3834.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include using std::cin; @@ -51,7 +51,9 @@ struct node { int l, r, c; node() - : l(0), r(0), c(0) {} + : l(0), + r(0), + c(0) {} } tr[N << 5]; int build(int l, int r) { diff --git a/Luogu/P4016/P4016.cpp b/Luogu/P4016/P4016.cpp index ee06c03f..cb249c41 100644 --- a/Luogu/P4016/P4016.cpp +++ b/Luogu/P4016/P4016.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include using std::cin; diff --git a/Luogu/P4035/P4035.cpp b/Luogu/P4035/P4035.cpp index 8ee06aef..250a84f0 100644 --- a/Luogu/P4035/P4035.cpp +++ b/Luogu/P4035/P4035.cpp @@ -1,7 +1,7 @@ +#include #include #include #include -#include using std::cin; using std::cout; diff --git a/Luogu/P4092/P4092.cpp b/Luogu/P4092/P4092.cpp index 1aa8b0b3..bf164b31 100644 --- a/Luogu/P4092/P4092.cpp +++ b/Luogu/P4092/P4092.cpp @@ -93,10 +93,14 @@ struct node { int l, r, d; node() - : l(0), r(0), d(-1) {} + : l(0), + r(0), + d(-1) {} node(int _l, int _r) - : l(_l), r(_r), d(-1) {} + : l(_l), + r(_r), + d(-1) {} } tr[N << 2]; inline void pushup(int u) { diff --git a/Luogu/P4114/P4114.cpp b/Luogu/P4114/P4114.cpp index 98ebb18a..5529d857 100644 --- a/Luogu/P4114/P4114.cpp +++ b/Luogu/P4114/P4114.cpp @@ -95,10 +95,14 @@ struct node { int l, r, m; node() - : l(0), r(0), m(0) {} + : l(0), + r(0), + m(0) {} node(int _l, int _r) - : l(_l), r(_r), m(0) {} + : l(_l), + r(_r), + m(0) {} } tr[N << 2]; inline void pushup(int u) { diff --git a/Luogu/P4168/P4168.cpp b/Luogu/P4168/P4168.cpp index 6fee5c78..ac07342e 100644 --- a/Luogu/P4168/P4168.cpp +++ b/Luogu/P4168/P4168.cpp @@ -1,6 +1,6 @@ +#include #include #include -#include #include using std::cin; diff --git a/Luogu/P4315/P4315.cpp b/Luogu/P4315/P4315.cpp index 6a107160..66e97dfc 100644 --- a/Luogu/P4315/P4315.cpp +++ b/Luogu/P4315/P4315.cpp @@ -125,10 +125,18 @@ struct node { int l, r, m, da, dc; node() - : l(0), r(0), m(0), da(0), dc(-1) {} + : l(0), + r(0), + m(0), + da(0), + dc(-1) {} node(int _l, int _r) - : l(_l), r(_r), m(0), da(0), dc(-1) {} + : l(_l), + r(_r), + m(0), + da(0), + dc(-1) {} } tr[N << 2]; inline void pushup(int u) { diff --git a/Luogu/P4342/P4342.cpp b/Luogu/P4342/P4342.cpp index 902f0f7e..b3ec8594 100644 --- a/Luogu/P4342/P4342.cpp +++ b/Luogu/P4342/P4342.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include using std::cin; diff --git a/Luogu/P4568/P4568.cpp b/Luogu/P4568/P4568.cpp index 69d679a0..e773f6c0 100644 --- a/Luogu/P4568/P4568.cpp +++ b/Luogu/P4568/P4568.cpp @@ -1,6 +1,6 @@ +#include #include #include -#include #include #include diff --git a/Luogu/P4668/P4668.cpp b/Luogu/P4668/P4668.cpp index 50d4ceb3..9a18b4bc 100644 --- a/Luogu/P4668/P4668.cpp +++ b/Luogu/P4668/P4668.cpp @@ -13,19 +13,29 @@ struct node { int x, y, step; node() - : x(0), y(0), step(0) {} + : x(0), + y(0), + step(0) {} node(int _x, int _y) - : x(_x), y(_y), step(0) {} + : x(_x), + y(_y), + step(0) {} node(pair _point) - : x(_point.first), y(_point.second), step(0) {} + : x(_point.first), + y(_point.second), + step(0) {} node(pair _point, int _step) - : x(_point.first), y(_point.second), step(_step) {} + : x(_point.first), + y(_point.second), + step(_step) {} node(int _x, int _y, int _step) - : x(_x), y(_y), step(_step) {} + : x(_x), + y(_y), + step(_step) {} }; /** diff --git a/Luogu/P4822/P4822.cpp b/Luogu/P4822/P4822.cpp index 1a263bc8..daef0658 100644 --- a/Luogu/P4822/P4822.cpp +++ b/Luogu/P4822/P4822.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include #include diff --git a/Luogu/P5490/P5490.cpp b/Luogu/P5490/P5490.cpp index 5deffd3e..6737eae9 100644 --- a/Luogu/P5490/P5490.cpp +++ b/Luogu/P5490/P5490.cpp @@ -10,10 +10,16 @@ struct segment { int x, y1, y2, k; segment() - : x(0), y1(0), y2(0), k(0) {} + : x(0), + y1(0), + y2(0), + k(0) {} segment(int _x, int _y1, int _y2, int _k) - : x(_x), y1(_y1), y2(_y2), k(_k) {} + : x(_x), + y1(_y1), + y2(_y2), + k(_k) {} bool operator<(const segment& b) const { return x < b.x; @@ -25,10 +31,16 @@ struct node { long long cnt, len; node() - : l(0), r(0), cnt(0), len(0) {} + : l(0), + r(0), + cnt(0), + len(0) {} node(int _l, int _r) - : l(_l), r(_r), cnt(0), len(0) {} + : l(_l), + r(_r), + cnt(0), + len(0) {} } tr[100005 << 3]; int find(int y) { diff --git a/Luogu/P5596/P5596.cpp b/Luogu/P5596/P5596.cpp index 1d5903d3..7072c285 100644 --- a/Luogu/P5596/P5596.cpp +++ b/Luogu/P5596/P5596.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/Luogu/P6136/P6136.cpp b/Luogu/P6136/P6136.cpp index 267695fe..e4ce143b 100644 --- a/Luogu/P6136/P6136.cpp +++ b/Luogu/P6136/P6136.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; @@ -39,10 +39,18 @@ class Treap { // struct Treap::node Treap::node::node() - : left(nullptr), right(nullptr), size(1), val(0), key(rand()) {} + : left(nullptr), + right(nullptr), + size(1), + val(0), + key(rand()) {} Treap::node::node(int _val) - : left(nullptr), right(nullptr), size(1), val(_val), key(rand()) {} + : left(nullptr), + right(nullptr), + size(1), + val(_val), + key(rand()) {} Treap::node::~node() { delete this->left, this->right; diff --git a/Luogu/P6565/P6565.cpp b/Luogu/P6565/P6565.cpp index e041256d..d3e6949f 100644 --- a/Luogu/P6565/P6565.cpp +++ b/Luogu/P6565/P6565.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; @@ -12,7 +12,8 @@ struct node { int id, cnt; node() - : id(0), cnt(0) {} + : id(0), + cnt(0) {} } a[N]; int n; diff --git a/Luogu/P7074/solution.md b/Luogu/P7074/solution.md index a3fe48af..fadf6077 100644 --- a/Luogu/P7074/solution.md +++ b/Luogu/P7074/solution.md @@ -1,6 +1,6 @@ ## 思路 -+ 算法:记忆化搜索 +- 算法:记忆化搜索 设 $F_{i,j,0}$ 表示从一个格子上方走到该格子的路径最大和,$F_{i,j,1}$ 表示从一个格子下方走到该格子的路径最大和。 diff --git a/Luogu/P7868/P7868.cpp b/Luogu/P7868/P7868.cpp index 63512f07..05e37b8b 100644 --- a/Luogu/P7868/P7868.cpp +++ b/Luogu/P7868/P7868.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/Luogu/P7912/P7912.cpp b/Luogu/P7912/P7912.cpp index 128d89d7..f1c8fc77 100644 --- a/Luogu/P7912/P7912.cpp +++ b/Luogu/P7912/P7912.cpp @@ -7,10 +7,14 @@ struct node { bool value; node() - : start(-1), end(-1), value(false) {} + : start(-1), + end(-1), + value(false) {} node(int _start, int _end, bool _value) - : start(_start), end(_end), value(_value) {} + : start(_start), + end(_end), + value(_value) {} }; int n, cnt; diff --git a/Luogu/P8251/P8251.cpp b/Luogu/P8251/P8251.cpp index efc72716..ec553068 100644 --- a/Luogu/P8251/P8251.cpp +++ b/Luogu/P8251/P8251.cpp @@ -12,10 +12,14 @@ struct node { int a, b, idx; node() - : a(0), b(0), idx(0) {} + : a(0), + b(0), + idx(0) {} node(int _a, int _b, int _idx) - : a(_a), b(_b), idx(_idx) {} + : a(_a), + b(_b), + idx(_idx) {} }; int n, q, a[N], b[N], id[N], t[N], ans[N]; diff --git a/Luogu/P8255/P8255.cpp b/Luogu/P8255/P8255.cpp index 57275393..053f4e42 100644 --- a/Luogu/P8255/P8255.cpp +++ b/Luogu/P8255/P8255.cpp @@ -1,6 +1,6 @@ +#include #include #include -#include using std::cin; using std::cout; diff --git a/Luogu/SP2713/SP2713.cpp b/Luogu/SP2713/SP2713.cpp index d692f379..70ffe7bf 100644 --- a/Luogu/SP2713/SP2713.cpp +++ b/Luogu/SP2713/SP2713.cpp @@ -1,6 +1,6 @@ +#include #include #include -#include const int N = 100005; @@ -12,10 +12,16 @@ struct node { long long s, m; node() - : l(0), r(0), s(0), m(0) {} + : l(0), + r(0), + s(0), + m(0) {} node(int _l, int _r) - : l(_l), r(_r), s(0), m(0) {} + : l(_l), + r(_r), + s(0), + m(0) {} } * tr; void pushup(int); diff --git a/Luogu/SP3267/SP3267.cpp b/Luogu/SP3267/SP3267.cpp index 249980a6..bd507375 100644 --- a/Luogu/SP3267/SP3267.cpp +++ b/Luogu/SP3267/SP3267.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include #include @@ -49,10 +49,18 @@ struct node { int lid, rid; node() - : l(0), r(0), c(0), lid(0), rid(0) {} + : l(0), + r(0), + c(0), + lid(0), + rid(0) {} node(int _l, int _r) - : l(_l), r(_r), c(0), lid(0), rid(0) {} + : l(_l), + r(_r), + c(0), + lid(0), + rid(0) {} } tr[N << 7]; inline void pushup(int u) { diff --git a/Luogu/SP3946/SP3946.cpp b/Luogu/SP3946/SP3946.cpp index 747ffaf7..f42f7d03 100644 --- a/Luogu/SP3946/SP3946.cpp +++ b/Luogu/SP3946/SP3946.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include using std::cin; @@ -51,7 +51,9 @@ struct node { int l, r, c; node() - : l(0), r(0), c(0) {} + : l(0), + r(0), + c(0) {} } tr[N << 5]; int build(int l, int r) { diff --git a/Luogu/T206731/T206731.cpp b/Luogu/T206731/T206731.cpp index 63e621f6..6fb1da6f 100644 --- a/Luogu/T206731/T206731.cpp +++ b/Luogu/T206731/T206731.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/Luogu/T216906/T216906.cpp b/Luogu/T216906/T216906.cpp index 2d944817..237d6860 100644 --- a/Luogu/T216906/T216906.cpp +++ b/Luogu/T216906/T216906.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/Luogu/T216907/T216907.cpp b/Luogu/T216907/T216907.cpp index 1be9f1ea..e3b771f4 100644 --- a/Luogu/T216907/T216907.cpp +++ b/Luogu/T216907/T216907.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/Luogu/T243085/T243085.cpp b/Luogu/T243085/T243085.cpp index c57a5cc2..08bb7601 100644 --- a/Luogu/T243085/T243085.cpp +++ b/Luogu/T243085/T243085.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include using std::cin; @@ -16,10 +16,16 @@ struct node { bool none; node() - : l(0), r(0), s(0), none(false) {} + : l(0), + r(0), + s(0), + none(false) {} node(int _l, int _r) - : l(_l), r(_r), s(0), none(false) {} + : l(_l), + r(_r), + s(0), + none(false) {} } tr[N << 2]; inline void pushdown(int u) { diff --git a/POJ/1456/1456.cpp b/POJ/1456/1456.cpp index 6edef1cb..df1eb58d 100644 --- a/POJ/1456/1456.cpp +++ b/POJ/1456/1456.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include using namespace std; diff --git a/POJ/1830/1830.cpp b/POJ/1830/1830.cpp index 0f203efb..db2ae963 100644 --- a/POJ/1830/1830.cpp +++ b/POJ/1830/1830.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/POJ/1966/1966.cpp b/POJ/1966/1966.cpp index 97b71e72..bc2dbe1f 100644 --- a/POJ/1966/1966.cpp +++ b/POJ/1966/1966.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include #include diff --git a/POJ/3696/3696.cpp b/POJ/3696/3696.cpp index bde4a0d3..baf7137b 100644 --- a/POJ/3696/3696.cpp +++ b/POJ/3696/3696.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include using std::cin; diff --git a/S2OJ/100/100.cpp b/S2OJ/100/100.cpp index aaa6b1a0..638c788a 100644 --- a/S2OJ/100/100.cpp +++ b/S2OJ/100/100.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; @@ -14,10 +14,20 @@ struct node { bool d; node() - : l(0), r(0), s(0), v(0), d(false), k(rand()) {} + : l(0), + r(0), + s(0), + v(0), + d(false), + k(rand()) {} node(int _v) - : l(0), r(0), s(1), v(_v), d(false), k(rand()) {} + : l(0), + r(0), + s(1), + v(_v), + d(false), + k(rand()) {} } tr[N]; void pushup(int u) { diff --git a/S2OJ/103/103.cpp b/S2OJ/103/103.cpp index bb3321ae..ccf17739 100644 --- a/S2OJ/103/103.cpp +++ b/S2OJ/103/103.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include #include diff --git a/S2OJ/104/104.cpp b/S2OJ/104/104.cpp index 9a141aa5..a3736721 100644 --- a/S2OJ/104/104.cpp +++ b/S2OJ/104/104.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include #include diff --git a/S2OJ/106/data/std.cpp b/S2OJ/106/data/std.cpp index 8da43b16..e8ce20f9 100644 --- a/S2OJ/106/data/std.cpp +++ b/S2OJ/106/data/std.cpp @@ -1,84 +1,3 @@ -#include -#define R register int -#define ll long long -#define db double -#define FOR(i, j, k) for (R i = j; i <= k; i++) -#define DEC(i, j, k) for (R i = j; i >= k; i--) -#define walk(i, u) for (R i = 0; i < g[u].size(); i++) -#define visch(i, u) for (R i = head[u]; i; i = edge[i].next) -using namespace std; - -inline int read() -{ - int x = 0; - bool flag = 0; - int ch = getchar(); - while ('0' > ch || ch > '9') - { - if (ch == '-') - flag = 1; - ch = getchar(); - } - while ('0' <= ch && ch <= '9') - { - x = (x << 1) + (x << 3) + (ch ^ 48); - ch = getchar(); - } - return flag ? -x : x; -} - -const int maxn = 2510, maxm = 6210; -int n, m, s, t; -struct E -{ - int to, nxt, w; -} edge[maxm << 1]; -int head[maxn], ec; -inline void adde(int u, int v, int w) -{ - edge[++ec].to = v; - edge[ec].nxt = head[u]; - edge[ec].w = w; - head[u] = ec; -} - -deque q; -ll dis[maxn]; -bool vis[maxn]; -inline void spfa() -{ - FOR(i, 1, n) dis[i] = 0x3f3f3f3f3f3f3f3f; - dis[s] = 0; - vis[s] = 1; - q.push_back(s); - while (q.size()) - { - int u = q.front(); - q.pop_front(); - vis[u] = 0; - for (int i = head[u]; i; i = edge[i].nxt) - { - int v = edge[i].to; - if (dis[u] + edge[i].w < dis[v]) - { - dis[v] = dis[u] + edge[i].w; - if (!vis[v]) - q.push_back(v); - } - } - } -} - -int main() -{ - n = read(), m = read(), s = read(), t = read(); - FOR(i, 1, m) - { - int x = read(), y = read(), z = read(); - adde(x, y, z); - adde(y, x, z); - } - spfa(); - printf("%lld", dis[t]); - return 0; -} +version https://git-lfs.github.com/spec/v1 +oid sha256:cd74ea58b6923bd249d8759ea101d3c97a38f99c70e5d9d5a7b3370398677c97 +size 1682 diff --git a/S2OJ/106/data/val.cpp b/S2OJ/106/data/val.cpp index 214fdc91..b7bf4a60 100644 --- a/S2OJ/106/data/val.cpp +++ b/S2OJ/106/data/val.cpp @@ -1,47 +1,3 @@ -#include -#include "testlib.h" -using namespace std; - -const int MAXN = 5005; -const int LIM = 3e5; -int f[MAXN]; -int n,m,s,t; - -inline int find(int x) -{ - return f[x]!=x?f[x]=find(f[x]):x; -} - -inline void merge(int x,int y) -{ - x=find(x); y=find(y); - if(x^y) f[x]=y; -} - -int main(int argc, char *argv[]) -{ - registerValidation(); - - n=inf.readInt(1,2500); inf.readSpace(); - m=inf.readInt(1,min(n*(n-1)/2,6200)); inf.readSpace(); - s=inf.readInt(1,n); inf.readSpace(); - t=inf.readInt(1,n); inf.readEoln(); - - for(int i=1; i<=n; ++i) f[i]=i; - - for(int i=1,u,v; i<=m; ++i) - { - u=inf.readInt(1,n); inf.readSpace(); - v=inf.readInt(1,n); inf.readSpace(); - inf.readInt(1,LIM); inf.readEoln(); - - ensuref(u!=v,"Self loop found!"); - merge(u,v); - } - - inf.readEof(); - - ensuref(find(s)==find(t),"The graph is not connected!"); - - return 0; -} +version https://git-lfs.github.com/spec/v1 +oid sha256:9e36730fae754abf8df63bfcf4222f4e5e2b118ccfff17c73d23e861178b3cb6 +size 1020 diff --git a/S2OJ/1094/data/chk.cpp b/S2OJ/1094/data/chk.cpp index d28509cd..06d606eb 100644 --- a/S2OJ/1094/data/chk.cpp +++ b/S2OJ/1094/data/chk.cpp @@ -1,53 +1,3 @@ -#include -#include -#include -#include -#include -#include -#include "testlib.h" -#define MP make_pair -#define ll long long -#define fi first -#define se second -using namespace std; - -template -inline void Mx(T& x, T y) { - x < y && (x = y); -} - -template -inline void Mn(T& x, T y) { - x > y && (x = y); -} - -const int N = 205000; -int a[N], d[N]; -int main(int argc, char* argv[]) { - registerTestlibCmd(argc, argv); - int n = inf.readInt(); - for (int i = 1; i <= n; ++i) - a[i] = inf.readInt(); - int m = ans.readInt(1, 100000); - int t = ouf.readInt(1, 100000); - if (t > m) { - quitf(_wa, "your m is larger"); - return 0; - } - if (t < m) { - quitf(_wa, "your m is smaller"); - return 0; - } - for (int i = 1; i <= m; ++i) { - int l = ouf.readInt(1, n), r = ouf.readInt(l, n); - d[l]++, d[r + 1]--; - } - int nw = 0; - for (int i = 1; i <= n; ++i) { - nw += d[i], a[i] -= nw; - if (a[i]) - quitf(_wa, "your ans is not correct"); - } - quitf(_ok, "Correct"); - return 0; -} +version https://git-lfs.github.com/spec/v1 +oid sha256:53a9ca871cc1bbdebc8c409ba5167992c5a360d0cea113d1c802b396417980ce +size 1147 diff --git a/S2OJ/1159/1159.cpp b/S2OJ/1159/1159.cpp index 50d4ceb3..9a18b4bc 100644 --- a/S2OJ/1159/1159.cpp +++ b/S2OJ/1159/1159.cpp @@ -13,19 +13,29 @@ struct node { int x, y, step; node() - : x(0), y(0), step(0) {} + : x(0), + y(0), + step(0) {} node(int _x, int _y) - : x(_x), y(_y), step(0) {} + : x(_x), + y(_y), + step(0) {} node(pair _point) - : x(_point.first), y(_point.second), step(0) {} + : x(_point.first), + y(_point.second), + step(0) {} node(pair _point, int _step) - : x(_point.first), y(_point.second), step(_step) {} + : x(_point.first), + y(_point.second), + step(_step) {} node(int _x, int _y, int _step) - : x(_x), y(_y), step(_step) {} + : x(_x), + y(_y), + step(_step) {} }; /** diff --git a/S2OJ/1167/data/chk.cpp b/S2OJ/1167/data/chk.cpp index 03498562..288857b4 100644 --- a/S2OJ/1167/data/chk.cpp +++ b/S2OJ/1167/data/chk.cpp @@ -1,17 +1,3 @@ -#include "testlib.h" -#include - -using ui = unsigned int; - -signed main(int argc, char** argv) { - registerTestlibCmd(argc, argv); - - int n = inf.readInt(); - for (int i = 1; i <= n; ++i) { - ui x = ui(ouf.readLong()), y = ui(ouf.readLong()); - if (x != y) { - quitp(1.0 * (i - 1) / n, "jury's anwser is %u, but your answer is %u", x, y); - } - } - quitf(_ok, "Accept!"); -} +version https://git-lfs.github.com/spec/v1 +oid sha256:f242df81cba6b72c89ecbae9772c5fe339ed514ce1bdb395d12473464ca803f2 +size 426 diff --git a/S2OJ/1167/data/require/implementer.cpp b/S2OJ/1167/data/require/implementer.cpp index 8219268c..deb595ef 100644 --- a/S2OJ/1167/data/require/implementer.cpp +++ b/S2OJ/1167/data/require/implementer.cpp @@ -1,25 +1,3 @@ -// 一般用于函数式交互 -#include "head.h" -#include - -#define ui unsigned int - -static inline ui randnum() { - static ui seed = time(nullptr); - return seed ^= seed << 5, seed ^= seed >> 7, seed ^= seed << 13; -} -std::string str = "1145141919810efghkkk"; - -signed main() { - int n; - std::cin >> n; - ui ps = (randnum() % str.length()); - if (!ps) ++ps; - std::cout << str.substr(0, ps); - for (int i = 1; i <= n; ++i) { - ui a = randnum(), b = randnum(); - ui ret = solv(a, b); - if (i == 1) std::cout << str.substr(ps) << '\n'; - std::cout << a * b << ' ' << ret << '\n'; - } -} +version https://git-lfs.github.com/spec/v1 +oid sha256:15c9db6937ecabbbcd890a9eafbeaa902994b990edc05888f3fad7a5600f4d23 +size 669 diff --git a/S2OJ/1172/1172.cpp b/S2OJ/1172/1172.cpp index 6c97e2e6..b2492a81 100644 --- a/S2OJ/1172/1172.cpp +++ b/S2OJ/1172/1172.cpp @@ -84,10 +84,14 @@ struct node { int l, r, d; node() - : l(0), r(0), d(0) {} + : l(0), + r(0), + d(0) {} node(int _l, int _r) - : l(_l), r(_r), d(0) {} + : l(_l), + r(_r), + d(0) {} } tr[N << 2]; void pushdown(int u) { diff --git a/S2OJ/1199/1199.cpp b/S2OJ/1199/1199.cpp index 52564c7e..d8a480ff 100644 --- a/S2OJ/1199/1199.cpp +++ b/S2OJ/1199/1199.cpp @@ -76,10 +76,14 @@ struct node { int l, r, id; node() - : l(0), r(0), id(0) {} + : l(0), + r(0), + id(0) {} node(int _l, int _r) - : l(_l), r(_r), id(0) {} + : l(_l), + r(_r), + id(0) {} } tr[N << 2]; inline void pushup(int u) { diff --git a/S2OJ/1224/1224.cpp b/S2OJ/1224/1224.cpp index 5b7b796a..44a73b0d 100644 --- a/S2OJ/1224/1224.cpp +++ b/S2OJ/1224/1224.cpp @@ -1,12 +1,12 @@ #pragma GCC optimize("Ofast") -#include #include +#include #include /* imported from ../../utils/BigInt.h */ -#include #include +#include #include class BigInt { diff --git a/S2OJ/1238/1238.cpp b/S2OJ/1238/1238.cpp index d1e92755..3e26082d 100644 --- a/S2OJ/1238/1238.cpp +++ b/S2OJ/1238/1238.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/S2OJ/1256/1256.cpp b/S2OJ/1256/1256.cpp index ddbe3b6c..daa37432 100644 --- a/S2OJ/1256/1256.cpp +++ b/S2OJ/1256/1256.cpp @@ -1,9 +1,9 @@ #pragma GCC optimize("Ofast") +#include #include #include #include -#include #include const int N = 2e5 + 5; @@ -32,10 +32,16 @@ struct segment { int x, y1, y2, k; segment() - : x(0), y1(0), y2(0), k(0) {} + : x(0), + y1(0), + y2(0), + k(0) {} segment(int _x, int _y1, int _y2, int _k) - : x(_x), y1(_y1), y2(_y2), k(_k) {} + : x(_x), + y1(_y1), + y2(_y2), + k(_k) {} bool operator<(const segment& b) const { return x == b.x ? k > b.k : x < b.x; @@ -51,10 +57,16 @@ struct node { long long cnt, len; node() - : l(0), r(0), cnt(0), len(0) {} + : l(0), + r(0), + cnt(0), + len(0) {} node(int _l, int _r) - : l(_l), r(_r), cnt(0), len(0) {} + : l(_l), + r(_r), + cnt(0), + len(0) {} } tr[N << 3]; inline int find(int y) { diff --git a/S2OJ/1266/1266.cpp b/S2OJ/1266/1266.cpp index 6f4f43e8..8af1ce5f 100644 --- a/S2OJ/1266/1266.cpp +++ b/S2OJ/1266/1266.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include #include diff --git a/S2OJ/1426/1426.cpp b/S2OJ/1426/1426.cpp index d7622b07..48e2f92b 100644 --- a/S2OJ/1426/1426.cpp +++ b/S2OJ/1426/1426.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include #include #include diff --git a/S2OJ/164/164.cpp b/S2OJ/164/164.cpp index 8652fb2e..e35edef0 100644 --- a/S2OJ/164/164.cpp +++ b/S2OJ/164/164.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include using std::cin; diff --git a/S2OJ/164/data/std.cpp b/S2OJ/164/data/std.cpp index a60a450c..66fc0d39 100644 --- a/S2OJ/164/data/std.cpp +++ b/S2OJ/164/data/std.cpp @@ -1,53 +1,3 @@ -#include -using namespace std; - -inline int read() -{ - int x=0,f=1,c=getchar(); - while(c<48) c=='-'&&(f=-1),c=getchar(); - while(c>47) x=x*10+c-'0',c=getchar(); - return x*f; -} - -const int MAXN = 200005; -int ls[MAXN*32],rs[MAXN*32],sum[MAXN*32]; -int rt[MAXN],val[MAXN],raw[MAXN]; -int n,m,q,tot; - -void insert(int &x,int y,int l,int r,int k) -{ - ls[x=++tot]=ls[y]; rs[x]=rs[y]; sum[x]=sum[y]+1; - if(l==r) return; - int mid=(l+r)>>1; - if(k<=mid) insert(ls[x],ls[y],l,mid,k); - if(k>mid) insert(rs[x],rs[y],mid+1,r,k); -} - -int query(int x,int y,int l,int r,int k) -{ - if(l==r) return l; - int mid=(l+r)>>1,s=sum[ls[y]]-sum[ls[x]]; - if(k<=s) return query(ls[x],ls[y],l,mid,k); - return query(rs[x],rs[y],mid+1,r,k-s); -} - -int main(int argc, char const *argv[]) -{ - n=read(); q=read(); - for(int i=1; i<=n; ++i) - val[i]=raw[i]=read(); - sort(val+1,val+n+1); - m=unique(val+1,val+n+1)-val-1; - for(int i=1,k; i<=n; ++i) - { - k=lower_bound(val+1,val+m+1,raw[i])-val; - insert(rt[i],rt[i-1],1,m,k); - } - for(int i=1,l,r,k,x; i<=q; ++i) - { - l=read(); r=read(); k=read(); - x=query(rt[l-1],rt[r],1,m,k); - printf("%d\n", val[x]); - } - return 0; -} +version https://git-lfs.github.com/spec/v1 +oid sha256:a9f0370dc56182920f6604bb5cfaf93f8e7e491b6da7459a7dd3de9c323ab9a1 +size 1462 diff --git a/S2OJ/164/data/val.cpp b/S2OJ/164/data/val.cpp index 7d8efc32..c4128888 100644 --- a/S2OJ/164/data/val.cpp +++ b/S2OJ/164/data/val.cpp @@ -1,33 +1,3 @@ -#include -#include "testlib.h" -using namespace std; - -const int MAXN = 2e5; -const int LIM = 1e9; -int n,m; - -int main(int argc, char *argv[]) -{ - registerValidation(); - - n=inf.readInt(1,MAXN); inf.readSpace(); - m=inf.readInt(1,MAXN); inf.readEoln(); - - for(int i=1; i<=n; ++i) - { - inf.readInt(-LIM,LIM); - if(i!=n) inf.readSpace(); - } - - inf.readEoln(); - - for(int i=1; i<=m; ++i) - { - int l=inf.readInt(1,n); inf.readSpace(); - int r=inf.readInt(l,n); inf.readSpace(); - inf.readInt(1,r-l+1); inf.readEoln(); - } - - inf.readEof(); - return 0; -} +version https://git-lfs.github.com/spec/v1 +oid sha256:b04cf65c26b578bbdb957a791f7be9e4eaf5e5cee91ce83d5e6a4afcd889b774 +size 675 diff --git a/S2OJ/165/data/val.cpp b/S2OJ/165/data/val.cpp index 0b979c27..db4f241a 100644 --- a/S2OJ/165/data/val.cpp +++ b/S2OJ/165/data/val.cpp @@ -1,24 +1,3 @@ -#include -#include "testlib.h" -using namespace std; - -const int LIM = 1e6; -string s,t; -int n,m; - -int main(int argc, char *argv[]) -{ - registerValidation(); - - s=inf.readWord(); inf.readEoln(); - t=inf.readWord(); inf.readEoln(); - - inf.readEof(); - - n=s.length(); m=t.length(); - - ensuref(n<=LIM&&m<=LIM, "The string is too long!"); - ensuref(n>=m, "The second string shouldn't be longer than the first one!"); - - return 0; -} +version https://git-lfs.github.com/spec/v1 +oid sha256:744e931255e7379e8dcd3dec9008d6254c464474c8feb2bacbaed55d46a0dae3 +size 487 diff --git a/S2OJ/181/181.cpp b/S2OJ/181/181.cpp index 9626e4e1..b4fc20c7 100644 --- a/S2OJ/181/181.cpp +++ b/S2OJ/181/181.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/S2OJ/184/184.cpp b/S2OJ/184/184.cpp index 2d67ce3e..89f64198 100644 --- a/S2OJ/184/184.cpp +++ b/S2OJ/184/184.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include #include diff --git a/S2OJ/188/188.cpp b/S2OJ/188/188.cpp index eb75075c..ade4aa61 100644 --- a/S2OJ/188/188.cpp +++ b/S2OJ/188/188.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/S2OJ/399/399.cpp b/S2OJ/399/399.cpp index 11e63cb7..dbb8cece 100644 --- a/S2OJ/399/399.cpp +++ b/S2OJ/399/399.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include using std::cin; diff --git a/S2OJ/400/400.cpp b/S2OJ/400/400.cpp index 4e479464..b1def66d 100644 --- a/S2OJ/400/400.cpp +++ b/S2OJ/400/400.cpp @@ -1,7 +1,7 @@ #pragma GCC optimize("Ofast") -#include #include +#include #include #include diff --git a/S2OJ/790/790.cpp b/S2OJ/790/790.cpp index 3e1b5473..aa5e7d0c 100644 --- a/S2OJ/790/790.cpp +++ b/S2OJ/790/790.cpp @@ -11,7 +11,8 @@ struct node { node() {} node(int _t, long long _p) - : t(_t), p(_p) {} + : t(_t), + p(_p) {} }; int n, t; diff --git a/S2OJ/99/99.cpp b/S2OJ/99/99.cpp index 00cd78b2..f7119f0b 100644 --- a/S2OJ/99/99.cpp +++ b/S2OJ/99/99.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; @@ -60,10 +60,18 @@ int main() { // struct Treap::node Treap::node::node() - : l(0), r(0), s(0), v(0), k(rand()) {} + : l(0), + r(0), + s(0), + v(0), + k(rand()) {} Treap::node::node(int _v) - : l(0), r(0), s(1), v(_v), k(rand()) {} + : l(0), + r(0), + s(1), + v(_v), + k(rand()) {} // class Treap diff --git a/XJOI/contest/22a/C/C.cpp b/XJOI/contest/22a/C/C.cpp index 05e271fb..507ff943 100644 --- a/XJOI/contest/22a/C/C.cpp +++ b/XJOI/contest/22a/C/C.cpp @@ -1,6 +1,6 @@ +#include #include #include -#include using std::cin; using std::cout; diff --git a/ybt/1263/1263.cpp b/ybt/1263/1263.cpp index 8685e654..ec537dab 100644 --- a/ybt/1263/1263.cpp +++ b/ybt/1263/1263.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/ybt/1265/1265.cpp b/ybt/1265/1265.cpp index 4f4280a7..a9a1837f 100644 --- a/ybt/1265/1265.cpp +++ b/ybt/1265/1265.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include using std::cin; diff --git a/ybt/1284/1284.cpp b/ybt/1284/1284.cpp index d583c309..8b694987 100644 --- a/ybt/1284/1284.cpp +++ b/ybt/1284/1284.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout; diff --git a/ybt/1286/1286.cpp b/ybt/1286/1286.cpp index de2d15b9..ce61ed09 100644 --- a/ybt/1286/1286.cpp +++ b/ybt/1286/1286.cpp @@ -1,6 +1,6 @@ +#include #include #include -#include using std::cin; using std::cout; diff --git a/ybt/1287/1287.cpp b/ybt/1287/1287.cpp index bd270dd3..f5d6f067 100644 --- a/ybt/1287/1287.cpp +++ b/ybt/1287/1287.cpp @@ -1,5 +1,5 @@ -#include #include +#include using std::cin; using std::cout;