0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-23 18:48: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
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: '^<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,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
}
}
]
}

View File

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

View File

@ -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) {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
#include <cstdlib>
#include <iostream>
#include <cstdlib>
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) {

View File

@ -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) {

View File

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

View File

@ -1,5 +1,5 @@
#include <cstdlib>
#include <iostream>
#include <cstdlib>
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) {

View File

@ -1,5 +1,5 @@
#include <algorithm>
#include <iostream>
#include <algorithm>
#include <limits>
#include <vector>
@ -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) {

View File

@ -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) {

View File

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

View File

@ -1,5 +1,5 @@
#include <algorithm>
#include <iostream>
#include <algorithm>
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;

View File

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

View File

@ -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) {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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) {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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) {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
#include <cmath>
#include <iostream>
#include <cmath>
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;

View File

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

View File

@ -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 +
")()";
')()';
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
#include <cstring>
#include <iostream>
#include <cstring>
using std::cin;
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 <cstring>
using std::cin;
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 <cstring>
#include <limits>
#include <queue>

View File

@ -106,10 +106,16 @@ struct node {
int l, r, sum, max;
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)
: 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];
void pushup(int u) {

View File

@ -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) {

View File

@ -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) {

View File

@ -1,5 +1,5 @@
#include <cstring>
#include <iostream>
#include <cstring>
using std::cin;
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 <cstring>
#include <limits>
#include <queue>

View File

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

View File

@ -1,5 +1,5 @@
#include <cstdlib>
#include <iostream>
#include <cstdlib>
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;

View File

@ -1,5 +1,5 @@
#include <cstdlib>
#include <iostream>
#include <cstdlib>
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) {

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;
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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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];

View File

@ -39,10 +39,16 @@ struct node {
int l, r, m, d;
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)
: 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];
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;
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<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)
: 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) {}
};
/**

View File

@ -1,5 +1,5 @@
#include <cstring>
#include <iostream>
#include <cstring>
#include <queue>
#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