0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-10-18 11:28:48 +00:00

chore: update format configs

This commit is contained in:
Baoshuo Ren 2022-06-01 09:45:41 +08:00
parent 67b90577c5
commit 71f42f3e71
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A
249 changed files with 1010 additions and 1148 deletions

View File

@ -5,11 +5,37 @@ ColumnLimit: 0
IndentWidth: 4 IndentWidth: 4
AccessModifierOffset: -2 AccessModifierOffset: -2
NamespaceIndentation: All NamespaceIndentation: All
AlignOperands: AlignAfterOperator
AllowShortLoopsOnASingleLine: true AllowShortLoopsOnASingleLine: true
AllowShortBlocksOnASingleLine: true AllowShortBlocksOnASingleLine: true
AllowShortFunctionsOnASingleLine: Empty AllowShortFunctionsOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: true AllowShortCaseLabelsOnASingleLine: true
AllowShortIfStatementsOnASingleLine: true AllowShortIfStatementsOnASingleLine: AllIfsAndElse
EmptyLineBeforeAccessModifier: LogicalBlock EmptyLineBeforeAccessModifier: LogicalBlock
SeparateDefinitionBlocks: Always SeparateDefinitionBlocks: Always
PointerAlignment: Right PointerAlignment: Right
BinPackArguments: false
BinPackParameters: false
PackConstructorInitializers: CurrentLine
IncludeCategories:
- Regex: '^<ext/.*\.h>'
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

View File

@ -1,5 +1,6 @@
{ {
"tabWidth": 4, "tabWidth": 4,
"singleQuote": true,
"overrides": [ "overrides": [
{ {
"files": "*.md", "files": "*.md",
@ -12,6 +13,24 @@
"options": { "options": {
"tabWidth": 2 "tabWidth": 2
} }
},
{
"files": "*.json",
"options": {
"tabWidth": 2
}
},
{
"files": ".prettierrc",
"options": {
"tabWidth": 2
}
},
{
"files": ".clang-format",
"options": {
"tabWidth": 2
}
} }
] ]
} }

View File

@ -1,5 +1,5 @@
#include <array>
#include <iostream> #include <iostream>
#include <array>
#include <stack> #include <stack>
#include <vector> #include <vector>

View File

