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

chore: separate definition blocks

This commit is contained in:
Baoshuo Ren 2022-05-20 09:23:27 +08:00
parent 1636d67168
commit d5a5c18c1a
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68
120 changed files with 202 additions and 42 deletions

View File

@ -11,4 +11,5 @@ AllowShortFunctionsOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: true
AllowShortIfStatementsOnASingleLine: true
EmptyLineBeforeAccessModifier: LogicalBlock
SeparateDefinitionBlocks: Always
PointerAlignment: Right

View File

@ -105,6 +105,7 @@ struct node {
node()
: 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) {}
} tr[N << 2];

View File

@ -7,11 +7,11 @@
* };
*/
class Solution {
public:
public:
vector<int> printListReversingly(ListNode* head) {
vector<int> res;
ListNode *tail = head;
while(tail != NULL) {
ListNode* tail = head;
while (tail != NULL) {
res.push_back(tail->val);
tail = tail->next;
}

View File

@ -1,29 +1,29 @@
class MyQueue {
private:
private:
queue<int> q;
public:
public:
/** Initialize your data structure here. */
MyQueue() {
}
/** Push element x to the back of queue. */
void push(int x) {
q.push(x);
}
/** Removes the element from in front of queue and returns that element. */
int pop() {
int ret = q.front();
q.pop();
return ret;
}
/** Get the front element. */
int peek() {
return q.front();
}
/** Returns whether the queue is empty. */
bool empty() {
return q.empty();

View File

@ -15,6 +15,7 @@ struct node {
node()
: 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()) {}
} tr[N];

View File

@ -11,6 +11,7 @@ struct segment {
segment()
: 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) {}
@ -25,6 +26,7 @@ struct node {
node()
: l(0), r(0), cnt(0), len(0) {}
node(int _l, int _r)
: l(_l), r(_r), cnt(0), len(0) {}
} tr[10005 << 3];

View File

@ -46,6 +46,7 @@ struct node {
node()
: l(0), r(0), s(0), v(0), k(rand()) {}
node(int _v)
: l(0), r(0), s(1), v(_v), k(rand()) {}
} tr[N];

View File

@ -12,6 +12,7 @@ struct node {
node()
: l(0), r(0), s(0), d(0) {}
node(int _l, int _r)
: l(_l), r(_r), s(0), d(0) {}
} tr[100005 << 2];

View File

@ -11,6 +11,7 @@ struct segment {
segment()
: 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) {}
@ -25,6 +26,7 @@ struct node {
node()
: l(0), r(0), cnt(0), len(0) {}
node(int _l, int _r)
: l(_l), r(_r), cnt(0), len(0) {}
} tr[100005 << 3];

View File

@ -3,6 +3,7 @@
using namespace std;
int n, m, fa[100005], res, cnt;
struct node {
int u, v, w;

View File

@ -102,6 +102,7 @@ struct node {
node()
: l(0), r(0), s(0), d(-1) {}
node(int _l, int _r)
: l(_l), r(_r), s(0), d(-1) {}
} tr[N << 2];

View File

@ -105,6 +105,7 @@ struct node {
node()
: 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) {}
} tr[N << 2];

View File

@ -13,6 +13,7 @@ struct node {
node()
: l(0), r(0), s(0), d(0) {}
node(int _l, int _r)
: l(_l), r(_r), s(0), d(0) {}
} tr[N << 2];

View File

@ -9,6 +9,7 @@ struct node {
node() {
l = r = s = d = 0;
}
node(int _l, int _r) {
l = _l;
r = _r;

View File

@ -16,6 +16,7 @@ std::vector<int> g[N];
// Shortest Path
int dist[N], max;
bool vis[N];
void spfa() {
memset(dist, 0x3f, sizeof(dist));
std::queue<int> q;

View File

@ -9,6 +9,7 @@ struct node {
node() {
l = r = s = d = 0;
}
node(int _l, int _r) {
l = _l;
r = _r;

View File

@ -8,10 +8,12 @@ struct node {
int x, y;
node() {}
node(int _x, int _y) {
x = _x;
y = _y;
}
node operator-(node B) {
return node(x - B.x, y - B.y);
}

View File

@ -9,12 +9,14 @@ struct node {
l = r = 0;
v = -0x3f3f3f3f;
}
node(int _l, int _r) {
l = _l;
r = _r;
v = -0x3f3f3f3f;
}
} tr[200005 << 2];
int m, p;
char op;

View File

@ -15,6 +15,7 @@ struct node {
l = r = s = 0;
allIsOne = false;
}
node(int _l, int _r) {
l = _l;
r = _r;

View File

@ -10,12 +10,14 @@ struct node {
l = r = s = d = 0;
x = 1;
}
node(int _l, int _r) {
l = _l, r = _r;
s = d = 0;
x = 1;
}
} tr[100005 << 2];
int n, m, p, op, x, y;
long long k, a[100005];

View File

@ -107,6 +107,7 @@ struct node {
node()
: 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()) {}
} tr[N << 2];

View File

@ -105,6 +105,7 @@ struct node {
node()
: 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) {}
} tr[N << 2];

View File

@ -16,6 +16,7 @@ int n, m, s, t, flow, cost;
// Graph
int idx, head[N], ver[M << 1], next[M << 1];
std::pair<int, int> edge[M << 1];
// <flow, cost>
void add(int u, int v, int c, int w) {

View File

@ -15,6 +15,7 @@ class Treap {
node()
: left(nullptr), right(nullptr), size(1), val(0), key(rand()) {}
node(int _val)
: left(nullptr), right(nullptr), size(1), val(_val), key(rand()) {}

View File

@ -15,6 +15,7 @@ struct node {
node()
: 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()) {}
} tr[N];

View File

@ -6,6 +6,7 @@ using std::endl;
int n, m, fa[500005];
long long ans;
struct node {
int u, v, w;

View File

@ -11,12 +11,14 @@ struct node {
node() {
l = r = s = d = 0;
}
node(int _l, int _r) {
l = _l;
r = _r;
s = d = 0;
}
} tr[1000005 << 2];
int n, m, op, x, y, k;
long long a[1000005];

View File

@ -11,6 +11,7 @@ struct node {
node() {
l = r = s = d = 0;
}
node(int _l, int _r) {
l = _l;
r = _r;

View File

@ -94,6 +94,7 @@ struct node {
node()
: l(0), r(0), d(-1) {}
node(int _l, int _r)
: l(_l), r(_r), d(-1) {}
} tr[N << 2];

View File

@ -114,6 +114,7 @@ struct node {
node()
: l(0), r(0), s(0), d(0) {}
node(int _l, int _r)
: l(_l), r(_r), s(0), d(0) {}
} tr[N << 2];

View File

@ -102,6 +102,7 @@ struct node {
node()
: l(0), r(0), s(0), d(-1) {}
node(int _l, int _r)
: l(_l), r(_r), s(0), d(-1) {}
} tr[N << 2];

View File

@ -7,6 +7,7 @@ struct node {
node()
: l(0), r(0), max(0) {}
node(int _l, int _r)
: l(_l), r(_r), max(0) {}
} tr[50005 << 2];

View File

@ -40,6 +40,7 @@ struct node {
node()
: 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) {}
} tr[1000005 << 1];

View File

@ -14,12 +14,16 @@ struct node {
node()
: x(0), y(0), step(0) {}
node(int _x, int _y)
: x(_x), y(_y), step(0) {}
node(pair<int, int> _point)
: x(_point.first), y(_point.second), step(0) {}
node(pair<int, int> _point, int _step)
: x(_point.first), y(_point.second), step(_step) {}
node(int _x, int _y, int _step)
: x(_x), y(_y), step(_step) {}
};

View File

@ -15,6 +15,7 @@ std::vector<std::pair<int, long long>> g[N];
// Dijkstra - Shortest Path
long long dist[N];
bool vis[N];
void dijkstra() {
memset(dist, 0x3f, sizeof(dist));
dist[1] = 0;

View File

@ -1,3 +1,6 @@
#include<stdio.h>
char s[]="#include<stdio.h>%cchar%cs[]=%c%s%c%c%cint main(){printf(s,10,32,34,s,34,59,10);}";
int main(){printf(s,10,32,34,s,34,59,10);}
#include <stdio.h>
char s[] = "#include<stdio.h>%cchar%cs[]=%c%s%c%c%cint main(){printf(s,10,32,34,s,34,59,10);}";
int main() {
printf(s, 10, 32, 34, s, 34, 59, 10);
}

View File

@ -15,6 +15,7 @@ int n, s, t, a[N], sum, avg, cost;
// Graph
int idx, head[N], ver[M << 1], next[M << 1];
std::pair<int, int> edge[M << 1];
// <flow, cost>
void add(int u, int v, int flow, int cost) {

View File

@ -85,6 +85,7 @@ struct node {
node()
: l(0), r(0), d(0) {}
node(int _l, int _r)
: l(_l), r(_r), d(0) {}
} tr[N << 2];

View File

@ -42,6 +42,7 @@ struct node {
node()
: l(0), r(0), s(0), m(0) {}
node(int _l, int _r)
: l(_l), r(_r), s(0), m(0) {}
} tr[100005 << 2];

View File

@ -65,6 +65,7 @@ struct node {
node()
: l(0), r(0), s(0), m(0) {}
node(int _l, int _r)
: l(_l), r(_r), s(0), m(0) {}
} tr[300005 << 2];

View File

@ -1,29 +1,29 @@
// R14715360
#include<stdio.h>
#include <stdio.h>
int main() {
printf(
" ********\n"
" ************\n"
" ####....#.\n"
" #..###.....##....\n"
" ###.......###### ### ###\n"
" ........... #...# #...#\n"
" ##*####### #.#.# #.#.#\n"
" ####*******###### #.#.# #.#.#\n"
" ...#***.****.*###.... #...# #...#\n"
" ....**********##..... ### ###\n"
" ....**** *****....\n"
" #### ####\n"
" ###### ######\n"
"##############################################################\n"
"#...#......#.##...#......#.##...#......#.##------------------#\n"
"###########################################------------------#\n"
"#..#....#....##..#....#....##..#....#....#####################\n"
"########################################## #----------#\n"
"#.....#......##.....#......##.....#......# #----------#\n"
"########################################## #----------#\n"
"#.#..#....#..##.#..#....#..##.#..#....#..# #----------#\n"
"########################################## ############\n"
);
" ********\n"
" ************\n"
" ####....#.\n"
" #..###.....##....\n"
" ###.......###### ### ###\n"
" ........... #...# #...#\n"
" ##*####### #.#.# #.#.#\n"
" ####*******###### #.#.# #.#.#\n"
" ...#***.****.*###.... #...# #...#\n"
" ....**********##..... ### ###\n"
" ....**** *****....\n"
" #### ####\n"
" ###### ######\n"
"##############################################################\n"
"#...#......#.##...#......#.##...#......#.##------------------#\n"
"###########################################------------------#\n"
"#..#....#....##..#....#....##..#....#....#####################\n"
"########################################## #----------#\n"
"#.....#......##.....#......##.....#......# #----------#\n"
"########################################## #----------#\n"
"#.#..#....#..##.#..#....#..##.#..#....#..# #----------#\n"
"########################################## ############\n");
return 0;
}

View File

@ -5,6 +5,7 @@
using namespace std;
int n, m, ans;
struct node {
int k, s;
} a[100001];

View File

@ -40,6 +40,7 @@ struct node {
node()
: 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) {}
} tr[1000005 << 1];

View File

@ -8,6 +8,7 @@ struct node {
node() {
id = chinese = math = english = all = 0;
}
node(int _id, int _chinese, int _math, int _english) {
id = _id;
chinese = _chinese;

View File

@ -6,6 +6,7 @@ int n, ans[20005];
struct node {
int id, h, l, r;
struct {
int l, r;
} ans;

View File

@ -16,6 +16,7 @@ bool check(int x) {
}
return num >= m;
}
int main() {
cin >> n >> m;
for (int i = 1; i <= n; i++) {

View File

@ -10,6 +10,7 @@ class node {
}
return x - 10 + 'A';
}
int len;
int nums[20];
@ -17,6 +18,7 @@ class node {
node() {
len = 0;
}
node(int x, int b) {
len = 0;
while (x) {
@ -37,6 +39,7 @@ class node {
}
return s;
}
bool check() {
for (int i = 0; i < len; i++) {
if (nums[i] != nums[len - i - 1]) {

View File

@ -47,6 +47,7 @@ struct node {
node()
: l(0), r(0), s(0), d(0) {}
node(int _l, int _r)
: l(_l), r(_r), s(0), d(0) {}
} tr[N << 5];

View File

@ -11,6 +11,7 @@ struct node {
l = r = 0;
min = 0x3f3f3f3f;
}
node(int _l, int _r) {
l = _l;
r = _r;

View File

@ -10,12 +10,14 @@ struct node {
l = r = 0;
s = s2 = d = 0.00;
}
node(int _l, int _r) {
l = _l;
r = _r;
s = s2 = d = 0.00;
}
} tr[100005 << 2];
int n, m, op, x, y;
double k, a[100005];

View File

@ -19,6 +19,7 @@ struct node {
node()
: l(0), r(0), s(0), v(0), k(rand()) {}
node(int _v)
: l(0), r(0), s(1), v(_v), k(rand()) {}
} tr[N];

View File

@ -10,12 +10,14 @@ struct node {
l = r = 0;
max = -0x3f3f3f3f;
}
node(int _l, int _r) {
l = _l;
r = _r;
max = -0x3f3f3f3f;
}
} tr[200005 << 2];
int n, m, x, y, a[200005];
char op;

View File

@ -5,6 +5,7 @@
using namespace std;
int num[26] = {1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 4, 1, 2, 3, 1, 2, 3, 4};
// a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v. w, x, y, z
int main() {
char c;

View File

@ -8,6 +8,7 @@ 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;
int a[n + 5][n + 5];

View File

@ -40,6 +40,7 @@ struct node {
node()
: l(0), r(0), s(0), v(0), k(rand()) {}
node(int _v)
: l(0), r(0), s(1), v(_v), k(rand()) {}
} tr[N];

View File

@ -10,12 +10,14 @@ struct node {
l = r = 0;
min = 0x3f3f3f3f;
}
node(int _l, int _r) {
l = _l;
r = _r;
min = 0x3f3f3f3f;
}
} tr[100005 << 2];
int n, m, x, y, a[100005];
void pushup(int u) {

View File

@ -1,4 +1,5 @@
extern "C" int Seniorious(int);
extern "C" int Chtholly(int n, int OvO) {
int ans = 1;
int l = 1, r = n;

View File

@ -8,6 +8,7 @@ struct node {
node() {
x1 = x2 = 0;
}
node(int _x1, int _x2, int _y) {
x1 = _x1;
x2 = _x2;

View File

@ -10,12 +10,14 @@ struct node {
l = r = s = d = 0;
x = 1;
}
node(int _l, int _r) {
l = _l, r = _r;
s = d = 0;
x = 1;
}
} tr[100005 << 2];
int n, m, p, op, x, y;
long long k, a[100005];

View File

@ -5,6 +5,7 @@ using namespace std;
struct {
int s, b;
} a[15];
int n, ans = 0x3f3f3f3f;
void dfs(int now, int s, int b) {

View File

@ -15,6 +15,7 @@ int n, k, s, t, ans;
// Graph
int idx, head[N], ver[M << 1], next[M << 1];
std::pair<int, int> edge[M << 1];
// <flow, cost>
void add(int u, int v, int flow, int cost) {

View File

@ -10,12 +10,14 @@ struct node {
l = r = 0;
s = 0;
}
node(int _l, int _r) {
l = _l;
r = _r;
s = 0;
}
} tr[1000005 << 2];
long long n, w, a, b;
char op;

View File

@ -9,6 +9,7 @@ struct node {
w = 0;
c = 0;
}
node(long long _w, long long _c) {
w = _w;
c = _c;

View File

@ -102,6 +102,7 @@ struct node {
node()
: l(0), r(0), s(0), d(-1) {}
node(int _l, int _r)
: l(_l), r(_r), s(0), d(-1) {}
} tr[N << 2];

View File

@ -15,6 +15,7 @@ int n, m, s, t, flow, cost;
// Graph
int idx, head[N], ver[M << 1], next[M << 1];
std::pair<int, int> edge[M << 1];
// <flow, cost>
void add(int u, int v, int flow, int cost) {

View File

@ -11,6 +11,7 @@ struct node {
l = r = 0;
min = 0x3f3f3f3f;
}
node(int _l, int _r) {
l = _l;
r = _r;

View File

@ -39,6 +39,7 @@ struct node {
node()
: l(0), r(0), s(0), v(0), k(rand()) {}
node(int _v)
: l(0), r(0), s(1), v(_v), k(rand()) {}
} tr[N];

View File

@ -11,6 +11,7 @@ struct node {
s = 0;
d = 0;
}
node(int _l, int _r) {
l = _l;
r = _r;
@ -18,6 +19,7 @@ struct node {
d = 0;
}
} tr[200005 << 3];
int n, f, op, x, y, k, a[200005];
void pushup(int u) {

View File

@ -10,12 +10,14 @@ struct node {
l = r = 0;
s = "";
}
node(int _l, int _r) {
l = _l;
r = _r;
s = "";
}
} tr[50005 << 2];
int n, m, x, y;
string a[50005], b[50005];
map<string, string> m1;

View File

@ -8,6 +8,7 @@ struct node {
node() {
l = r = max = 0;
}
node(int _l, int _r) {
l = _l;
r = _r;

View File

@ -105,6 +105,7 @@ struct node {
node()
: 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) {}
} tr[N << 2];

View File

@ -16,6 +16,7 @@ struct data {
data() {
a = b = 0;
}
data(int _a, int _b) {
int g = __gcd(_a, _b);
a = _a / g;
@ -25,9 +26,11 @@ struct data {
bool operator<(const data& x) const {
return a * x.b < b * x.a;
}
bool operator>(const data& x) const {
return a * x.b > b * x.a;
}
bool operator==(const data& x) const {
return a * x.b == b * x.a;
}

View File

@ -5,15 +5,18 @@ using namespace std;
struct node {
int l, r;
int s, d;
node() {
l = r = s = d = 0;
}
node(int _l, int _r) {
l = _l;
r = _r;
s = d = 0;
}
} tr[200005 << 2];
int n, m, op, x, y, a[200005];
void pushup(int u) {

View File

@ -107,6 +107,7 @@ struct node {
node()
: 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()) {}
} tr[N << 2];

View File

@ -8,12 +8,14 @@ struct node {
node() {
l = r = s = d = 0;
}
node(int _l, int _r) {
l = _l;
r = _r;
s = d = 0;
}
} tr[100005 << 2];
int n, m, op, s, e;
void pushup(int u) {

View File

@ -9,6 +9,7 @@ struct node {
l = r = max = 0;
min = 0x3f3f3f3f;
}
node(int _l, int _r) {
l = _l;
r = _r;
@ -16,6 +17,7 @@ struct node {
min = 0x3f3f3f3f;
}
} tr[50005 << 2];
int n, q, a, b, h[50005];
void pushup(int u) {

View File

@ -11,6 +11,7 @@ struct node {
node() {
x = y = t = 0;
}
node(int _x, int _y, int _t) {
x = _x, y = _y, t = _t;
}

View File

@ -6,6 +6,7 @@ struct node {
int v, l, c;
node() {}
node(int _v, int _l, int _c)
: v(_v), l(_l), c(_c) {}
};

View File

@ -114,6 +114,7 @@ struct node {
node()
: l(0), r(0), s(0), d(0) {}
node(int _l, int _r)
: l(_l), r(_r), s(0), d(0) {}
} tr[N << 2];

View File

@ -8,12 +8,14 @@ struct node {
node() {
l = r = s = 0;
}
node(int _l, int _r) {
l = _l;
r = _r;
s = 0;
}
} tr[1000005 << 2];
int n, w, x, b, ans;
void pushup(int u) {

View File

@ -3,6 +3,7 @@
using namespace std;
int n, m, fa[5005], res, cnt;
struct node {
int u, v, w;

View File

@ -12,6 +12,7 @@ struct node {
d = 0;
s = 0;
}
node(int _l, int _r) {
l = _l;
r = _r;
@ -19,6 +20,7 @@ struct node {
d = 0;
}
} tr[500005 << 2];
int n, m, op, x, y, k, a[500005];
void pushup(int u) {

View File

@ -12,12 +12,14 @@ struct node {
node() {
l = r = s = d = 0;
}
node(int _l, int _r) {
l = _l;
r = _r;
s = d = 0;
}
} tr[100005 << 2];
int n, m, op, x, y, k, a[100005];
/**

View File

@ -10,12 +10,14 @@ struct node {
l = r = s = d = 0;
x = 1;
}
node(int _l, int _r) {
l = _l, r = _r;
s = d = 0;
x = 1;
}
} tr[100005 << 2];
int n, m, p, op, x, y;
long long k, a[100005];
@ -90,10 +92,10 @@ void modify(int u, int l, int r, long long x, long long d) {
/**
* @brief
* @param u
* @param l
* @param r
* @return int
* @param u
* @param l
* @param r
* @return int
*/
long long query(int u, int l, int r) {
if (tr[u].l >= l && tr[u].r <= r) { // 被包含直接返回

View File

@ -16,6 +16,7 @@ int n, m, s, t, flow, cost;
// Graph
int idx, head[N], ver[M << 1], next[M << 1];
std::pair<int, int> edge[M << 1];
// < c, w>
void add(int u, int v, int c, int w) {

View File

@ -65,6 +65,7 @@ struct node {
node()
: l(0), r(0), s(0), d(0) {}
node(int _l, int _r)
: l(_l), r(_r), s(0), d(0) {}
} tr[N << 2];

View File

@ -11,6 +11,7 @@ struct node {
node() {
u = v = w = 0;
}
node(int _u, int _v, int _w) {
u = _u;
v = _v;

View File

@ -48,6 +48,7 @@ void tarjan(int u) {
// Shortest Path
int dist[N];
int spfa(int s) {
memset(dist, -0x3f, sizeof(dist));
std::queue<int> q;

View File

@ -15,6 +15,7 @@ struct node {
node()
: 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()) {}
} tr[N];

View File

@ -95,6 +95,7 @@ struct node {
node()
: l(0), r(0), s(0), d(0) {}
node(int _l, int _r)
: l(_l), r(_r), s(0), d(0) {}
} tr[N << 2];

View File

@ -15,6 +15,7 @@ struct node {
s = d = 0;
}
} tr[100005 << 2];
int n, m, op, a, b;
void pushup(int u) {

View File

@ -15,6 +15,7 @@ int n, s, t, a[N], sum, avg, cost;
// Graph
int idx, head[N], ver[M << 1], next[M << 1];
std::pair<int, int> edge[M << 1];
// <flow, cost>
void add(int u, int v, int flow, int cost) {

View File

@ -94,6 +94,7 @@ struct node {
node()
: l(0), r(0), d(-1) {}
node(int _l, int _r)
: l(_l), r(_r), d(-1) {}
} tr[N << 2];

View File

@ -96,6 +96,7 @@ struct node {
node()
: l(0), r(0), m(0) {}
node(int _l, int _r)
: l(_l), r(_r), m(0) {}
} tr[N << 2];

View File

@ -14,6 +14,7 @@ struct node {
l = r = s = 0;
allIsOne = false;
}
node(int _l, int _r) {
l = _l;
r = _r;

View File

@ -126,6 +126,7 @@ struct node {
node()
: 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) {}
} tr[N << 2];

View File

@ -10,12 +10,14 @@ struct node {
l = r = 0;
s = 0;
}
node(int _l, int _r) {
l = _l;
r = _r;
s = 0;
}
} tr[100005 << 2];
int t, q, mod, op, m;
void pushup(int u) {

View File

@ -14,12 +14,16 @@ struct node {
node()
: x(0), y(0), step(0) {}
node(int _x, int _y)
: x(_x), y(_y), step(0) {}
node(pair<int, int> _point)
: x(_point.first), y(_point.second), step(0) {}
node(pair<int, int> _point, int _step)
: x(_point.first), y(_point.second), step(_step) {}
node(int _x, int _y, int _step)
: x(_x), y(_y), step(_step) {}
};

View File

@ -9,12 +9,14 @@ struct node {
l = r = 0;
v = d = 0;
}
node(int _l, int _r) {
l = _l;
r = _r;
v = d = 0;
}
} tr[100005 << 2];
int n, m, t, x, y;
void build(int u, int l, int r) {

View File

@ -9,12 +9,14 @@ struct node {
l = r = 0;
min = 0x3f3f3f3f;
}
node(int _l, int _r) {
l = _l;
r = _r;
min = 0x3f3f3f3f;
}
} tr[25005 << 2];
int n, q, x, y, a[25005];
void pushup(int u) {

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