Datasets:

problem_id
stringlengths
6
6
buggy_code
stringlengths
8
526k
fixed_code
stringlengths
12
526k
labels
listlengths
0
15
⌀
buggy_submission_id
int64
1
1.54M
fixed_submission_id
int64
2
1.54M
user_id
stringlengths
10
10
language
stringclasses
8 values
p02279
#include <bits/stdc++.h> using namespace std; struct node { int key; node *next; }; node L; node *nil = &L; int root; node t[100000]; int main() { int n, par[100000]; cin >> n; for (int i = 0; i < n; i++) par[i] = -1; for (int i = 0; i < n; i++) { int a, b, c; cin >> a >> b; node *pre = &t[...
#include <bits/stdc++.h> using namespace std; struct node { int key; node *next; }; node L; node *nil = &L; int root; node t[100000]; int main() { int n, par[100000]; cin >> n; for (int i = 0; i < n; i++) par[i] = -1; for (int i = 0; i < n; i++) { int a, b, c; cin >> a >> b; node *pre = &t[...
[ "literal.string.change", "io.output.change" ]
123,108
123,109
u751176970
cpp
p02279
#include <iostream> #define N 100000 using namespace std; struct Node { int p, l, r; }; Node t[N]; void print_node(int x) { int s = t[x].l; if (s > 0) cout << "[" << s; else if (s == -1) { cout << "[]"; return; } while (1) { if (t[s].r == -1) break; else cout << " ,"; c...
#include <iostream> #define N 100000 using namespace std; struct Node { int p, l, r; }; Node t[N]; void print_node(int x) { int s = t[x].l; if (s >= 0) cout << "[" << s; else if (s == -1) { cout << "[]"; return; } while (1) { if (t[s].r == -1) break; else cout << ", "; ...
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change", "literal.string.change", "io.output.change" ]
123,110
123,111
u849340810
cpp
p02279
#include <iostream> using namespace std; #define MAX 100005 #define NIL -1 struct Node { int parent, left, right; }; Node node[MAX]; int n, depth[MAX]; void print(int u) { int i, c; cout << "node " << u << ": "; cout << "parent = " << node[u].parent << ", "; cout << "depth = " << depth[u] << ", "; if (no...
#include <iostream> using namespace std; #define MAX 100005 #define NIL -1 struct Node { int parent, left, right; }; Node node[MAX]; int n, depth[MAX]; void print(int u) { int i, c; cout << "node " << u << ": "; cout << "parent = " << node[u].parent << ", "; cout << "depth = " << depth[u] << ", "; if (no...
[ "assignment.variable.change", "identifier.change", "variable_access.subscript.index.change" ]
123,116
123,117
u326744299
cpp
p02279
#include <cstdio> #include <iostream> using namespace std; static const int MAX_NUM = 100000; static const int NOELEM = -1; struct stNode { int parent; int left; int right; }; int main(void) { int i, j; int key; int nums; int num; int sun; stNode elem[MAX_NUM]; stNode *pNode; scanf("%d", &num)...
#include <cstdio> #include <iostream> using namespace std; static const int MAX_NUM = 100000; static const int NOELEM = -1; struct stNode { int parent; int left; int right; }; int main(void) { int i, j; int key; int nums; int num; int sun; stNode elem[MAX_NUM]; stNode *pNode; scanf("%d", &num)...
[ "literal.string.change", "call.arguments.change", "io.output.change" ]
123,118
123,119
u861447106
cpp
p02279
#include <iostream> using namespace std; static const int MAX = 100006; static const int NO = -1; struct node { int p, l, r; }; node tree[MAX]; int d[MAX] = {}; void printchild(int u) { int c; if (tree[u].l == NO) { cout << ']'; } c = tree[u].l; while (c != NO) { cout << c; c = tree[c].r; ...
#include <iostream> using namespace std; static const int MAX = 100006; static const int NO = -1; struct node { int p, l, r; }; node tree[MAX]; int d[MAX] = {}; void printchild(int u) { int c; if (tree[u].l == NO) { cout << ']'; } c = tree[u].l; while (c != NO) { cout << c; c = tree[c].r; ...
[ "literal.string.change", "io.output.change" ]
123,127
123,128
u135421061
cpp
p02279
#include <iostream> using namespace std; static const int MAX = 100006; static const int NO = -1; struct node { int p, l, r; }; node tree[MAX]; int d[MAX] = {}; void printchild(int u) { int c; if (tree[u].l == NO) { cout << ']'; } c = tree[u].l; while (c != NO) { cout << c; c = tree[c].r; ...
#include <iostream> using namespace std; static const int MAX = 100006; static const int NO = -1; struct node { int p, l, r; }; node tree[MAX]; int d[MAX] = {}; void printchild(int u) { int c; if (tree[u].l == NO) { cout << ']'; } c = tree[u].l; while (c != NO) { cout << c; c = tree[c].r; ...
[ "literal.string.change", "io.output.change" ]
123,129
123,128
u135421061
cpp
p02279
#include <iostream> #include <string> #include <vector> struct TNode { int Index; TNode *Parent; std::vector<TNode *> Children; TNode(); }; TNode::TNode() { Index = -1; Parent = NULL; Children.clear(); } typedef std::vector<TNode> TRootedTree; void AddNode(TRootedTree &Tree) { int Index; std::cin...
#include <iostream> #include <string> #include <vector> struct TNode { int Index; TNode *Parent; std::vector<TNode *> Children; TNode(); }; TNode::TNode() { Index = -1; Parent = NULL; Children.clear(); } typedef std::vector<TNode> TRootedTree; void AddNode(TRootedTree &Tree) { int Index; std::cin...
[ "call.arguments.add" ]
123,130
123,131
u572975782
cpp
p02279
#include <algorithm> #include <cmath> #include <iostream> #include <list> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define REP(i, n) for (int(i) = 0; (i) < (n); (i)++) using namespace std; class node { public: int id; node *parent; vector<node *> child; int depth; ...
#include <algorithm> #include <cmath> #include <iostream> #include <list> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define REP(i, n) for (int(i) = 0; (i) < (n); (i)++) using namespace std; class node { public: int id; node *parent; vector<node *> child; int depth; ...
[ "literal.string.change", "io.output.change" ]
123,135
123,136
u350754611
cpp
p02279
#include <iostream> using namespace std; #define MAX 100005 #define NIL -1 struct Node { int parent, left, right; }; Node T[MAX]; int n, D[MAX]; // D[u]: the depth of u void setDepth(int u, int p) { // u is a node // p is a depth D[u] = p; if (T[u].left != NIL) { setDepth(T[u].left, p + 1); } if (T...
#include <iostream> using namespace std; #define MAX 100005 #define NIL -1 struct Node { int parent, left, right; }; Node T[MAX]; int n, D[MAX]; // D[u]: the depth of u void setDepth(int u, int p) { // u is a node // p is a depth D[u] = p; if (T[u].left != NIL) { setDepth(T[u].left, p + 1); } if (T...
[ "literal.string.change", "io.output.change" ]
123,142
123,143
u112247126
cpp
p02279
#include <iostream> using namespace std; #define MAX 100005 #define NIL -1 struct Node { int parent, left, right; }; Node T[MAX]; int n, D[MAX]; // D[u]: the depth of u void setDepth(int u, int p) { // u is a node // p is a depth D[u] = p; if (T[u].left != NIL) { setDepth(T[u].left, p + 1); } if (T...
#include <iostream> using namespace std; #define MAX 100005 #define NIL -1 struct Node { int parent, left, right; }; Node T[MAX]; int n, D[MAX]; // D[u]: the depth of u void setDepth(int u, int p) { // u is a node // p is a depth D[u] = p; if (T[u].left != NIL) { setDepth(T[u].left, p + 1); } if (T...
[]
123,144
123,143
u112247126
cpp
p02279
#include <iostream> using namespace std; #define MAX 100005 #define NIL -1 struct Node { int parent, left, right; }; Node T[MAX]; int n, D[MAX]; // D[u]: the depth of u void setDepth(int u, int p) { // u is a node // p is a depth D[u] = p; if (T[u].left != NIL) { setDepth(T[u].left, p + 1); } if (T...
#include <iostream> using namespace std; #define MAX 100005 #define NIL -1 struct Node { int parent, left, right; }; Node T[MAX]; int n, D[MAX]; // D[u]: the depth of u void setDepth(int u, int p) { // u is a node // p is a depth D[u] = p; if (T[u].left != NIL) { setDepth(T[u].left, p + 1); } if (T...
[]
123,145
123,143
u112247126
cpp
p02279
#include <bits/stdc++.h> #define Z -1 using namespace std; struct NO { int p, l, r; }; struct NO T[100000]; int D[100000] = {Z}; int rec(int u, int p) { D[u] = p; if (T[u].r != Z) rec(T[u].r, p); if (T[u].l != Z) rec(T[u].l, p + 1); } int main() { int a, b, c, n, l, r, j, k, i; for (cin >> n, i = 0;...
#include <bits/stdc++.h> #define Z -1 using namespace std; struct NO { int p, l, r; }; struct NO T[100000]; int D[100000] = {Z}; int rec(int u, int p) { D[u] = p; if (T[u].r != Z) rec(T[u].r, p); if (T[u].l != Z) rec(T[u].l, p + 1); } int main() { int a, b, c, n, l, r, j, k, i; for (cin >> n, i = 0;...
[ "literal.string.change", "call.arguments.change", "io.output.change" ]
123,150
123,149
u962041986
cpp
p02279
#include <bits/stdc++.h> #define Z -1 using namespace std; struct NO { int p, l, r; }; struct NO T[100000]; int D[100000] = {Z}; int rec(int u, int p) { D[u] = p; if (T[u].r != Z) rec(T[u].r, p); if (T[u].l != Z) rec(T[u].l, p + 1); } int main() { int a, b, c, n, l, r, j, k, i; for (cin >> n, i = 0;...
#include <bits/stdc++.h> #define Z -1 using namespace std; struct NO { int p, l, r; }; struct NO T[100000]; int D[100000] = {Z}; int rec(int u, int p) { D[u] = p; if (T[u].r != Z) rec(T[u].r, p); if (T[u].l != Z) rec(T[u].l, p + 1); } int main() { int a, b, c, n, l, r, j, k, i; for (cin >> n, i = 0;...
[ "literal.string.change", "call.arguments.change", "io.output.change" ]
123,151
123,149
u962041986
cpp
p02279
#include <algorithm> #include <iostream> #include <limits> #include <queue> #include <stack> #include <string> #include <vector> #define INT_MAX 2147483647 #define INT_MIN -2147483647 #define NUM 10000 #define INVALID_IDX -1 using namespace std; struct TreeNode { int p, l, r; }; TreeNode t[NUM]; int D[NUM]; void...
#include <algorithm> #include <iostream> #include <limits> #include <queue> #include <stack> #include <string> #include <vector> #define INT_MAX 2147483647 #define INT_MIN -2147483647 #define NUM 100005 #define INVALID_IDX -1 using namespace std; struct TreeNode { int p, l, r; }; TreeNode t[NUM]; int D[NUM]; voi...
[ "preprocessor.define.value.change", "literal.integer.change", "literal.string.change", "io.output.change" ]
123,152
123,153
u922538592
cpp
p02279
#include <iostream> #include <map> #include <set> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; #define NIL -1 #define N 10005 struct Node { int p, l, r; }; Node T[N]; int n, r, D[N]; void print(int u) { int i, c; cout << "node " << u << " "; cou...
#include <iostream> #include <map> #include <set> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; #define NIL -1 #define N 100005 struct Node { int p, l, r; }; Node T[N]; int n, r, D[N]; void print(int u) { int i, c; cout << "node " << u << ": "; c...
[ "preprocessor.define.value.change", "literal.integer.change", "literal.string.change", "io.output.change" ]
123,155
123,156
u922538592
cpp
p02279
#include <cstdio> #include <iostream> using namespace std; #define maxn 100005 #define NTL -1 struct node { int p, l, r; } t[maxn]; int n, d[maxn]; void print(int u) { int i, c; cout << "node" << u << ": "; cout << "parent = " << t[u].p << ", "; cout << "depth = " << d[u] << ", "; if (t[u].p == NTL) ...
#include <cstdio> #include <iostream> using namespace std; #define maxn 100005 #define NTL -1 struct node { int p, l, r; } t[maxn]; int n, d[maxn]; void print(int u) { int i, c; cout << "node " << u << ": "; cout << "parent = " << t[u].p << ", "; cout << "depth = " << d[u] << ", "; if (t[u].p == NTL) ...
[ "literal.string.change", "io.output.change" ]
123,158
123,159
u702548238
cpp
p02279
#include <cstdio> #include <iostream> using namespace std; #define maxn 100005 #define NTL -1 struct node { int p, l, r; } t[maxn]; int n, d[maxn]; void print(int u) { int i, c; cout << "node " << u << ": "; cout << "parent = " << t[u].p << ", "; cout << "depth = " << d[u] << ", "; if (t[u].p == NTL) ...
#include <cstdio> #include <iostream> using namespace std; #define maxn 100005 #define NTL -1 struct node { int p, l, r; } t[maxn]; int n, d[maxn]; void print(int u) { int i, c; cout << "node " << u << ": "; cout << "parent = " << t[u].p << ", "; cout << "depth = " << d[u] << ", "; if (t[u].p == NTL) ...
[ "literal.string.change", "io.output.change" ]
123,160
123,159
u702548238
cpp
p02279
#include <iostream> using namespace std; #define MAX 100005 #define NIL -1 //?????????????????¨?????? // left-child right-sibling representation struct node { int parent; int left; int right; }; node T[MAX]; int depth[MAX]; int n; void print(int u) { cout << "node " << u << ": "; cout << "parent = " << T[u...
#include <iostream> using namespace std; #define MAX 100005 #define NIL -1 //?????????????????¨?????? // left-child right-sibling representation struct node { int parent; int left; int right; }; node T[MAX]; int depth[MAX]; int n; void print(int u) { cout << "node " << u << ": "; cout << "parent = " << T[u...
[ "literal.string.change", "io.output.change" ]
123,166
123,162
u167064764
cpp
p02279
#include <bits/stdc++.h> #include <stdio.h> using namespace std; #define MAX 100005 #define NIL -1 struct Node { int p, l, r; }; Node T[MAX]; int n, D[MAX]; void print(int u) { int i, c; cout << "node " << u << ": "; cout << "parent = " << T[u].p << ", "; cout << "depth = " << D[u] << ","; if (T[u].p ==...
#include <bits/stdc++.h> #include <stdio.h> using namespace std; #define MAX 100005 #define NIL -1 struct Node { int p, l, r; }; Node T[MAX]; int n, D[MAX]; void print(int u) { int i, c; cout << "node " << u << ": "; cout << "parent = " << T[u].p << ", "; cout << "depth = " << D[u] << ", "; if (T[u].p =...
[ "literal.string.change", "io.output.change" ]
123,167
123,168
u967088297
cpp
p02279
#include <bits/stdc++.h> #include <stdio.h> using namespace std; #define MAX 100005 #define NIL -1 struct Node { int p, l, r; }; Node T[MAX]; int n, D[MAX]; void print(int u) { int i, c; cout << "node " << u << ": "; cout << "parent = " << T[u].p << ", "; cout << "depth = " << D[u] << ","; if (T[u].p ==...
#include <bits/stdc++.h> #include <stdio.h> using namespace std; #define MAX 100005 #define NIL -1 struct Node { int p, l, r; }; Node T[MAX]; int n, D[MAX]; void print(int u) { int i, c; cout << "node " << u << ": "; cout << "parent = " << T[u].p << ", "; cout << "depth = " << D[u] << ", "; if (T[u].p =...
[ "literal.string.change", "io.output.change" ]
123,169
123,168
u967088297
cpp
p02279
#include <iostream> #include <stdio.h> using namespace std; #define N_MAX 100000 #define NIL -1 struct Node { int p, l, r; }; Node T[N_MAX]; int main() { int n, i, j, v, d, x, y; cin >> n; //??¨???????????? for (i = 0; i < N_MAX; i++) { T[i].p = -1; T[i].r = T[i].l = NIL; } //??¨?????\??? ...
#include <iostream> #include <stdio.h> //printf using namespace std; #define N_MAX 100000 #define NIL -1 struct Node { int p, l, r; }; Node T[N_MAX]; int main() { int n, i, j, v, d, x, y; cin >> n; //??¨???????????? for (i = 0; i < N_MAX; i++) { T[i].p = -1; T[i].r = T[i].l = NIL; } //??¨??...
[ "literal.string.change", "call.arguments.change", "io.output.change" ]
123,170
123,171
u071308538
cpp
p02279
#include <bits/stdc++.h> typedef long long ll; typedef unsigned long long ull; using namespace std; #define pb push_back int dy[] = {0, 0, 1, -1, 0}; int dx[] = {1, -1, 0, 0, 0}; #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define RFOR(i, a, b) for (int i = (b)-1; i >= (a); i--) #define REP(i, n) for (int i =...
#include <bits/stdc++.h> typedef long long ll; typedef unsigned long long ull; using namespace std; #define pb push_back int dy[] = {0, 0, 1, -1, 0}; int dx[] = {1, -1, 0, 0, 0}; #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define RFOR(i, a, b) for (int i = (b)-1; i >= (a); i--) #define REP(i, n) for (int i =...
[ "literal.string.change", "call.arguments.change", "io.output.change" ]
123,172
123,173
u172120093
cpp
p02279
#include <iostream> #include <string> using namespace std; class Tree; class Node { public: enum TYPE { NONE, ROOT, INTERNAL_NODE, LEAF }; TYPE type; Node(Tree *T, int ID, Node *PARENT, int LEFT, int RIGHT, int C, int CHILD_LEFT = -1) { t = T; id = ID; parent = PARENT; left = LEFT; ri...
#include <iostream> #include <string> using namespace std; class Tree; class Node { public: enum TYPE { NONE, ROOT, INTERNAL_NODE, LEAF }; TYPE type; Node(Tree *T, int ID, Node *PARENT, int LEFT, int RIGHT, int C, int CHILD_LEFT = -1) { t = T; id = ID; parent = PARENT; left = LEFT; ri...
[ "control_flow.branch.else_if.replace.add", "control_flow.branch.if.replace.remove" ]
123,177
123,178
u050281953
cpp
p02279
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> using namespace std; const int INF = 0x3f3f3f3f; const int NIL = -1; const int MAXN = 100005; struct Node { int p, l, r; } T[MAXN]; int n, D[MAXN]; void print(int u) { cout << "Node" << u << ": paren...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> using namespace std; const int INF = 0x3f3f3f3f; const int NIL = -1; const int MAXN = 100005; struct Node { int p, l, r; } T[MAXN]; int n, D[MAXN]; void print(int u) { cout << "node " << u << ": pare...
[ "literal.string.change", "io.output.change" ]
123,179
123,180
u324907960
cpp
p02279
#include <algorithm> #include <iostream> #include <queue> #include <string> #include <vector> using namespace std; struct Node { string type; int depth; int parent = -1; vector<int> child; }; int main() { int n; Node node[1000]; queue<Node *> q; int depth = 0; cin >> n; for (int i = 0; i < n; i++...
#include <algorithm> #include <iostream> #include <queue> #include <string> #include <vector> using namespace std; struct Node { string type; int depth; int parent = -1; vector<int> child; }; int main() { int n; Node node[100000]; queue<Node *> q; int depth = 0; cin >> n; for (int i = 0; i < n; i...
[ "literal.number.change", "variable_declaration.array_dimensions.change", "literal.string.change", "io.output.change" ]
123,181
123,182
u448745430
cpp
p02279
/** * */ // #include {{{ #include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cfloat> #include <cmath> #include <cstdint> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <forward_list> #include <fstream> #include <functional> #include...
/** * */ // #include {{{ #include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cfloat> #include <cmath> #include <cstdint> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <forward_list> #include <fstream> #include <functional> #include...
[ "literal.string.change", "call.arguments.change", "io.output.change" ]
123,184
123,185
u600821328
cpp
p02279
#include <iostream> using namespace std; #define MAX 100005 #define NIL -1 struct node { int parent; int left; int right; }; node tree[MAX]; int d[MAX] = {}; void depth(int u, int s) { d[u] = s; if (tree[u].right != NIL) depth(tree[u].right, s); if (tree[u].left != NIL) depth(tree[u].left, s + 1...
#include <iostream> using namespace std; #define MAX 100005 #define NIL -1 struct node { int parent; int left; int right; }; node tree[MAX]; int d[MAX] = {}; void depth(int u, int s) { d[u] = s; if (tree[u].right != NIL) depth(tree[u].right, s); if (tree[u].left != NIL) depth(tree[u].left, s + 1...
[ "literal.string.change", "io.output.change" ]
123,188
123,189
u908968819
cpp
p02279
#include <iostream> using namespace std; #define MAX 100000 + 5 #define NIL -1 struct Node { int parent; int left; int right; }; Node T[MAX]; int n, D[MAX]; void Print(int u); int Rec(int u, int p); int main() { cin >> n; for (int i = 0; i < n; ++i) T[i].parent = T[i].left = T[i].right = NIL; int ...
#include <iostream> using namespace std; #define MAX 100000 + 5 #define NIL -1 struct Node { int parent; int left; int right; }; Node T[MAX]; int n, D[MAX]; void Print(int u); int Rec(int u, int p); int main() { cin >> n; for (int i = 0; i < n; ++i) T[i].parent = T[i].left = T[i].right = NIL; int ...
[ "literal.string.change", "io.output.change" ]
123,200
123,201
u563676521
cpp
p02279
#include <algorithm> #include <iostream> #include <math.h> #include <vector> using namespace std; #define FOR(k, m, n) for (int(k) = (m); (k) < (n); (k)++) #define REP(i, n) FOR((i), 0, (n)) #define LL long long #define MAX 100005 #define NIL -1 struct Node { int parent, left, right; }; Node tree[MAX]; int n, dep...
#include <algorithm> #include <iostream> #include <math.h> #include <vector> using namespace std; #define FOR(k, m, n) for (int(k) = (m); (k) < (n); (k)++) #define REP(i, n) FOR((i), 0, (n)) #define LL long long #define MAX 100005 #define NIL -1 struct Node { int parent, left, right; }; Node tree[MAX]; int n, dep...
[ "literal.string.change", "io.output.change" ]
123,202
123,203
u905303767
cpp
p02279
#include <cstdint> #include <vector> using namespace std; #define TREE_SIZE 100000 struct node_t { int32_t parent; int32_t left_child; int32_t right_sibling; }; static node_t trees[TREE_SIZE]; void rooted_tree_init() { for (uint32_t i = 0; i < TREE_SIZE; i++) { trees[i].parent = -1; trees[i].left_c...
#include <cstdint> #include <vector> using namespace std; #define TREE_SIZE 100000 struct node_t { int32_t parent; int32_t left_child; int32_t right_sibling; }; static node_t trees[TREE_SIZE]; void rooted_tree_init() { for (uint32_t i = 0; i < TREE_SIZE; i++) { trees[i].parent = -1; trees[i].left_c...
[ "identifier.change", "variable_access.subscript.index.change", "io.output.change" ]
123,205
123,206
u827214117
cpp
p02279
#include <stdio.h> #define N 100000 #define Nill -1 struct Tree { int p, l, r; }; int n; struct Tree T[N]; int D[N]; void getDepth(int u, int p) { D[u] = p; if (T[u].r != Nill) getDepth(T[u].r, p); if (T[u].l != Nill) getDepth(T[u].l, p + 1); } void Print(int r) { getDepth(r, 0); int i; int g; ...
#include <stdio.h> #define N 100000 #define Nill -1 struct Tree { int p, l, r; }; int n; struct Tree T[N]; int D[N]; void getDepth(int u, int p) { D[u] = p; if (T[u].r != Nill) getDepth(T[u].r, p); if (T[u].l != Nill) getDepth(T[u].l, p + 1); } void Print(int r) { getDepth(r, 0); int i; int g; ...
[ "literal.string.change", "call.arguments.change", "io.output.change" ]
123,207
123,208
u407335067
cpp
p02279
#include <stdio.h> #define N 100000 #define Nill -1 struct Tree { int p, l, r; }; int n; struct Tree T[N]; int D[N]; void getDepth(int u, int p) { D[u] = p; if (T[u].r != Nill) getDepth(T[u].r, p); if (T[u].l != Nill) getDepth(T[u].l, p + 1); } void Print(int r) { getDepth(r, 0); int i; int g; ...
#include <stdio.h> #define N 100000 #define Nill -1 struct Tree { int p, l, r; }; int n; struct Tree T[N]; int D[N]; void getDepth(int u, int p) { D[u] = p; if (T[u].r != Nill) getDepth(T[u].r, p); if (T[u].l != Nill) getDepth(T[u].l, p + 1); } void Print(int r) { getDepth(r, 0); int i; int g; ...
[ "literal.string.change", "call.arguments.change", "io.output.change" ]
123,209
123,208
u407335067
cpp
p02279
#include <algorithm> #include <iostream> #include <queue> #include <string> #include <vector> typedef struct { int parent = -1; int depth = 0; std::string type; std::vector<int> children; } Node; int main() { int n; std::cin >> n; std::vector<Node> tree(n); for (int i = 0; i < n; ++i) { int id, ch...
#include <algorithm> #include <iostream> #include <queue> #include <string> #include <vector> typedef struct { int parent = -1; int depth = 0; std::string type; std::vector<int> children; } Node; int main() { int n; std::cin >> n; std::vector<Node> tree(n); for (int i = 0; i < n; ++i) { int id, ch...
[ "literal.string.change", "assignment.value.change" ]
123,216
123,217
u571345107
cpp
p02279
#include <iostream> #include <set> #include <vector> using namespace std; struct node { int id; int k; int depth; int parent; vector<int> child; }; int main() { int n, id, k; cin >> n; vector<node> tree; tree.resize(n); for (int i = 0; i < n; i++) { tree[i].parent = -1; tree[i].depth = 0; ...
#include <iostream> #include <set> #include <vector> using namespace std; struct node { int id; int k; int depth; int parent; vector<int> child; }; int main() { int n, id, k; cin >> n; vector<node> tree; tree.resize(n); for (int i = 0; i < n; i++) { tree[i].parent = -1; tree[i].depth = 0; ...
[ "control_flow.branch.else.add" ]
123,218
123,219
u373322772
cpp
p02279
#include <algorithm> #include <cmath> #include <deque> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> #define rep(i, n) for (int i = 0; i < n; i++) #define loop(i, x, n) for (int i = x; i < n; i++) #define ...
#include <algorithm> #include <cmath> #include <deque> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> #define rep(i, n) for (int i = 0; i < n; i++) #define loop(i, x, n) for (int i = x; i < n; i++) #define ...
[ "literal.string.change", "io.output.change" ]
123,220
123,221
u280914315
cpp
p02279
#include <algorithm> #include <cmath> #include <deque> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> #define rep(i, n) for (int i = 0; i < n; i++) #define loop(i, x, n) for (int i = x; i < n; i++) #define ...
#include <algorithm> #include <cmath> #include <deque> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> #define rep(i, n) for (int i = 0; i < n; i++) #define loop(i, x, n) for (int i = x; i < n; i++) #define ...
[ "literal.string.change", "io.output.change" ]
123,222
123,221
u280914315
cpp
p02279
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < n; i++) #define REPR(i, n) for (int i = n - 1; i >= 0; i--) #define llong long long #define IFY 2000000000 #define MAX 100005 #define NIL -1 using namespace std; struct Node { int p, l, r; }; Node T[MAX]; int D[MAX]; void print(int u) { int j, c; prin...
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < n; i++) #define REPR(i, n) for (int i = n - 1; i >= 0; i--) #define llong long long #define IFY 2000000000 #define MAX 100005 #define NIL -1 using namespace std; struct Node { int p, l, r; }; Node T[MAX]; int D[MAX]; void print(int u) { int j, c; prin...
[ "literal.string.change", "call.arguments.change", "io.output.change", "expression.operation.unary.reference.add" ]
123,223
123,224
u253376705
cpp
p02279
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < n; i++) #define REPR(i, n) for (int i = n - 1; i >= 0; i--) #define llong long long #define IFY 2000000000 #define MAX 100005 #define NIL -1 using namespace std; struct Node { int p, l, r; }; Node T[MAX]; int D[MAX]; void print(int u) { int j, c; prin...
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < n; i++) #define REPR(i, n) for (int i = n - 1; i >= 0; i--) #define llong long long #define IFY 2000000000 #define MAX 100005 #define NIL -1 using namespace std; struct Node { int p, l, r; }; Node T[MAX]; int D[MAX]; void print(int u) { int j, c; prin...
[ "expression.operation.unary.reference.add" ]
123,225
123,224
u253376705
cpp
p02279
#include <iostream> using namespace std; #define MAX 100001 #define NIL -1 struct Node { int parent, right, left; }; struct Node D[MAX]; int T[MAX]; void rec(int u, int p) { T[u] = p; if (D[u].right != NIL) rec(D[u].right, p); if (D[u].left != NIL) rec(D[u].left, p + 1); } void print(int u) { int p; ...
#include <iostream> using namespace std; #define MAX 100001 #define NIL -1 struct Node { int parent, right, left; }; struct Node D[MAX]; int T[MAX]; void rec(int u, int p) { T[u] = p; if (D[u].right != NIL) rec(D[u].right, p); if (D[u].left != NIL) rec(D[u].left, p + 1); } void print(int u) { int p; ...
[ "expression.operation.binary.remove", "expression.operation.compare.replace.add", "assignment.replace.remove", "misc.typo" ]
123,226
123,227
u347385753
cpp
p02279
#include <iostream> using namespace std; #define MAX 100001 #define NIL -1 struct Node { int parent, right, left; }; struct Node D[MAX]; int T[MAX]; void rec(int u, int p) { T[u] = p; if (D[u].right != NIL) rec(D[u].right, p); if (D[u].left != NIL) rec(D[u].left, p + 1); } void print(int u) { int p; ...
#include <iostream> using namespace std; #define MAX 100001 #define NIL -1 struct Node { int parent, right, left; }; struct Node D[MAX]; int T[MAX]; void rec(int u, int p) { T[u] = p; if (D[u].right != NIL) rec(D[u].right, p); if (D[u].left != NIL) rec(D[u].left, p + 1); } void print(int u) { int p; ...
[ "expression.operation.binary.remove" ]
123,228
123,227
u347385753
cpp
p02279
#include <iostream> using namespace std; #define MAX 100005 #define NIL -1 struct Node { int p, l, r; }; Node T[MAX]; int n, D[MAX]; void print(int u) { int i, c; cout << "node " << u << ": "; cout << "parent = " << T[u].p << ", "; cout << "depth = " << D[u] << ", "; if (T[u].p == NIL) cout << "root...
#include <iostream> using namespace std; #define MAX 100005 #define NIL -1 struct Node { int p, l, r; }; Node T[MAX]; int n, D[MAX]; void print(int u) { int i, c; cout << "node " << u << ": "; cout << "parent = " << T[u].p << ", "; cout << "depth = " << D[u] << ", "; if (T[u].p == NIL) cout << "root...
[ "literal.string.change", "io.output.change" ]
123,231
123,232
u918247777
cpp
p02279
#include <iostream> #include <vector> using namespace std; struct node { int parent; int depth; vector<int> children; node() : parent(-1), children() {} }; int main() { int N; cin >> N; vector<node> node_list(N, node()); for (int i = 0; i < N; ++i) { int a, b; cin >> a >> b; for (int j ...
#include <iostream> #include <vector> using namespace std; struct node { int parent; int depth; vector<int> children; node() : parent(-1), children() {} }; int main() { int N; cin >> N; vector<node> node_list(N, node()); for (int i = 0; i < N; ++i) { int a, b; cin >> a >> b; for (int j ...
[ "literal.string.change", "io.output.change" ]
123,246
123,247
u957470671
cpp
p02279
#include <bits/stdc++.h> using namespace std; #define NIL -1 int n, D[1000001]; struct node { int p, l, r; }; node tree[1000001]; void print(int u) { int i, c; cout << "node " << u << ": "; cout << "parent = " << tree[u].p << ", "; cout << "depth = " << D[u] << ", "; if (tree[u].p == NIL) cout << "root...
#include <bits/stdc++.h> using namespace std; #define NIL -1 int n, D[1000001]; struct node { int p, l, r; }; node tree[1000001]; void print(int u) { int i, c; cout << "node " << u << ": "; cout << "parent = " << tree[u].p << ", "; cout << "depth = " << D[u] << ", "; if (tree[u].p == NIL) cout << "root...
[ "literal.string.change", "io.output.change" ]
123,250
123,251
u520784163
cpp
p02279
/* http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_7_A&lang=jp */ //根付き木 #include <iostream> #include <string> #include <vector> using namespace std; typedef struct Node { // int num; //ノード番号 int parent; //親 vector<int> children; string type; } Node; Node tree[100000]; int dep(int k) { int d...
/* http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_7_A&lang=jp */ //根付き木 #include <iostream> #include <string> #include <vector> using namespace std; typedef struct Node { // int num; //ノード番号 int parent; //親 vector<int> children; string type; } Node; Node tree[100000]; int dep(int k) { int d...
[ "literal.string.change", "assignment.value.change" ]
123,254
123,255
u576471005
cpp
p02279
#include <iostream> using namespace std; #define MAX 100005 #define nil -1 struct Node { int p, l, r; }; Node T[MAX]; int n, D[MAX]; void print(int u) { int i, c; cout << "node " << u << ":"; cout << "parent = " << T[u].p << ","; cout << "depth = " << D[u] << ","; if (T[u].p == nil) cout << "root, "...
#include <iostream> using namespace std; #define MAX 100005 #define nil -1 struct Node { int p, l, r; }; Node T[MAX]; int n, D[MAX]; void print(int u) { int i, c; cout << "node " << u << ": "; cout << "parent = " << T[u].p << ", "; cout << "depth = " << D[u] << ", "; if (T[u].p == nil) cout << "root...
[ "literal.string.change", "io.output.change" ]
123,256
123,257
u627448076
cpp
p02279
#include <iostream> using namespace std; #define MAXN 100005 #define NIL -1 struct Node { int p, l, r; }; Node T[MAXN]; int n, D[MAXN]; void print(int u) { int i, c; cout << "node" << u << ": "; cout << "parent = " << T[u].p << ", "; cout << "depth = " << D[u] << ", "; if (T[u].p == NIL) { cout << ...
#include <iostream> using namespace std; #define MAXN 100005 #define NIL -1 struct Node { int p, l, r; }; Node T[MAXN]; int n, D[MAXN]; void print(int u) { int i, c; cout << "node " << u << ": "; cout << "parent = " << T[u].p << ", "; cout << "depth = " << D[u] << ", "; if (T[u].p == NIL) { cout <<...
[ "literal.string.change", "io.output.change" ]
123,258
123,259
u918703259
cpp
p02279
#include <iostream> #define MAX 100005 #define NIL (-1) using namespace std; int D[MAX], n; struct Node { int parent; int left; int right; } T[MAX]; void print(int u) { int i, c; cout << "node " << u << ": "; cout << "parent = " << T[u].parent << ", "; cout << "depth = " << D[u] << ", "; if (T[u].p...
#include <iostream> #define MAX 100005 #define NIL (-1) using namespace std; int D[MAX], n; struct Node { int parent; int left; int right; } T[MAX]; void print(int u) { int i, c; cout << "node " << u << ": "; cout << "parent = " << T[u].parent << ", "; cout << "depth = " << D[u] << ", "; if (T[u].p...
[ "literal.string.change", "io.output.change", "io.output.newline.add" ]
123,262
123,263
u147824385
cpp
p02279
#include <iostream> #define MAX 100005 #define NIL (-1) using namespace std; int D[MAX], n; struct Node { int parent; int left; int right; } T[MAX]; void print(int u) { int i, c; cout << "node " << u << ": "; cout << "parent = " << T[u].parent << ", "; cout << "depth = " << D[u] << ", "; if (T[u].p...
#include <iostream> #define MAX 100005 #define NIL (-1) using namespace std; int D[MAX], n; struct Node { int parent; int left; int right; } T[MAX]; void print(int u) { int i, c; cout << "node " << u << ": "; cout << "parent = " << T[u].parent << ", "; cout << "depth = " << D[u] << ", "; if (T[u].p...
[ "literal.string.change", "io.output.change" ]
123,265
123,263
u147824385
cpp
p02279
#include <algorithm> #include <bitset> #include <cmath> #include <functional> #include <iostream> #include <list> #include <queue> #include <stack> #include <stdio.h> #include <string.h> #include <string> #include <utility> #include <vector> #define FOR(i, a, b) for (int i = (a); i <= (b); i++) #define RFOR(i, a, b) f...
#include <algorithm> #include <bitset> #include <cmath> #include <functional> #include <iostream> #include <list> #include <queue> #include <stack> #include <stdio.h> #include <string.h> #include <string> #include <utility> #include <vector> #define FOR(i, a, b) for (int i = (a); i <= (b); i++) #define RFOR(i, a, b) f...
[ "literal.string.change", "io.output.change" ]
123,268
123,269
u314954937
cpp
p02279
#include <iostream> #include <vector> using namespace std; struct NODE { int id = -100; int parent = -1; int num_children = -100; int depth = -100; vector<int> children; }; void check_depth(NODE *nodes, int id, int d) { nodes[id].depth = d; for (int i = 0; i < nodes[id].num_children; ++i) { check_d...
#include <iostream> #include <vector> using namespace std; struct NODE { int id = -100; int parent = -1; int num_children = -100; int depth = -100; vector<int> children; }; void check_depth(NODE *nodes, int id, int d) { nodes[id].depth = d; for (int i = 0; i < nodes[id].num_children; ++i) { check_d...
[ "assignment.variable.change", "identifier.change", "variable_access.subscript.index.change" ]
123,270
123,271
u148775320
cpp
p02279
#include <iostream> using namespace std; constexpr int MAX = 1000000; constexpr int NIL = -1; struct Node { int parent, left, right; }; Node T[MAX]; int n, D[MAX]; void print(int u) { int i, c; cout << "node " << u << ": "; cout << "parent " << T[u].parent << ", "; cout << "depth " << D[u] << ", "; if (T...
#include <iostream> using namespace std; constexpr int MAX = 1000000; constexpr int NIL = -1; struct Node { int parent, left, right; }; Node T[MAX]; int n, D[MAX]; void print(int u) { int i, c; cout << "node " << u << ": "; cout << "parent = " << T[u].parent << ", "; cout << "depth = " << D[u] << ", "; i...
[ "literal.string.change", "io.output.change", "misc.opposites", "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
123,272
123,273
u334865030
cpp
p02279
#include <iostream> using namespace std; constexpr int MAX = 1000000; constexpr int NIL = -1; struct Node { int parent, left, right; }; Node T[MAX]; int n, D[MAX]; void print(int u) { int i, c; cout << "node " << u << ": "; cout << "parent " << T[u].parent << ", "; cout << "depth " << D[u] << ", "; if (T...
#include <iostream> using namespace std; constexpr int MAX = 1000000; constexpr int NIL = -1; struct Node { int parent, left, right; }; Node T[MAX]; int n, D[MAX]; void print(int u) { int i, c; cout << "node " << u << ": "; cout << "parent = " << T[u].parent << ", "; cout << "depth = " << D[u] << ", "; i...
[ "literal.string.change", "io.output.change" ]
123,274
123,273
u334865030
cpp
p02279
#include <bits/stdc++.h> /*#include<iostream> #include<algorithm> #include<climits>*/ #include <cmath> #include <cstdio> #include <cstring> #include <ctype.h> #include <stdio.h> #include <string.h> #define rep(i, a, b) for (int i = a; i < (b); ++i) #define rep1(i, a, b) for (int i = a; i <= (b); ++i) #define per(i, a, ...
#include <bits/stdc++.h> /*#include<iostream> #include<algorithm> #include<climits>*/ #include <cmath> #include <cstdio> #include <cstring> #include <ctype.h> #include <stdio.h> #include <string.h> #define rep(i, a, b) for (int i = a; i < (b); ++i) #define rep1(i, a, b) for (int i = a; i <= (b); ++i) #define per(i, a, ...
[ "preprocessor.define.value.change", "literal.integer.change", "literal.string.change", "call.arguments.change", "io.output.change" ]
123,275
123,276
u585820528
cpp
p02279
#include <bits/stdc++.h> /*#include<iostream> #include<algorithm> #include<climits>*/ #include <cmath> #include <cstdio> #include <cstring> #include <ctype.h> #include <stdio.h> #include <string.h> #define rep(i, a, b) for (int i = a; i < (b); ++i) #define rep1(i, a, b) for (int i = a; i <= (b); ++i) #define per(i, a, ...
#include <bits/stdc++.h> /*#include<iostream> #include<algorithm> #include<climits>*/ #include <cmath> #include <cstdio> #include <cstring> #include <ctype.h> #include <stdio.h> #include <string.h> #define rep(i, a, b) for (int i = a; i < (b); ++i) #define rep1(i, a, b) for (int i = a; i <= (b); ++i) #define per(i, a, ...
[ "preprocessor.define.value.change", "literal.integer.change", "literal.string.change", "call.arguments.change", "io.output.change" ]
123,277
123,276
u585820528
cpp
p02279
#include <iostream> using namespace std; #define MAX 100005 #define NIL -1 struct Node { int p, l, r; }; Node T[MAX]; int n, D[MAX]; void print(int u) { cout << "node " << u << ": " << flush; cout << "parent = " << T[u].p << ", " << flush; cout << "depth = " << D[u] << ", " << flush; if (T[u].p == NIL) { ...
#include <iostream> using namespace std; #define MAX 100005 #define NIL -1 struct Node { int p, l, r; }; Node T[MAX]; int n, D[MAX]; void print(int u) { cout << "node " << u << ": " << flush; cout << "parent = " << T[u].p << ", " << flush; cout << "depth = " << D[u] << ", " << flush; if (T[u].p == NIL) { ...
[ "assignment.variable.change", "identifier.change", "variable_access.subscript.index.change" ]
123,279
123,280
u047256438
cpp
p02279
#include <bits/stdc++.h> using namespace std; using ll = long long; using vi = vector<int>; using vvi = vector<vi>; using vs = vector<string>; using msi = map<string, int>; using mii = map<int, int>; using psi = pair<string, int>; using pii = pair<int, int>; using vlai = valarray<int>; #define rep(i, n) for (int i = 0;...
#include <bits/stdc++.h> using namespace std; using ll = long long; using vi = vector<int>; using vvi = vector<vi>; using vs = vector<string>; using msi = map<string, int>; using mii = map<int, int>; using psi = pair<string, int>; using pii = pair<int, int>; using vlai = valarray<int>; #define rep(i, n) for (int i = 0;...
[ "control_flow.branch.if.condition.change" ]
123,281
123,282
u886694089
cpp
p02279
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; const double...
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; const double...
[ "assignment.variable.change", "identifier.change", "variable_access.subscript.index.change" ]
123,283
123,284
u283637129
cpp
p02279
#include <algorithm> #include <iostream> #include <list> #include <math.h> #include <stdio.h> #include <utility> #include <vector> using namespace std; int n; struct node { int parent, depth; vector<int> child; }; node nd[100000]; void CalcDepth(int r) { if (nd[r].child.size() != 0) { for (int i = 0; i < nd...
#include <algorithm> #include <iostream> #include <list> #include <math.h> #include <stdio.h> #include <utility> #include <vector> using namespace std; int n; struct node { int parent, depth; vector<int> child; }; node nd[100000]; void CalcDepth(int r) { if (nd[r].child.size() != 0) { for (int i = 0; i < nd...
[ "literal.string.change", "call.arguments.change", "io.output.change" ]
123,285
123,286
u733937602
cpp
p02279
#include <iostream> using namespace std; #define NIL -1; struct Node { int parent, left, right; }; Node T[600000]; int D[600000]; int getDepth(int u) { int d = 0; while (T[u].parent != -1) { u = T[u].parent; d++; } return d; } void setDepth(int u, int p) { D[u] = p; if (T[u].right != -1) ...
#include <iostream> using namespace std; #define NIL -1; struct Node { int parent, left, right; }; Node T[600000]; int D[600000]; int getDepth(int u) { int d = 0; while (T[u].parent != -1) { u = T[u].parent; d++; } return d; } void setDepth(int u, int p) { D[u] = p; if (T[u].right != -1) ...
[ "literal.string.change", "io.output.change" ]
123,287
123,288
u836625838
cpp
p02279
#include <iostream> #include <stdio.h> using namespace std; const static int MAX = 100000; const static int NIL = -1; typedef struct { int parent; int left; int right; } Node; Node T[MAX]; int D[MAX]; void printChildren(int u) { int c = T[u].left; int i = 0; printf("["); while (c != NIL) { if (i ...
#include <iostream> #include <stdio.h> using namespace std; const static int MAX = 100000; const static int NIL = -1; typedef struct { int parent; int left; int right; } Node; Node T[MAX]; int D[MAX]; void printChildren(int u) { int c = T[u].left; int i = 0; printf("["); while (c != NIL) { if (i ...
[]
123,289
123,290
u475480520
cpp
p02280
#include <cstdio> #define MAX 10000 #define NIL -1 struct Node { int parent, left, right; }; Node T[MAX]; int n, D[MAX], H[MAX]; void setDepth(int u, int d) { if (u == NIL) { return; } D[u] = d; setDepth(T[u].left, d + 1); setDepth(T[u].right, d + 1); } int setHeight(int u) { int h1 = 0, h2 = 0; ...
#include <cstdio> #define MAX 10000 #define NIL -1 struct Node { int parent, left, right; }; Node T[MAX]; int n, D[MAX], H[MAX]; void setDepth(int u, int d) { if (u == NIL) { return; } D[u] = d; setDepth(T[u].left, d + 1); setDepth(T[u].right, d + 1); } int setHeight(int u) { int h1 = 0, h2 = 0; ...
[ "literal.string.change", "call.arguments.change", "io.output.change", "identifier.change", "variable_access.subscript.index.change", "control_flow.branch.if.condition.change" ]
123,306
123,307
u291057603
cpp
p02280
#include <cstdio> #define MAX 10000 #define NIL -1 struct Node { int parent; int left; int right; }; Node T[MAX]; int n, D[MAX], H[MAX]; void setDepth(int u, int d) { if (u == NIL) return; D[u] = d; setDepth(T[u].left, d + 1); setDepth(T[u].right, d + 1); } int setHeight(int u) { int h1 = 0, h2...
#include <cstdio> #define MAX 10000 #define NIL -1 struct Node { int parent; int left; int right; }; Node T[MAX]; int n, D[MAX], H[MAX]; void setDepth(int u, int d) { if (u == NIL) return; D[u] = d; setDepth(T[u].left, d + 1); setDepth(T[u].right, d + 1); } int setHeight(int u) { int h1 = 0, h2...
[ "assignment.value.change", "call.arguments.change", "expression.operation.binary.change", "function.return_value.change", "literal.string.change", "io.output.change" ]
123,309
123,310
u204247262
cpp
p02280
#include <cstdio> #define MAX 10000 #define NIL -1 struct Node { int parent; int left; int right; }; Node T[MAX]; int n, D[MAX], H[MAX]; void setDepth(int u, int d) { if (u == NIL) return; D[u] = d; setDepth(T[u].left, d + 1); setDepth(T[u].right, d + 1); } int setHeight(int u) { int h1 = 0, h2...
#include <cstdio> #define MAX 10000 #define NIL -1 struct Node { int parent; int left; int right; }; Node T[MAX]; int n, D[MAX], H[MAX]; void setDepth(int u, int d) { if (u == NIL) return; D[u] = d; setDepth(T[u].left, d + 1); setDepth(T[u].right, d + 1); } int setHeight(int u) { int h1 = 0, h2...
[ "literal.string.change", "call.arguments.change", "io.output.change" ]
123,311
123,310
u204247262
cpp
p02280
#include <bits/stdc++.h> using namespace std; #define NIL -1 struct node { int p, r, l; }; node tree[10000]; int D[10000], n[10000]; int height(int i) { int h1, h2; h1 = h2 = 0; if (tree[i].r != NIL) h1 = height(tree[i].r) + 1; if (tree[i].l != NIL) h2 = height(tree[i].l) + 1; return n[i] = max(h...
#include <bits/stdc++.h> using namespace std; #define NIL -1 struct node { int p, r, l; }; node tree[10000]; int D[10000], n[10000]; int height(int i) { int h1, h2; h1 = h2 = 0; if (tree[i].r != NIL) h1 = height(tree[i].r) + 1; if (tree[i].l != NIL) h2 = height(tree[i].l) + 1; return n[i] = max(h...
[ "assignment.variable.change", "identifier.change", "variable_access.subscript.index.change" ]
123,313
123,314
u661973509
cpp
p02280
#include <algorithm> #include <cmath> #include <cstdlib> #include <cstring> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <vector> using namespace std; #defi...
#include <algorithm> #include <cmath> #include <cstdlib> #include <cstring> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <vector> using namespace std; #defi...
[ "identifier.change", "control_flow.branch.if.condition.change" ]
123,317
123,318
u760378812
cpp
p02280
#include <stdio.h> struct Node { int l, p, r, b; } T[28]; int D[30], H[30], n, DE[30]; void jiedian(int p, int u) { if (p == -1) return; D[p] = u; jiedian(T[p].l, u + 1); jiedian(T[p].r, u + 1); } int pops(int u) { if (H[u] == 0) return 0; int h1 = pops(T[u].r) + 1; int h2 = pops(T[u].l) + 1; ...
#include <stdio.h> struct Node { int l, p, r, b; } T[100]; int D[100], H[100], n, DE[100]; void jiedian(int p, int u) { if (p == -1) return; D[p] = u; jiedian(T[p].l, u + 1); jiedian(T[p].r, u + 1); } int pops(int u) { if (H[u] == 0) return 0; int h1 = pops(T[u].r) + 1; int h2 = pops(T[u].l) +...
[ "literal.number.change", "variable_declaration.array_dimensions.change" ]
123,321
123,322
u011621222
cpp
p02280
#include <iostream> using namespace std; #define MAX 25 #define NIL -1 struct Node { int parent, left, right; }; Node T[MAX]; int depth(int i) { int count = 0; int c = i; while (T[c].parent != NIL) { c = T[c].parent; count++; } return count; } int height(int i) { if (T[i].left == NIL && T[...
#include <iostream> using namespace std; #define MAX 25 #define NIL -1 struct Node { int parent, left, right; }; Node T[MAX]; int depth(int i) { int count = 0; int c = i; while (T[c].parent != NIL) { c = T[c].parent; count++; } return count; } int height(int i) { if (T[i].left == NIL && T[...
[ "control_flow.branch.if.condition.change" ]
123,323
123,324
u164798161
cpp
p02280
#include <bits/stdc++.h> #define all(x) (x).begin(), (x).end() typedef long long ll; #define rep(i, n) for (ll i = 0, i##_len = (n); i < i##_len; ++i) #define REP(i, num, n) for (ll i = num, i##_len = (n); i < i##_len; ++i) #define repprev(i, a, b) for (ll i = b - 1; i >= a; i--) #define reprev(i, n) repprev(i, 0, n) u...
#include <bits/stdc++.h> #define all(x) (x).begin(), (x).end() typedef long long ll; #define rep(i, n) for (ll i = 0, i##_len = (n); i < i##_len; ++i) #define REP(i, num, n) for (ll i = num, i##_len = (n); i < i##_len; ++i) #define repprev(i, a, b) for (ll i = b - 1; i >= a; i--) #define reprev(i, n) repprev(i, 0, n) u...
[ "literal.string.change", "io.output.change" ]
123,327
123,328
u142421784
cpp
p02280
#include <bits/stdc++.h> using namespace std; typedef long long ll; // typedef pair<ll, ll> P; struct P { int p, l, r; }; P T[30]; int D[30], H[30]; void depth(int v, int d) { if (v == -1) return; D[v] = d; depth(T[v].l, d + 1); depth(T[v].r, d + 1); } int hight(int v) { if (v == -1) return -1; ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; // typedef pair<ll, ll> P; struct P { int p, l, r; }; P T[30]; int D[30], H[30]; void depth(int v, int d) { if (v == -1) return; D[v] = d; depth(T[v].l, d + 1); depth(T[v].r, d + 1); } int hight(int v) { if (v == -1) return -1; ...
[ "literal.string.change", "call.arguments.change", "io.output.change" ]
123,329
123,330
u387257304
cpp
p02280
#include <iostream> #include <string> using namespace std; class Node { public: int l, r, p; int deg, sib, dep, hig; string typ; }; Node nodes[25]; int top(int id, int tp) { if (nodes[id].p != -1) { return top(nodes[id].p, tp + 1); } return tp; } int dfs(int id, int dep) { if (nodes[id].r != -1 ||...
#include <iostream> #include <string> using namespace std; class Node { public: int l, r, p; int deg, sib, dep, hig; string typ; }; Node nodes[25]; int top(int id, int tp) { if (nodes[id].p != -1) { return top(nodes[id].p, tp + 1); } return tp; } int dfs(int id, int dep) { if (nodes[id].r != -1 ||...
[ "variable_declaration.value.change" ]
123,333
123,334
u387690318
cpp
p02280
#include <cstdio> using namespace std; #define NIL -1 struct Node { int parent, left, right; }; Node T[30]; int n, D[30], H[30]; void setDepth(int i, int d) { if (i == NIL) return; D[i] = d; setDepth(T[i].left, d + 1); setDepth(T[i].right, d + 1); } int setHeight(int i) { int h1 = 0, h2 = 0; if (T[...
#include <cstdio> using namespace std; #define NIL -1 struct Node { int parent, left, right; }; Node T[30]; int n, D[30], H[30]; void setDepth(int i, int d) { if (i == NIL) return; D[i] = d; setDepth(T[i].left, d + 1); setDepth(T[i].right, d + 1); } int setHeight(int i) { int h1 = 0, h2 = 0; if (T[...
[ "literal.string.change", "call.arguments.change", "io.output.change" ]
123,335
123,336
u974611510
cpp
p02280
#include <bits/stdc++.h> using namespace std; static const int NIL = -1; struct Node { int parent; int left; int right; Node(int parent = NIL, int left = NIL, int right = NIL) : parent(parent), left(left), right(right) {} }; vector<Node> T; vector<int> D; vector<int> H; void setDepth(int u, int depth)...
#include <bits/stdc++.h> using namespace std; static const int NIL = -1; struct Node { int parent; int left; int right; Node(int parent = NIL, int left = NIL, int right = NIL) : parent(parent), left(left), right(right) {} }; vector<Node> T; vector<int> D; vector<int> H; void setDepth(int u, int depth)...
[ "literal.string.change", "assignment.value.change" ]
123,341
123,342
u334031393
cpp
p02280
#include <cstdio> #define MAX 10000 #define NIL -1 struct Node { int parent, left, right; }; Node T[MAX]; int n, D[MAX], H[MAX]; void setDepth(int u, int d) { if (u == NIL) return; D[u] = d; setDepth(T[u].left, d + 1); setDepth(T[u].right, d + 1); } int setHeight(int u) { int h1 = 0, h2 = 0; if (T...
#include <cstdio> #define MAX 10000 #define NIL -1 struct Node { int parent, left, right; }; Node T[MAX]; int n, D[MAX], H[MAX]; void setDepth(int u, int d) { if (u == NIL) return; D[u] = d; setDepth(T[u].left, d + 1); setDepth(T[u].right, d + 1); } int setHeight(int u) { int h1 = 0, h2 = 0; if (T...
[ "identifier.change", "control_flow.branch.if.condition.change" ]
123,347
123,348
u114204200
cpp
p02280
/*! if g++ -g alds_1_7_b.cpp -o alds_1_7_b.out; then ./alds_1_7_b.out < * alds_1_7_b.test; fi */ #include <algorithm> #include <cctype> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iostream> #include <iterator> #include <map> #include <nu...
/*! if g++ -g alds_1_7_b.cpp -o alds_1_7_b.out; then ./alds_1_7_b.out < * alds_1_7_b.test; fi */ #include <algorithm> #include <cctype> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iostream> #include <iterator> #include <map> #include <nu...
[ "literal.string.change", "function.return_value.change" ]
123,349
123,350
u213314770
cpp
p02280
#include <iostream> using namespace std; #define MAX 25 #define NIL -1 struct Node { int parent, left, right; }; struct Node T[MAX]; int n, D[MAX], H[MAX]; void setDepth(int u, int d) { if (u == NIL) return; D[u] = d; setDepth(T[u].left, d + 1); setDepth(T[u].right, d + 1); } int setHeight(int u) { ...
#include <iostream> using namespace std; #define MAX 25 #define NIL -1 struct Node { int parent, left, right; }; struct Node T[MAX]; int n, D[MAX], H[MAX]; void setDepth(int u, int d) { if (u == NIL) return; D[u] = d; setDepth(T[u].left, d + 1); setDepth(T[u].right, d + 1); } int setHeight(int u) { ...
[ "control_flow.branch.if.condition.change" ]
123,351
123,352
u528991554
cpp
p02280
#include <algorithm> #include <cassert> #include <iostream> #include <iterator> #include <string> #include <utility> #include <vector> using namespace std; typedef enum { ROOT, LEAF, INTR } LEAF_TYPE; string lt2str(LEAF_TYPE lt) { switch (lt) { case ROOT: return "root"; case LEAF: return "leaf"; case ...
#include <algorithm> #include <cassert> #include <iostream> #include <iterator> #include <string> #include <utility> #include <vector> using namespace std; typedef enum { ROOT, LEAF, INTR } LEAF_TYPE; string lt2str(LEAF_TYPE lt) { switch (lt) { case ROOT: return "root"; case LEAF: return "leaf"; case ...
[ "expression.operation.binary.remove" ]
123,353
123,354
u342312206
cpp
p02280
#include <cstdio> #define N 26 #define Nil -1 typedef struct { int parent; int left; int right; } Node; Node BT[N]; int D[N]; int Deg[N]; int H[N]; void setDepth(int i, int depth) { D[i] = depth; if (BT[i].left != Nil) setDepth(BT[i].left, depth + 1); if (BT[i].right != Nil) setDepth(BT[i].right,...
#include <cstdio> #define N 26 #define Nil -1 typedef struct { int parent; int left; int right; } Node; Node BT[N]; int D[N]; int Deg[N]; int H[N]; void setDepth(int i, int depth) { D[i] = depth; if (BT[i].left != Nil) setDepth(BT[i].left, depth + 1); if (BT[i].right != Nil) setDepth(BT[i].right,...
[ "assignment.variable.change", "identifier.change", "variable_access.subscript.index.change", "literal.string.change", "call.arguments.change", "io.output.change" ]
123,356
123,357
u890722286
cpp
p02280
#include <cstdio> #define N 26 #define Nil -1 typedef struct { int parent; int left; int right; } Node; Node BT[N]; int D[N]; int Deg[N]; int H[N]; void setDepth(int i, int depth) { D[i] = depth; if (BT[i].left != Nil) setDepth(BT[i].left, depth + 1); if (BT[i].right != Nil) setDepth(BT[i].right,...
#include <cstdio> #define N 26 #define Nil -1 typedef struct { int parent; int left; int right; } Node; Node BT[N]; int D[N]; int Deg[N]; int H[N]; void setDepth(int i, int depth) { D[i] = depth; if (BT[i].left != Nil) setDepth(BT[i].left, depth + 1); if (BT[i].right != Nil) setDepth(BT[i].right,...
[ "literal.string.change", "call.arguments.change", "io.output.change" ]
123,359
123,357
u890722286
cpp
p02280
#include <algorithm> #include <cstdio> #include <iostream> using namespace std; #define MAX 100001 #define NIL -1 struct Node { int p, l, r; }; Node T[MAX]; int n, D[MAX], H[MAX]; void setDepth(int u, int p) { D[u] = p; if (T[u].r != NIL) setDepth(T[u].r, p + 1); if (T[u].l != NIL) setDepth(T[u].l, p ...
#include <algorithm> #include <cstdio> #include <iostream> using namespace std; #define MAX 100001 #define NIL -1 struct Node { int p, l, r; }; Node T[MAX]; int n, D[MAX], H[MAX]; void setDepth(int u, int p) { D[u] = p; if (T[u].r != NIL) setDepth(T[u].r, p + 1); if (T[u].l != NIL) setDepth(T[u].l, p ...
[ "literal.string.change", "io.output.change" ]
123,360
123,361
u338932851
cpp
p02280
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <queue> #include <set> #include <string> #include <vector> #define FOR(i, l, r) for (i = (l); i < r; i++) using namespace std; typedef long long ll; typedef struct { int p; // parent int l; // left child int r; // ...
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <queue> #include <set> #include <string> #include <vector> #define FOR(i, l, r) for (i = (l); i < r; i++) using namespace std; typedef long long ll; typedef struct { int p; // parent int l; // left child int r; // ...
[ "literal.string.change", "call.arguments.change", "io.output.change" ]
123,362
123,363
u700272293
cpp
p02280
#include <algorithm> #include <iostream> using namespace std; int get_height(int node, int left[], int right[], int height[]); int get_depth(int node, int parent[], int depth[]); void show_info(int node, int parent[], int sibling[], int degree[], int depth[], int height[]); int main() { int parent[26...
#include <algorithm> #include <iostream> using namespace std; int get_height(int node, int left[], int right[], int height[]); int get_depth(int node, int parent[], int depth[]); void show_info(int node, int parent[], int sibling[], int degree[], int depth[], int height[]); int main() { int parent[26...
[ "literal.string.change", "io.output.change" ]
123,364
123,365
u766807750
cpp
p02280
#include <algorithm> #include <iostream> using namespace std; #define NIL -1 struct Node { int parent, right, left; }; Node T[30]; int H[30]; int D[30]; int getSibling(int u) { if (T[u].parent == NIL) return NIL; if (T[T[u].parent].left != NIL && T[T[u].parent].left != u) return T[T[u].parent].left; ...
#include <algorithm> #include <iostream> using namespace std; #define NIL -1 struct Node { int parent, right, left; }; Node T[30]; int H[30]; int D[30]; int getSibling(int u) { if (T[u].parent == NIL) return NIL; if (T[T[u].parent].left != NIL && T[T[u].parent].left != u) return T[T[u].parent].left; ...
[ "control_flow.branch.if.condition.change" ]
123,367
123,368
u520560663
cpp
p02280
#include <algorithm> #include <cstdio> #include <cstdlib> #include <iostream> #include <list> #include <queue> #include <stack> #include <string.h> #include <string> #include <vector> #define _USE_MATH_DEFINES #include <math.h> using namespace std; struct node { int parent, left, right; }; node t[100]; int n, NIL =...
#include <algorithm> #include <cstdio> #include <cstdlib> #include <iostream> #include <list> #include <queue> #include <stack> #include <string.h> #include <string> #include <vector> #define _USE_MATH_DEFINES #include <math.h> using namespace std; struct node { int parent, left, right; }; node t[100]; int n, NIL =...
[ "expression.operation.binary.remove" ]
123,369
123,370
u177949486
cpp
p02280
#include <cstdio> #include <cstdlib> #include <iostream> using namespace std; class Node { private: int id; int parent_id; int sibling; int degree; int depth; int height; const char *type; Node *parent; Node *left; Node *right; public: Node() : id(-1), parent_id(-1), sibling(-1), degree(0...
#include <cstdio> #include <cstdlib> #include <iostream> using namespace std; class Node { private: int id; int parent_id; int sibling; int degree; int depth; int height; const char *type; Node *parent; Node *left; Node *right; public: Node() : id(-1), parent_id(-1), sibling(-1), degree(0...
[ "literal.string.change", "call.arguments.change", "io.output.change" ]
123,371
123,372
u566392363
cpp
p02280
/* * File: BinaryTree.cpp * Author: masa * * Created on 2016/03/04, 9:14 */ #include <cstdlib> #include <iostream> #define MAX 26 #define NIL -1 using namespace std; /* * */ struct Node { int parent; int left; int right; }; Node TreeNodeList[MAX]; int DepthList[MAX]; int HeightList[MAX]; void setDe...
/* * File: BinaryTree.cpp * Author: masa * * Created on 2016/03/04, 9:14 */ #include <cstdlib> #include <iostream> #define MAX 26 #define NIL -1 using namespace std; /* * */ struct Node { int parent; int left; int right; }; Node TreeNodeList[MAX]; int DepthList[MAX]; int HeightList[MAX]; void setDe...
[ "misc.opposites", "control_flow.branch.if.condition.change" ]
123,376
123,377
u651428295
cpp
p02280
// -*- mode:c++; coding:utf-8; c-basic-offset:2; -*- // ALDS1_7_B: Binary Trees #include <algorithm> #include <cstdio> class BinaryTree { public: static const int NIL = -1; struct Node { // id is index of nodes_ int parent = NIL; int left = NIL; int right = NIL; unsigned int depth = 0u; u...
// -*- mode:c++; coding:utf-8; c-basic-offset:2; -*- // ALDS1_7_B: Binary Trees #include <algorithm> #include <cstdio> class BinaryTree { public: static const int NIL = -1; struct Node { // id is index of nodes_ int parent = NIL; int left = NIL; int right = NIL; unsigned int depth = 0u; u...
[ "literal.string.change", "call.arguments.change", "io.output.change" ]
123,378
123,379
u020697156
cpp
p02280
#include <algorithm> #include <iostream> #include <vector> using namespace std; static const int SIZE = 100; static const int NIL = -1; struct Node { int parent; int left; int right; }; vector<Node> T(SIZE); int n; vector<int> D(SIZE); vector<int> H(SIZE); void setDepth(int u, int d) { if (u == NIL) { r...
#include <algorithm> #include <iostream> #include <vector> using namespace std; static const int SIZE = 100; static const int NIL = -1; struct Node { int parent; int left; int right; }; vector<Node> T(SIZE); int n; vector<int> D(SIZE); vector<int> H(SIZE); void setDepth(int u, int d) { if (u == NIL) { r...
[ "literal.string.change", "io.output.change" ]
123,380
123,381
u285015144
cpp
p02280
#include <algorithm> #include <cstdio> #include <vector> using namespace std; struct node { int parent, left, right, sibling; int depth, height; node() { parent = -1; depth = -2; height = -2; } }; vector<node> tree; int traverse(int id, int current_depth) { if (id == -1) { return -1; } ...
#include <algorithm> #include <cstdio> #include <vector> using namespace std; struct node { int parent, left, right, sibling; int depth, height; node() { parent = -1; depth = -2; height = -2; } }; vector<node> tree; int traverse(int id, int current_depth) { if (id == -1) { return -1; } ...
[ "literal.string.change", "call.arguments.change", "io.output.change" ]
123,382
123,383
u091662260
cpp
p02280
#include <algorithm> #include <iostream> #include <stdlib.h> using namespace std; struct node { int parent_id; int left_child_id; int right_child_id; int sibling_id; }; void print_children(int *children, int size); int get_depth(node *b, int id); int get_degree(node *b, int id); int get_height(node *b, int id)...
#include <algorithm> #include <iostream> #include <stdlib.h> using namespace std; struct node { int parent_id; int left_child_id; int right_child_id; int sibling_id; }; void print_children(int *children, int size); int get_depth(node *b, int id); int get_degree(node *b, int id); int get_height(node *b, int id)...
[ "literal.string.change", "io.output.change" ]
123,384
123,385
u641921093
cpp
p02280
#include <iostream> using namespace std; #define NIL -1 //二分木の節点 struct Node { int parent, left, right; }; Node T[1000000]; int n, D[1000000], H[1000000]; //二分木の節点の深さ void setDepth(int u, int d) { if (u == NIL) return; D[u] = d; setDepth(T[u].left, d + 1); setDepth(T[u].right, d + 1); } //二分木の節点の高さ in...
#include <iostream> using namespace std; #define NIL -1 //二分木の節点 struct Node { int parent, left, right; }; Node T[1000000]; int n, D[1000000], H[1000000]; //二分木の節点の深さ void setDepth(int u, int d) { if (u == NIL) return; D[u] = d; setDepth(T[u].left, d + 1); setDepth(T[u].right, d + 1); } //二分木の節点の高さ in...
[ "literal.string.change", "io.output.change" ]
123,386
123,387
u955830252
cpp
p02280
#include <bits/stdc++.h> using namespace std; #define REP(asd, fgh) for (int asd = 0; asd < fgh; asd++) int n; class Node { public: int p; int depth; int height; int sibling; int degree; string type; }; vector<Node> ans; vector<vector<int>> t; int dfs(int ind, int prev, int depth) { ans[ind].p = prev;...
#include <bits/stdc++.h> using namespace std; #define REP(asd, fgh) for (int asd = 0; asd < fgh; asd++) int n; class Node { public: int p; int depth; int height; int sibling; int degree; string type; }; vector<Node> ans; vector<vector<int>> t; int dfs(int ind, int prev, int depth) { ans[ind].p = prev;...
[ "literal.number.change", "assignment.value.change" ]
123,390
123,391
u219160431
cpp
p02280
#include <bits/stdc++.h> using namespace std; int root; int t[2][100000], hight[100000]; int dfs(int p) { if (p == -1) return -1; return hight[p] = max(dfs(t[0][p]), dfs(t[1][p])) + 1; } int main() { int root; int n, par[100000], sib[100000]; cin >> n; for (int i = 0; i < n; i++) par[i] = -1; for...
#include <bits/stdc++.h> using namespace std; int root; int t[2][100000], hight[100000]; int dfs(int p) { if (p == -1) return -1; return hight[p] = max(dfs(t[0][p]), dfs(t[1][p])) + 1; } int main() { int root; int n, par[100000], sib[100000]; cin >> n; for (int i = 0; i < n; i++) sib[i] = par[i] = ...
[ "assignment.change" ]
123,392
123,393
u751176970
cpp
p02280
#include <bits/stdc++.h> using namespace std; struct node { int par, l, r, sib, deg, h; }; node N[30]; int get_dep(int x, int dep) { if (N[x].par == -1) return dep; return get_dep(N[x].par, dep + 1); } int mk_h(int x) { int res = 0; if (N[x].l != -1) mk_h(N[x].l), res = N[N[x].l].h + 1; if (N[x].r...
#include <bits/stdc++.h> using namespace std; struct node { int par, l, r, sib, deg, h; }; node N[30]; int get_dep(int x, int dep) { if (N[x].par == -1) return dep; return get_dep(N[x].par, dep + 1); } int mk_h(int x) { int res = 0; if (N[x].l != -1) mk_h(N[x].l), res = N[N[x].l].h + 1; if (N[x].r...
[ "literal.string.change", "call.arguments.change", "io.output.change" ]
123,394
123,395
u952951927
cpp
p02280
#include <algorithm> #include <iostream> using namespace std; const int MAX = 10000; const int NIL = -1; struct Node { int p; int l; int r; }; Node T[MAX]; int n, D[MAX], H[MAX]; void setDepth(int u, int d) { if (u == NIL) return; D[u] = d; setDepth(T[u].l, d + 1); setDepth(T[u].r, d + 1); } int ...
#include <algorithm> #include <iostream> using namespace std; const int MAX = 10000; const int NIL = -1; struct Node { int p; int l; int r; }; Node T[MAX]; int n, D[MAX], H[MAX]; void setDepth(int u, int d) { if (u == NIL) return; D[u] = d; setDepth(T[u].l, d + 1); setDepth(T[u].r, d + 1); } int ...
[ "literal.string.change", "io.output.change" ]
123,400
123,399
u228579910
cpp
p02280
#include <algorithm> #include <iostream> using namespace std; const int MAX = 10000; const int NIL = -1; struct Node { int p; int l; int r; }; Node T[MAX]; int n, D[MAX], H[MAX]; void setDepth(int u, int d) { if (u == NIL) return; D[u] = d; setDepth(T[u].l, d + 1); setDepth(T[u].r, d + 1); } int ...
#include <algorithm> #include <iostream> using namespace std; const int MAX = 10000; const int NIL = -1; struct Node { int p; int l; int r; }; Node T[MAX]; int n, D[MAX], H[MAX]; void setDepth(int u, int d) { if (u == NIL) return; D[u] = d; setDepth(T[u].l, d + 1); setDepth(T[u].r, d + 1); } int ...
[ "literal.string.change", "io.output.change", "expression.operation.binary.remove" ]
123,401
123,402
u228579910
cpp
p02280
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int INF = 1e9; struct Node_t { Node_t() { id_ = left_ = right_ = parent_ = depth_ = height_ = -1; deg_ = 0; type_ = -1; sibling_ = -1; } int id_, left_, right_, parent_, depth_, height_, deg_, type_; int sibling_; }; ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int INF = 1e9; struct Node_t { Node_t() { id_ = left_ = right_ = parent_ = depth_ = height_ = -1; deg_ = 0; type_ = -1; sibling_ = -1; } int id_, left_, right_, parent_, depth_, height_, deg_, type_; int sibling_; }; ...
[ "literal.string.change", "call.arguments.change", "io.output.change" ]
123,409
123,410
u855775311
cpp
p02280
#include <iostream> using namespace std; #define N 25 #define rep(i, a) for (int i = 0; i < a; i++) int n, a, l[N], r[N], par[N], sib[N], deg[N], dep[N], height[N], z[N]; bool used[N]; int dfs(int x, int d) { dep[x] = d; if (l[x] == -1 && r[x] == -1) return 1; if (z[x] != 2) z[x] = 1; if (l[x] != -1)...
#include <iostream> using namespace std; #define N 25 #define rep(i, a) for (int i = 0; i < a; i++) int n, a, l[N], r[N], par[N], sib[N], deg[N], dep[N], height[N], z[N]; bool used[N]; int dfs(int x, int d) { dep[x] = d; if (l[x] == -1 && r[x] == -1) return 1; if (z[x] != 2) z[x] = 1; if (l[x] != -1)...
[ "literal.string.change", "io.output.change" ]
123,413
123,414
u615353970
cpp
p02280
#include <cassert> #include <iostream> #include <list> #include <sstream> #include <vector> enum TNodeType { ntRoot, ntInternal, ntLeaf }; template <typename T> class TTree; template <typename T> class TNode { const T FValue; TNode *FParent; TNode *FLeft; TNode *FRight; public: TNode(const T &Value) : FVal...
#include <cassert> #include <iostream> #include <list> #include <sstream> #include <vector> enum TNodeType { ntRoot, ntInternal, ntLeaf }; template <typename T> class TTree; template <typename T> class TNode { const T FValue; TNode *FParent; TNode *FLeft; TNode *FRight; public: TNode(const T &Value) : FVal...
[ "literal.string.change", "expression.operation.binary.change" ]
123,417
123,416
u858711833
cpp
p02280
#include <cstdio> #include <iostream> #define MAX 10000 #define NIL -1 struct Node { int parent; int left; int right; }; Node T[MAX]; int n, D[MAX], H[MAX]; void setDepth(int u, int d) { if (u == NIL) { return; } D[u] = d; setDepth(T[u].left, d + 1); setDepth(T[u].right, d + 1); } int setHeigh...
#include <cstdio> #include <iostream> #define MAX 10000 #define NIL -1 struct Node { int parent; int left; int right; }; Node T[MAX]; int n, D[MAX], H[MAX]; void setDepth(int u, int d) { if (u == NIL) { return; } D[u] = d; setDepth(T[u].left, d + 1); setDepth(T[u].right, d + 1); } int setHeigh...
[ "assignment.value.change", "identifier.change" ]
123,418
123,419
u699373030
cpp
p02280
#include <algorithm> #include <stdio.h> #include <string> #define MAX 100000 #define NIL -1 struct Node { public: int id; int parent; int left; int right; int height; int depth; int sibling; int degree; }; Node N[MAX]; void setDepth(Node &n, int depth) { Node *cur = &n; cur->depth = depth; if ...
#include <algorithm> #include <stdio.h> #include <string> #define MAX 100000 #define NIL -1 struct Node { public: int id; int parent; int left; int right; int height; int depth; int sibling; int degree; }; Node N[MAX]; void setDepth(Node &n, int depth) { Node *cur = &n; cur->depth = depth; if ...
[ "misc.opposites", "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
123,420
123,421
u379744035
cpp