@ -104,10 +104,20 @@ struct node {
int l, r, s, d, lc, rc; int l, r, s, d, lc, rc;
node() 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) 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]; } tr[N << 2];
inline void pushup(int u) { inline void pushup(int u) {

View File

@ -1,5 +1,5 @@
#include <cstring>
#include <iostream> #include <iostream>
#include <cstring>
using std::cin; using std::cin;
using std::cout; using std::cout;

View File

@ -1,5 +1,5 @@
#include <algorithm>
#include <iostream> #include <iostream>
#include <algorithm>
#include <limits> #include <limits>
using std::cin; using std::cin;

View File

@ -1,5 +1,5 @@
#include <algorithm>
#include <iostream> #include <iostream>
#include <algorithm>
using std::cin; using std::cin;
using std::cout; using std::cout;

View File

@ -1,5 +1,5 @@
#include <cstring>
#include <iostream> #include <iostream>
#include <cstring>
using std::cin; using std::cin;
using std::cout; using std::cout;

View File

@ -1,7 +1,7 @@
#include <iostream>
#include <algorithm> #include <algorithm>
#include <cmath> #include <cmath>
#include <iomanip> #include <iomanip>
#include <iostream>
using std::cin; using std::cin;
using std::cout; using std::cout;

View File

@ -1,5 +1,5 @@
#include <cstring>
#include <iostream> #include <iostream>
#include <cstring>
using std::cin; using std::cin;
using std::cout; using std::cout;

View File

@ -1,5 +1,5 @@
#include <cstring>
#include <iostream> #include <iostream>
#include <cstring>
#include <limits> #include <limits>
#include <queue> #include <queue>

View File

@ -1,5 +1,5 @@
#include <cstring>
#include <iostream> #include <iostream>
#include <cstring>
#include <queue> #include <queue>
using std::cin; using std::cin;

View File

@ -1,5 +1,5 @@
#include <cstring>
#include <iostream> #include <iostream>
#include <cstring>
#include <queue> #include <queue>
using std::cin; using std::cin;

View File

@ -1,5 +1,5 @@
#include <cstring>
#include <iostream> #include <iostream>
#include <cstring>
#include <limits> #include <limits>
#include <queue> #include <queue>

View File

@ -1,5 +1,5 @@
#include <cstdlib>
#include <iostream> #include <iostream>
#include <cstdlib>
using std::cin; using std::cin;
using std::cout; using std::cout;
@ -14,10 +14,20 @@ struct node {
bool d; bool d;
node() 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) 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]; } tr[N];
void pushup(int u) { void pushup(int u) {

View File

@ -10,10 +10,16 @@ struct segment {
int k; int k;
segment() 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) 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 { bool operator<(const segment& b) const {
return x < b.x; return x < b.x;
@ -25,10 +31,16 @@ struct node {
double len; double len;
node() node()
: l(0), r(0), cnt(0), len(0) {} : l(0),
r(0),
cnt(0),
len(0) {}
node(int _l, int _r) node(int _l, int _r)
: l(_l), r(_r), cnt(0), len(0) {} : l(_l),
r(_r),
cnt(0),
len(0) {}
} tr[10005 << 3]; } tr[10005 << 3];
int find(double y) { int find(double y) {

View File

@ -1,6 +1,6 @@
#include <iostream>
#include <algorithm> #include <algorithm>
#include <cstring> #include <cstring>
#include <iostream>
#include <vector> #include <vector>
using std::cin; using std::cin;

View File

@ -1,5 +1,5 @@
#include <cstdlib>
#include <iostream> #include <iostream>
#include <cstdlib>
using std::cin; using std::cin;
using std::cout; using std::cout;
@ -45,10 +45,18 @@ struct node {
int l, r, s, v, k; int l, r, s, v, k;
node() node()
: l(0), r(0), s(0), v(0), k(rand()) {} : l(0),
r(0),
s(0),
v(0),
k(rand()) {}
node(int _v) 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]; } tr[N];
inline void pushup(int u) { inline void pushup(int u) {

View File

@ -1,5 +1,5 @@
#include <algorithm>
#include <iostream> #include <iostream>
#include <algorithm>
#include <limits> #include <limits>
#include <vector> #include <vector>
@ -52,7 +52,9 @@ struct node {
int l, r, c; int l, r, c;
node() node()
: l(0), r(0), c(0) {} : l(0),
r(0),
c(0) {}
} tr[N << 5]; } tr[N << 5];
int build(int l, int r) { int build(int l, int r) {

View File

@ -11,10 +11,16 @@ struct node {
long long s, d; long long s, d;
node() node()
: l(0), r(0), s(0), d(0) {} : l(0),
r(0),
s(0),
d(0) {}
node(int _l, int _r) node(int _l, int _r)
: l(_l), r(_r), s(0), d(0) {} : l(_l),
r(_r),
s(0),
d(0) {}
} tr[100005 << 2]; } tr[100005 << 2];
void dfs1(int u, int father) { void dfs1(int u, int father) {

View File

@ -1,5 +1,5 @@
#include <cstring>
#include <iostream> #include <iostream>
#include <cstring>
using std::cin; using std::cin;
using std::cout; using std::cout;

View File

@ -1,5 +1,5 @@
#include <algorithm>
#include <iostream> #include <iostream>
#include <algorithm>
using std::cin; using std::cin;
using std::cout; using std::cout;
@ -11,10 +11,18 @@ struct node {
int a, b, c, cnt, res; int a, b, c, cnt, res;
node() 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) 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 { bool operator<(const node& x) const {
return a == x.a ? b == x.b ? c < x.c : b < x.b : a < x.a; return a == x.a ? b == x.b ? c < x.c : b < x.b : a < x.a;

View File

@ -1,5 +1,5 @@
#include <algorithm>
#include <iostream> #include <iostream>
#include <algorithm>
#include <limits> #include <limits>
using std::cin; using std::cin;

View File

@ -10,10 +10,16 @@ struct segment {
int x, y1, y2, k; int x, y1, y2, k;
segment() 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) 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 { bool operator<(const segment& b) const {
return x < b.x; return x < b.x;
@ -25,10 +31,16 @@ struct node {
long long cnt, len; long long cnt, len;
node() node()
: l(0), r(0), cnt(0), len(0) {} : l(0),
r(0),
cnt(0),
len(0) {}
node(int _l, int _r) node(int _l, int _r)
: l(_l), r(_r), cnt(0), len(0) {} : l(_l),
r(_r),
cnt(0),
len(0) {}
} tr[100005 << 3]; } tr[100005 << 3];
int find(int y) { int find(int y) {

View File

@ -1,5 +1,5 @@
#include <algorithm>
#include <cstdio> #include <cstdio>
#include <algorithm>
#include <cstring> #include <cstring>
#include <queue> #include <queue>

View File

@ -1,5 +1,5 @@
#include <iomanip>
#include <iostream> #include <iostream>
#include <iomanip>
using std::cin; using std::cin;
using std::cout; using std::cout;

View File

@ -1,5 +1,5 @@
#include <algorithm>
#include <iostream> #include <iostream>
#include <algorithm>
#include <vector> #include <vector>
using std::cin; using std::cin;

View File

@ -1,5 +1,5 @@
#include <algorithm>
#include <iostream> #include <iostream>
#include <algorithm>
using std::cin; using std::cin;
using std::cout; using std::cout;

View File

@ -1,6 +1,6 @@
#include <iostream>
#include <cmath> #include <cmath>
#include <iomanip> #include <iomanip>
#include <iostream>
using std::cin; using std::cin;
using std::cout; using std::cout;

View File

@ -1,6 +1,6 @@
#include <iostream>
#include <cmath> #include <cmath>
#include <iomanip> #include <iomanip>
#include <iostream>
using std::cin; using std::cin;
using std::cout; using std::cout;

View File

@ -1,6 +1,6 @@
#include <iostream>
#include <algorithm> #include <algorithm>
#include <cstring> #include <cstring>
#include <iostream>
using std::cin; using std::cin;
using std::cout; using std::cout;

View File

@ -1,5 +1,5 @@
#include <cstring>
#include <iostream> #include <iostream>
#include <cstring>
#include <limits> #include <limits>
using std::cin; using std::cin;

View File

@ -1,5 +1,5 @@
#include <algorithm>
#include <iostream> #include <iostream>
#include <algorithm>
using std::cin; using std::cin;
using std::cout; using std::cout;

View File

@ -101,10 +101,16 @@ struct node {
int l, r, s, d; int l, r, s, d;
node() node()
: l(0), r(0), s(0), d(-1) {} : l(0),
r(0),
s(0),
d(-1) {}
node(int _l, int _r) node(int _l, int _r)
: l(_l), r(_r), s(0), d(-1) {} : l(_l),
r(_r),
s(0),
d(-1) {}
} tr[N << 2]; } tr[N << 2];
inline void pushup(int u) { inline void pushup(int u) {

View File

@ -1,5 +1,5 @@
#include <iomanip>
#include <iostream> #include <iostream>
#include <iomanip>
using std::cin; using std::cin;
using std::cout; using std::cout;

View File

@ -1,5 +1,5 @@
#include <algorithm>
#include <iostream> #include <iostream>
#include <algorithm>
using std::cin; using std::cin;
using std::cout; using std::cout;

View File

@ -1,5 +1,5 @@
#include <iomanip>
#include <iostream> #include <iostream>
#include <iomanip>
using std::cin; using std::cin;
using std::cout; using std::cout;

View File

@ -1,5 +1,5 @@
#include <algorithm>
#include <iostream> #include <iostream>
#include <algorithm>
#include <string> #include <string>
using std::cin; using std::cin;

View File

@ -1,5 +1,5 @@
#include <algorithm>
#include <iostream> #include <iostream>
#include <algorithm>
using std::cin; using std::cin;
using std::cout; using std::cout;

View File

@ -1,5 +1,5 @@
#include <algorithm>
#include <iostream> #include <iostream>
#include <algorithm>
#include <string> #include <string>
#include <vector> #include <vector>

View File

@ -1,5 +1,5 @@
#include <algorithm>
#include <iostream> #include <iostream>
#include <algorithm>
using std::cin; using std::cin;
using std::cout; using std::cout;

View File

@ -1,5 +1,5 @@
#include <cmath>
#include <iostream> #include <iostream>
#include <cmath>
using std::cin; using std::cin;
using std::cout; using std::cout;

View File

@ -1,5 +1,5 @@
#include <cstring>
#include <iostream> #include <iostream>
#include <cstring>
#include <stack> #include <stack>
#include <vector> #include <vector>

View File

@ -1,6 +1,6 @@
#include <iostream>
#include <cmath> #include <cmath>
#include <iomanip> #include <iomanip>
#include <iostream>
using std::cin; using std::cin;
using std::cout; using std::cout;

View File

@ -1,6 +1,6 @@
#include <iostream>
#include <algorithm> #include <algorithm>
#include <cmath> #include <cmath>
#include <iostream>
using std::cin; using std::cin;
using std::cout; using std::cout;

View File

@ -1,5 +1,5 @@
#include <cmath>
#include <iostream> #include <iostream>
#include <cmath>
#include <limits> #include <limits>
using std::cin; using std::cin;

View File

@ -1,6 +1,6 @@
#include <iostream>
#include <algorithm> #include <algorithm>
#include <cstring> #include <cstring>
#include <iostream>
using std::cin; using std::cin;
using std::cout; using std::cout;

View File

@ -1,8 +1,8 @@
#pragma GCC optimize("Ofast") #pragma GCC optimize("Ofast")
#include <cstdio>
#include <algorithm> #include <algorithm>
#include <cmath> #include <cmath>
#include <cstdio>
const int N = 15; const int N = 15;
const double eps = 1e-6; const double eps = 1e-6;

View File

@ -1,5 +1,5 @@
#include <cmath>
#include <iostream> #include <iostream>
#include <cmath>
using std::cin; using std::cin;
using std::cout; using std::cout;

View File

@ -1,5 +1,5 @@
#include <cstring>
#include <iostream> #include <iostream>
#include <cstring>
#include <limits> #include <limits>
#include <queue> #include <queue>

View File

@ -104,10 +104,20 @@ struct node {
int l, r, s, d, lc, rc; int l, r, s, d, lc, rc;
node() 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) 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]; } tr[N << 2];
inline void pushup(int u) { inline void pushup(int u) {

View File

@ -1,5 +1,5 @@
#include <cstring>
#include <iostream> #include <iostream>
#include <cstring>
#include <queue> #include <queue>
#include <vector> #include <vector>

View File

@ -1,6 +1,6 @@
#include <iostream>
#include <algorithm> #include <algorithm>
#include <cstring> #include <cstring>
#include <iostream>
#include <queue> #include <queue>
#include <vector> #include <vector>

View File

@ -1,5 +1,5 @@
#include <algorithm>
#include <iostream> #include <iostream>
#include <algorithm>
#include <vector> #include <vector>
using std::cin; using std::cin;

View File

@ -1,5 +1,5 @@
#include <algorithm>
#include <iostream> #include <iostream>
#include <algorithm>
using std::cin; using std::cin;
using std::cout; using std::cout;

View File

@ -1,6 +1,6 @@
#include <iostream>
#include <algorithm> #include <algorithm>
#include <cstring> #include <cstring>
#include <iostream>
#include <string> #include <string>
using std::cin; using std::cin;

View File

@ -1,5 +1,5 @@
#include <cmath>
#include <iostream> #include <iostream>
#include <cmath>
using std::cin; using std::cin;
using std::cout; using std::cout;

View File

@ -1,5 +1,5 @@
#include <cmath>
#include <iostream> #include <iostream>
#include <cmath>
#include <limits> #include <limits>
using std::cin; using std::cin;

View File

@ -1,5 +1,5 @@
#include <cmath>
#include <iostream> #include <iostream>
#include <cmath>
using std::cin; using std::cin;
using std::cout; using std::cout;
@ -12,10 +12,16 @@ struct node {
long long s, d; long long s, d;
node() node()
: l(0), r(0), s(0), d(0) {} : l(0),
r(0),
s(0),
d(0) {}
node(int _l, int _r) node(int _l, int _r)
: l(_l), r(_r), s(0), d(0) {} : l(_l),
r(_r),
s(0),
d(0) {}
} tr[N << 2]; } tr[N << 2];
int n, k; int n, k;

View File

@ -1,5 +1,5 @@
#include <algorithm>
#include <iostream> #include <iostream>
#include <algorithm>
using std::cin; using std::cin;
using std::cout; using std::cout;

View File

@ -4,18 +4,18 @@ const MIN = 32,
MAX = 126; MAX = 126;
const SIMPLE = { const SIMPLE = {
false: "![]", false: '![]',
true: "!![]", true: '!![]',
undefined: "[][[]]", undefined: '[][[]]',
NaN: "+[![]]", NaN: '+[![]]',
Infinity: "+(+!+[]+(!+[]+[])[!+[]+!+[]+!+[]]+[+!+[]]+[+[]]+[+[]]+[+[]])", // +"1e1000" Infinity: '+(+!+[]+(!+[]+[])[!+[]+!+[]+!+[]]+[+!+[]]+[+[]]+[+[]]+[+[]])', // +"1e1000"
}; };
const CONSTRUCTORS = { const CONSTRUCTORS = {
Array: "[]", Array: '[]',
Number: "(+[])", Number: '(+[])',
String: "([]+[])", String: '([]+[])',
Boolean: "(![])", Boolean: '(![])',
Function: '[]["flat"]', Function: '[]["flat"]',
RegExp: 'Function("return/"+false+"/")()', RegExp: 'Function("return/"+false+"/")()',
Object: '[]["entries"]()', Object: '[]["entries"]()',
@ -28,9 +28,9 @@ const MAPPING = {
d: '(undefined+"")[2]', d: '(undefined+"")[2]',
e: '(true+"")[3]', e: '(true+"")[3]',
f: '(false+"")[0]', f: '(false+"")[0]',
g: "(false+[0]+String)[20]", g: '(false+[0]+String)[20]',
h: '(+(101))["to"+String["name"]](21)[1]', h: '(+(101))["to"+String["name"]](21)[1]',
i: "([false]+undefined)[10]", i: '([false]+undefined)[10]',
j: '([]["entries"]()+"")[3]', j: '([]["entries"]()+"")[3]',
k: '(+(20))["to"+String["name"]](21)', k: '(+(20))["to"+String["name"]](21)',
l: '(false+"")[2]', l: '(false+"")[2]',
@ -46,15 +46,15 @@ const MAPPING = {
v: '(+(31))["to"+String["name"]](32)', v: '(+(31))["to"+String["name"]](32)',
w: '(+(32))["to"+String["name"]](33)', w: '(+(32))["to"+String["name"]](33)',
x: '(+(101))["to"+String["name"]](34)[1]', x: '(+(101))["to"+String["name"]](34)[1]',
y: "(NaN+[Infinity])[10]", y: '(NaN+[Infinity])[10]',
z: '(+(35))["to"+String["name"]](36)', z: '(+(35))["to"+String["name"]](36)',
A: '(NaN+[]["entries"]())[11]', A: '(NaN+[]["entries"]())[11]',
B: "(+[]+Boolean)[10]", B: '(+[]+Boolean)[10]',
C: 'Function("return escape")()(("")["italics"]())[2]', C: 'Function("return escape")()(("")["italics"]())[2]',
D: 'Function("return escape")()([]["flat"])["slice"]("-1")', D: 'Function("return escape")()([]["flat"])["slice"]("-1")',
E: '(RegExp+"")[12]', E: '(RegExp+"")[12]',
F: "(+[]+Function)[10]", F: '(+[]+Function)[10]',
G: '(false+Function("return Date")()())[30]', G: '(false+Function("return Date")()())[30]',
H: null, H: null,
I: '(Infinity+"")[0]', I: '(Infinity+"")[0]',
@ -63,11 +63,11 @@ const MAPPING = {
L: null, L: null,
M: '(true+Function("return Date")()())[30]', M: '(true+Function("return Date")()())[30]',
N: '(NaN+"")[0]', N: '(NaN+"")[0]',
O: "(+[]+Object)[10]", O: '(+[]+Object)[10]',
P: null, P: null,
Q: null, Q: null,
R: "(+[]+RegExp)[10]", R: '(+[]+RegExp)[10]',
S: "(+[]+String)[10]", S: '(+[]+String)[10]',
T: '(NaN+Function("return Date")()())[30]', T: '(NaN+Function("return Date")()())[30]',
U: '(NaN+Object()["to"+String["name"]]["call"]())[11]', U: '(NaN+Object()["to"+String["name"]]["call"]())[11]',
V: null, V: null,
@ -76,39 +76,39 @@ const MAPPING = {
Y: null, Y: null,
Z: null, Z: null,
" ": '(NaN+[]["flat"])[11]', ' ': '(NaN+[]["flat"])[11]',
"!": null, '!': null,
'"': '("")["fontcolor"]()[12]', '"': '("")["fontcolor"]()[12]',
"#": null, '#': null,
$: null, $: null,
"%": 'Function("return escape")()([]["flat"])[21]', '%': 'Function("return escape")()([]["flat"])[21]',
"&": '("")["fontcolor"](")[13]', '&': '("")["fontcolor"](")[13]',
"'": null, "'": null,
"(": '([]["flat"]+"")[13]', '(': '([]["flat"]+"")[13]',
")": '([0]+false+[]["flat"])[20]', ')': '([0]+false+[]["flat"])[20]',
"*": null, '*': null,
"+": "(+(+!+[]+(!+[]+[])[!+[]+!+[]+!+[]]+[+!+[]]+[+[]]+[+[]])+[])[2]", '+': '(+(+!+[]+(!+[]+[])[!+[]+!+[]+!+[]]+[+!+[]]+[+[]]+[+[]])+[])[2]',
",": '[[]]["concat"]([[]])+""', ',': '[[]]["concat"]([[]])+""',
"-": '(+(.+[0000001])+"")[2]', '-': '(+(.+[0000001])+"")[2]',
".": "(+(+!+[]+[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+[!+[]+!+[]]+[+[]])+[])[+!+[]]", '.': '(+(+!+[]+[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+[!+[]+!+[]]+[+[]])+[])[+!+[]]',
"/": '(false+[0])["italics"]()[10]', '/': '(false+[0])["italics"]()[10]',
":": '(RegExp()+"")[3]', ':': '(RegExp()+"")[3]',
";": '("")["fontcolor"](NaN+")[21]', ';': '("")["fontcolor"](NaN+")[21]',
"<": '("")["italics"]()[0]', '<': '("")["italics"]()[0]',
"=": '("")["fontcolor"]()[11]', '=': '("")["fontcolor"]()[11]',
">": '("")["italics"]()[2]', '>': '("")["italics"]()[2]',
"?": '(RegExp()+"")[2]', '?': '(RegExp()+"")[2]',
"@": null, '@': null,
"[": '([]["entries"]()+"")[0]', '[': '([]["entries"]()+"")[0]',
"\\": '(RegExp("/")+"")[1]', '\\': '(RegExp("/")+"")[1]',
"]": '([]["entries"]()+"")[22]', ']': '([]["entries"]()+"")[22]',
"^": null, '^': null,
_: null, _: null,
"`": null, '`': null,
"{": '(true+[]["flat"])[20]', '{': '(true+[]["flat"])[20]',
"|": null, '|': null,
"}": '([]["flat"]+"")["slice"]("-1")', '}': '([]["flat"]+"")["slice"]("-1")',
"~": null, '~': null,
}; };
const GLOBAL = 'Function("return this")()'; const GLOBAL = 'Function("return this")()';
@ -117,30 +117,30 @@ function fillMissingDigits() {
var output, number, i; var output, number, i;
for (number = 0; number < 10; number++) { for (number = 0; number < 10; number++) {
output = "+[]"; output = '+[]';
if (number > 0) { if (number > 0) {
output = "+!" + output; output = '+!' + output;
} }
for (i = 1; i < number; i++) { for (i = 1; i < number; i++) {
output = "+!+[]" + output; output = '+!+[]' + output;
} }
if (number > 1) { if (number > 1) {
output = output.substr(1); output = output.substr(1);
} }
MAPPING[number] = "[" + output + "]"; MAPPING[number] = '[' + output + ']';
} }
} }
function replaceMap() { function replaceMap() {
var character = "", var character = '',
value, value,
i, i,
key; key;
function replace(pattern, replacement) { function replace(pattern, replacement) {
value = value.replace(new RegExp(pattern, "gi"), replacement); value = value.replace(new RegExp(pattern, 'gi'), replacement);
} }
function digitReplacer(_, x) { function digitReplacer(_, x) {
@ -148,15 +148,15 @@ function replaceMap() {
} }
function numberReplacer(_, y) { function numberReplacer(_, y) {
var values = y.split(""); var values = y.split('');
var head = +values.shift(); var head = +values.shift();
var output = "+[]"; var output = '+[]';
if (head > 0) { if (head > 0) {
output = "+!" + output; output = '+!' + output;
} }
for (i = 1; i < head; i++) { for (i = 1; i < head; i++) {
output = "+!+[]" + output; output = '+!+[]' + output;
} }
if (head > 1) { if (head > 1) {
output = output.substr(1); output = output.substr(1);
@ -164,7 +164,7 @@ function replaceMap() {
return [output] return [output]
.concat(values) .concat(values)
.join("+") .join('+')
.replace(/(\d)/g, digitReplacer); .replace(/(\d)/g, digitReplacer);
} }
@ -176,20 +176,20 @@ function replaceMap() {
} }
for (key in CONSTRUCTORS) { for (key in CONSTRUCTORS) {
replace("\\b" + key, CONSTRUCTORS[key] + '["constructor"]'); replace('\\b' + key, CONSTRUCTORS[key] + '["constructor"]');
} }
for (key in SIMPLE) { for (key in SIMPLE) {
replace(key, SIMPLE[key]); replace(key, SIMPLE[key]);
} }
replace("(\\d\\d+)", numberReplacer); replace('(\\d\\d+)', numberReplacer);
replace("\\((\\d)\\)", digitReplacer); replace('\\((\\d)\\)', digitReplacer);
replace("\\[(\\d)\\]", digitReplacer); replace('\\[(\\d)\\]', digitReplacer);
replace("GLOBAL", GLOBAL); replace('GLOBAL', GLOBAL);
replace('\\+""', "+[]"); replace('\\+""', '+[]');
replace('""', "[]+[]"); replace('""', '[]+[]');
MAPPING[character] = value; MAPPING[character] = value;
} }
@ -222,7 +222,7 @@ function replaceStrings() {
} }
function mappingReplacer(a, b) { function mappingReplacer(a, b) {
return b.split("").join("+"); return b.split('').join('+');
} }
function valueReplacer(c) { function valueReplacer(c) {
@ -248,7 +248,7 @@ function replaceStrings() {
} }
if (count-- === 0) { 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) { function escapeSequence(c) {
var cc = c.charCodeAt(0); var cc = c.charCodeAt(0);
if (cc < 256) { if (cc < 256) {
return "\\" + cc.toString(8); return '\\' + cc.toString(8);
} else { } else {
var cc16 = cc.toString(16); var cc16 = cc.toString(16);
return "\\u" + ("0000" + cc16).substring(cc16.length); return '\\u' + ('0000' + cc16).substring(cc16.length);
} }
} }
function escapeSequenceForReplace(c) { function escapeSequenceForReplace(c) {
return escapeSequence(c).replace("\\", "t"); return escapeSequence(c).replace('\\', 't');
} }
function encode(input, wrapWithEval, runInParentScope) { function encode(input, wrapWithEval, runInParentScope) {
var output = []; var output = [];
if (!input) { if (!input) {
return ""; return '';
} }
var unmappped = ""; var unmappped = '';
for (var k in MAPPING) { for (var k in MAPPING) {
if (MAPPING[k]) { if (MAPPING[k]) {
unmappped += k; unmappped += k;
} }
} }
unmappped = unmappped.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); unmappped = unmappped.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
unmappped = new RegExp("[^" + unmappped + "]", "g"); unmappped = new RegExp('[^' + unmappped + ']', 'g');
var unmappedCharactersCount = (input.match(unmappped) || []).length; var unmappedCharactersCount = (input.match(unmappped) || []).length;
if (unmappedCharactersCount > 1) { if (unmappedCharactersCount > 1) {
// Without this optimization one unmapped caracter has encoded length // Without this optimization one unmapped caracter has encoded length
@ -316,91 +316,91 @@ function encode(input, wrapWithEval, runInParentScope) {
input = input.replace(unmappped, escapeSequence); input = input.replace(unmappped, escapeSequence);
} }
var r = ""; var r = '';
for (var i in SIMPLE) { 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]; var replacement = SIMPLE[c];
if (replacement) { if (replacement) {
output.push("(" + replacement + "+[])"); output.push('(' + replacement + '+[])');
} else { } else {
replacement = MAPPING[c]; replacement = MAPPING[c];
if (replacement) { if (replacement) {
output.push(replacement); output.push(replacement);
} else { } 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)) { if (/^\d$/.test(input)) {
output += "+[]"; output += '+[]';
} }
if (unmappedCharactersCount > 1) { if (unmappedCharactersCount > 1) {
// replace `t` with `\\` // replace `t` with `\\`
output = output =
"(" + '(' +
output + output +
")[" + ')[' +
encode("split") + encode('split') +
"](" + '](' +
encode("t") + encode('t') +
")[" + ')[' +
encode("join") + encode('join') +
"](" + '](' +
encode("\\") + encode('\\') +
")"; ')';
} }
if (unmappedCharactersCount > 0) { if (unmappedCharactersCount > 0) {
output = output =
"[][" + '[][' +
encode("flat") + encode('flat') +
"]" + ']' +
"[" + '[' +
encode("constructor") + encode('constructor') +
"]" + ']' +
"(" + '(' +
encode('return"') + encode('return"') +
"+" + '+' +
output + output +
"+" + '+' +
encode('"') + encode('"') +
")()"; ')()';
} }
if (wrapWithEval) { if (wrapWithEval) {
if (runInParentScope) { if (runInParentScope) {
output = output =
"[][" + '[][' +
encode("flat") + encode('flat') +
"]" + ']' +
"[" + '[' +
encode("constructor") + encode('constructor') +
"]" + ']' +
"(" + '(' +
encode("return eval") + encode('return eval') +
")()" + ')()' +
"(" + '(' +
output + output +
")"; ')';
} else { } else {
output = output =
"[][" + '[][' +
encode("flat") + encode('flat') +
"]" + ']' +
"[" + '[' +
encode("constructor") + encode('constructor') +
"]" + ']' +
"(" + '(' +
output + output +
")()"; ')()';
} }
} }

View File

@ -1,5 +1,5 @@
#include <cmath>
#include <iostream> #include <iostream>
#include <cmath>
#include <limits> #include <limits>
using std::cin; using std::cin;

View File

@ -1,5 +1,5 @@
#include <algorithm>
#include <iostream> #include <iostream>
#include <algorithm>
using std::cin; using std::cin;
using std::cout; using std::cout;

View File

@ -1,5 +1,5 @@
#include <algorithm>
#include <iostream> #include <iostream>
#include <algorithm>
using std::cin; using std::cin;
using std::cout; using std::cout;

View File

@ -1,5 +1,5 @@
#include <algorithm>
#include <iostream> #include <iostream>
#include <algorithm>
#include <vector> #include <vector>
using std::cin; using std::cin;

View File

@ -1,7 +1,7 @@
#pragma GCC optimize("Ofast") #pragma GCC optimize("Ofast")
#include <cmath>
#include <iostream> #include <iostream>
#include <cmath>
#include <map> #include <map>
#include <string> #include <string>
#include <vector> #include <vector>

View File

@ -1,5 +1,5 @@
#include <algorithm>
#include <iostream> #include <iostream>
#include <algorithm>
using std::cin; using std::cin;
using std::cout; using std::cout;

View File

@ -1,6 +1,6 @@
#include <iostream>
#include <algorithm> #include <algorithm>
#include <cmath> #include <cmath>
#include <iostream>
using std::cin; using std::cin;
using std::cout; using std::cout;

View File

@ -1,6 +1,6 @@
#include <iostream>
#include <cmath> #include <cmath>
#include <cstring> #include <cstring>
#include <iostream>
#include <queue> #include <queue>
#include <vector> #include <vector>

View File

@ -1,5 +1,5 @@
#include <cstring>
#include <iostream> #include <iostream>
#include <cstring>
using std::cin; using std::cin;
using std::cout; using std::cout;

View File

@ -1,6 +1,6 @@
#include <iostream>
#include <algorithm> #include <algorithm>
#include <iomanip> #include <iomanip>
#include <iostream>
using std::cin; using std::cin;
using std::cout; using std::cout;

View File

@ -1,5 +1,5 @@
#include <cstring>
#include <iostream> #include <iostream>
#include <cstring>
using std::cin; using std::cin;
using std::cout; using std::cout;

BIN
Hydro/system_test/2/data/config.yaml (Stored with Git LFS)

Binary file not shown.

BIN
Hydro/system_test/3/data/config.yaml (Stored with Git LFS)

Binary file not shown.

BIN
Hydro/system_test/6/data/config.yaml (Stored with Git LFS)

Binary file not shown.

BIN
Hydro/system_test/8/data/config.yaml (Stored with Git LFS)

Binary file not shown.

View File

@ -1,5 +1,5 @@
#include <cstring>
#include <iostream> #include <iostream>
#include <cstring>
using std::cin; using std::cin;
using std::cout; using std::cout;

BIN
LibreOJ/10014/data/divide_b.cpp (Stored with Git LFS)

Binary file not shown.

View File

@ -1,5 +1,5 @@
#include <cstring>
#include <iostream> #include <iostream>
#include <cstring>
#include <limits> #include <limits>
#include <queue> #include <queue>

View File

@ -106,10 +106,16 @@ struct node {
int l, r, sum, max; int l, r, sum, max;
node() node()
: l(0), r(0), sum(0), max(numeric_limits<int>::min()) {} : l(0),
r(0),
sum(0),
max(numeric_limits<int>::min()) {}
node(int _l, int _r) node(int _l, int _r)
: l(_l), r(_r), sum(0), max(numeric_limits<int>::min()) {} : l(_l),
r(_r),
sum(0),
max(numeric_limits<int>::min()) {}
} tr[N << 2]; } tr[N << 2];
void pushup(int u) { void pushup(int u) {

View File

@ -104,10 +104,20 @@ struct node {
int l, r, s, d, lc, rc; int l, r, s, d, lc, rc;
node() 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) 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]; } tr[N << 2];
inline void pushup(int u) { inline void pushup(int u) {

View File

@ -17,10 +17,18 @@ struct node {
int l, r, s, v, k; int l, r, s, v, k;
node() node()
: l(0), r(0), s(0), v(0), k(rand()) {} : l(0),
r(0),
s(0),
v(0),
k(rand()) {}
node(int _v) 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]; } tr[N];
void pushup(int u) { void pushup(int u) {

View File

@ -1,5 +1,5 @@
#include <cstring>
#include <iostream> #include <iostream>
#include <cstring>
using std::cin; using std::cin;
using std::cout; using std::cout;

BIN
LibreOJ/10194/data/1.cpp (Stored with Git LFS)

Binary file not shown.

BIN
LibreOJ/10194/data/gen.cpp (Stored with Git LFS)

Binary file not shown.

View File

@ -1,5 +1,5 @@
#include <cstring>
#include <iostream> #include <iostream>
#include <cstring>
#include <limits> #include <limits>
#include <queue> #include <queue>

View File

@ -1,5 +1,5 @@
#include <algorithm>
#include <iostream> #include <iostream>
#include <algorithm>
#include <tuple> #include <tuple>
using std::cin; using std::cin;

View File

@ -1,5 +1,5 @@
#include <cstdlib>
#include <iostream> #include <iostream>
#include <cstdlib>
using std::cin; using std::cin;
using std::cout; using std::cout;
@ -14,10 +14,18 @@ class Treap {
int size, val, key; int size, val, key;
node() node()
: left(nullptr), right(nullptr), size(1), val(0), key(rand()) {} : left(nullptr),
right(nullptr),
size(1),
val(0),
key(rand()) {}
node(int _val) node(int _val)
: left(nullptr), right(nullptr), size(1), val(_val), key(rand()) {} : left(nullptr),
right(nullptr),
size(1),
val(_val),
key(rand()) {}
~node() { ~node() {
delete left, right; delete left, right;

View File

@ -1,5 +1,5 @@
#include <cstdlib>
#include <iostream> #include <iostream>
#include <cstdlib>
using std::cin; using std::cin;
using std::cout; using std::cout;
@ -14,10 +14,20 @@ struct node {
bool d; bool d;
node() 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) 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]; } tr[N];
void pushup(int u) { void pushup(int u) {

BIN
LibreOJ/2/data/spj_cpp.cpp (Stored with Git LFS)

Binary file not shown.

View File

@ -93,10 +93,14 @@ struct node {
int l, r, d; int l, r, d;
node() node()
: l(0), r(0), d(-1) {} : l(0),
r(0),
d(-1) {}
node(int _l, int _r) node(int _l, int _r)
: l(_l), r(_r), d(-1) {} : l(_l),
r(_r),
d(-1) {}
} tr[N << 2]; } tr[N << 2];
inline void pushup(int u) { inline void pushup(int u) {

View File

@ -113,10 +113,16 @@ struct node {
long long s, d; long long s, d;
node() node()
: l(0), r(0), s(0), d(0) {} : l(0),
r(0),
s(0),
d(0) {}
node(int _l, int _r) node(int _l, int _r)
: l(_l), r(_r), s(0), d(0) {} : l(_l),
r(_r),
s(0),
d(0) {}
} tr[N << 2]; } tr[N << 2];
inline void pushup(int u) { inline void pushup(int u) {

View File

@ -101,10 +101,16 @@ struct node {
int l, r, s, d; int l, r, s, d;
node() node()
: l(0), r(0), s(0), d(-1) {} : l(0),
r(0),
s(0),
d(-1) {}
node(int _l, int _r) node(int _l, int _r)
: l(_l), r(_r), s(0), d(-1) {} : l(_l),
r(_r),
s(0),
d(-1) {}
} tr[N << 2]; } tr[N << 2];
inline void pushup(int u) { inline void pushup(int u) {

View File

@ -6,10 +6,14 @@ struct node {
int l, r, max; int l, r, max;
node() node()
: l(0), r(0), max(0) {} : l(0),
r(0),
max(0) {}
node(int _l, int _r) node(int _l, int _r)
: l(_l), r(_r), max(0) {} : l(_l),
r(_r),
max(0) {}
} tr[50005 << 2]; } tr[50005 << 2];
int n, m, x, y, a[50005]; int n, m, x, y, a[50005];

View File

@ -39,10 +39,16 @@ struct node {
int l, r, m, d; int l, r, m, d;
node() node()
: l(0), r(0), m(std::numeric_limits<int>::max()), d(0) {} : l(0),
r(0),
m(std::numeric_limits<int>::max()),
d(0) {}
node(int _l, int _r) node(int _l, int _r)
: l(_l), r(_r), m(std::numeric_limits<int>::max()), d(0) {} : l(_l),
r(_r),
m(std::numeric_limits<int>::max()),
d(0) {}
} tr[1000005 << 1]; } tr[1000005 << 1];
void pushup(int u) { void pushup(int u) {

BIN
LibreOJ/2608/data/std.cpp (Stored with Git LFS)

Binary file not shown.

BIN
LibreOJ/2608/data/val.cpp (Stored with Git LFS)

Binary file not shown.

View File

@ -13,19 +13,29 @@ struct node {
int x, y, step; int x, y, step;
node() node()
: x(0), y(0), step(0) {} : x(0),
y(0),
step(0) {}
node(int _x, int _y) node(int _x, int _y)
: x(_x), y(_y), step(0) {} : x(_x),
y(_y),
step(0) {}
node(pair<int, int> _point) node(pair<int, int> _point)
: x(_point.first), y(_point.second), step(0) {} : x(_point.first),
y(_point.second),
step(0) {}
node(pair<int, int> _point, int _step) node(pair<int, int> _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) node(int _x, int _y, int _step)
: x(_x), y(_y), step(_step) {} : x(_x),
y(_y),
step(_step) {}
}; };
/** /**

View File

@ -1,5 +1,5 @@
#include <cstring>
#include <iostream> #include <iostream>
#include <cstring>
#include <queue> #include <queue>
#include <vector> #include <vector>

BIN
LibreOJ/4/data/spj.js (Stored with Git LFS)

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More