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
p02287
#include <iostream> #include <sstream> #include <string> using namespace std; #define cMaxLimit 260 typedef struct { int key, parent, leftChild, rightChild; } Node; stringstream ans1, ans2; void print(Node node[], int maxNum) { for (int i = 1; i <= maxNum; i++) { ans1 << "node " << i << ": "; ans1 << "key...
#include <iostream> #include <sstream> #include <string> using namespace std; #define cMaxLimit 260 typedef struct { int key, parent, leftChild, rightChild; } Node; stringstream ans1, ans2; void print(Node node[], int maxNum) { for (int i = 1; i <= maxNum; i++) { ans1 << "node " << i << ": "; ans1 << "key...
[ "identifier.change", "io.output.change" ]
125,283
125,284
u398205595
cpp
p02287
#include <stdio.h> #define N 100000 int parent_key(int); int left_key(int); int right_key(int); int main() { int i, n, A[N + 1]; scanf("%d", &n); for (i = 1; i <= n; i++) { scanf("%d", &A[i]); } for (i = 1; i <= n; i++) { printf("node %d: key = %d, ", i, A[i]); if (parent_key(i) >= 1) print...
#include <stdio.h> #define N 100000 int parent_key(int); int left_key(int); int right_key(int); int main() { int i, n, A[N + 1]; scanf("%d", &n); for (i = 1; i <= n; i++) { scanf("%d", &A[i]); } for (i = 1; i <= n; i++) { printf("node %d: key = %d, ", i, A[i]); if (parent_key(i) >= 1) print...
[ "literal.string.change", "call.arguments.change", "io.output.change" ]
125,287
125,288
u780334688
cpp
p02287
#include <bits/stdc++.h> using namespace std; int p(int i) { return i / 2; } int l(int i) { return i * 2; } int r(int i) { return i * 2 + 1; } int main() { int h, a[300]; cin >> h; for (int i = 1; i <= h; i++) cin >> a[i]; for (int i = 1; i <= h; i++) { cout << "node" << i << ": key = " << a[i] << ", ";...
#include <bits/stdc++.h> using namespace std; int p(int i) { return i / 2; } int l(int i) { return i * 2; } int r(int i) { return i * 2 + 1; } int main() { int h, a[300]; cin >> h; for (int i = 1; i <= h; i++) cin >> a[i]; for (int i = 1; i <= h; i++) { cout << "node " << i << ": key = " << a[i] << ", "...
[ "literal.string.change", "io.output.change" ]
125,289
125,290
u212664316
cpp
p02287
#include <stdio.h> #define H 250 int main() { int i, size, a[H]; scanf("%d", &size); for (i = 1; i <= size; i++) scanf("%d", &a[i]); for (i = 1; i <= size; i++) { printf("node %d: key = %d, ", i, a[i]); if (i / 2 >= 1) printf("parent key = %d,", a[i / 2]); if (i * 2 <= size) pri...
#include <stdio.h> #define H 250 int main() { int i, size, a[H]; scanf("%d", &size); for (i = 1; i <= size; i++) scanf("%d", &a[i]); for (i = 1; i <= size; i++) { printf("node %d: key = %d, ", i, a[i]); if (i / 2 >= 1) printf("parent key = %d, ", a[i / 2]); if (i * 2 <= size) p...
[ "literal.string.change", "call.arguments.change", "io.output.change" ]
125,295
125,292
u302016810
cpp
p02287
#include <iostream> #include <vector> using namespace std; struct Node { int key, pk, lk, rk; }; int main() { int n, x; Node temp; vector<int> data; vector<Node> tree; cin >> n; for (int i = 0; i < n; i++) { cin >> x; data.push_back(x); } for (int i = 0; i < n; i++) { temp.key = data[...
#include <iostream> #include <vector> using namespace std; struct Node { int key, pk, lk, rk; }; int main() { int n, x; Node temp; vector<int> data; vector<Node> tree; cin >> n; for (int i = 0; i < n; i++) { cin >> x; data.push_back(x); } for (int i = 0; i < n; i++) { temp.key = data[...
[ "literal.string.change", "io.output.change" ]
125,297
125,298
u237270455
cpp
p02287
#include <iostream> using namespace std; int main() { int a, s[300]; cin >> a; for (int i = 0; i < a; i++) { cin >> s[i]; } for (int i = 0; i < a; i++) { cout << "node " << i << ": key = " << s[i] << ", "; if (i / 2 >= 1) cout << "parent key = " << s[i / 2] << ", "; if (i * 2 <= a) ...
#include <iostream> using namespace std; int main() { int a, s[300]; cin >> a; for (int i = 1; i <= a; i++) { cin >> s[i]; } for (int i = 1; i <= a; i++) { cout << "node " << i << ": key = " << s[i] << ", "; if (i / 2 >= 1) cout << "parent key = " << s[i / 2] << ", "; if (i * 2 <= a) ...
[ "literal.number.change", "variable_declaration.value.change", "control_flow.loop.for.initializer.change", "expression.off_by_one", "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.operation.binary.change" ]
125,301
125,302
u772165802
cpp
p02287
#include <iostream> using namespace std; #define MAX 100000 int Parent(int i) { return i / 2; } int Left(int i) { return 2 * i; } int Right(int i) { return 2 * i + 1; } int main() { int h, A[MAX + 1]; cin >> h; for (int i = 1; i <= h; i++) cin >> A[i]; for (int i = 1; i <= h; i++) { cout << "node " ...
#include <iostream> using namespace std; #define MAX 100000 int Parent(int i) { return i / 2; } int Left(int i) { return 2 * i; } int Right(int i) { return 2 * i + 1; } int main() { int h, A[MAX + 1]; cin >> h; for (int i = 1; i <= h; i++) cin >> A[i]; for (int i = 1; i <= h; i++) { cout << "node " ...
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
125,305
125,304
u563676521
cpp
p02287
#include <cmath> #include <iostream> #include <vector> using namespace std; int main() { int32_t H; cin >> H; vector<int32_t> heap(H); for (int32_t i = 0; i < H; i++) { cin >> heap[i]; } for (int32_t i = 0; i < H; i++) { cout << "node " << (i + 1) << ": "; cout << "key = " << heap[i] << ", "...
#include <cmath> #include <iostream> #include <vector> using namespace std; int main() { int32_t H; cin >> H; vector<int32_t> heap(H); for (int32_t i = 0; i < H; i++) { cin >> heap[i]; } for (int32_t i = 0; i < H; i++) { cout << "node " << (i + 1) << ": "; cout << "key = " << heap[i] << ", "...
[ "literal.number.change", "control_flow.branch.if.condition.change", "variable_access.subscript.index.change", "io.output.change" ]
125,306
125,307
u828599533
cpp
p02287
#include <algorithm> #include <cmath> #include <cstdlib> #include <iostream> #include <stdio.h> #include <string> #include <vector> #define MAX 1000000000000000000LL long long inf = 1000000007; using namespace std; int parent(int i) { return i / 2; } int left(int i) { return 2 * i; } int right(int i) { return 2 * i - ...
#include <algorithm> #include <cmath> #include <cstdlib> #include <iostream> #include <stdio.h> #include <string> #include <vector> #define MAX 1000000000000000000LL long long inf = 1000000007; using namespace std; int parent(int i) { return i / 2; } int left(int i) { return 2 * i; } int right(int i) { return 2 * i + ...
[ "misc.opposites", "expression.operator.arithmetic.change", "function.return_value.change", "expression.operation.binary.change" ]
125,308
125,309
u733596825
cpp
p02287
#include <stdio.h> #define N 2000000 int main() { int n; scanf("%d", &n); int i; int A[N]; for (i = 1; i <= n; i++) { scanf("%d", &A[i]); } for (i = 1; i <= n; i++) { printf("node %d: key = %d, ", i, A[i]); if (i / 2 > 0) printf("parent key = %d, ", A[i / 2]); if (i * 2 < n) ...
#include <stdio.h> #define N 2000000 int main() { int n; scanf("%d", &n); int i; int A[N]; for (i = 1; i <= n; i++) { scanf("%d", &A[i]); } for (i = 1; i <= n; i++) { printf("node %d: key = %d, ", i, A[i]); if (i / 2 > 0) printf("parent key = %d, ", A[i / 2]); if (i * 2 <= n) ...
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
125,310
125,311
u407335067
cpp
p02287
#include <iostream> using namespace std; #define MAX 100000 int parent(int i) { return i / 2; } int left(int i) { return 2 * i; } int right(int i) { return 2 * i + 1; } int main() { int H, i, A[MAX + 1]; cin >> H; for (i = 1; i <= H; i++) { cin >> A[i]; } for (i = 1; i <= H; i++) { cout << "Nod...
#include <iostream> using namespace std; #define MAX 100000 int parent(int i) { return i / 2; } int left(int i) { return 2 * i; } int right(int i) { return 2 * i + 1; } int main() { int H, i, A[MAX + 1]; cin >> H; for (i = 1; i <= H; i++) { cin >> A[i]; } for (i = 1; i <= H; i++) { cout << "nod...
[ "literal.string.change", "literal.string.case.change", "io.output.change" ]
125,312
125,313
u612835288
cpp
p02287
#include <iostream> using namespace std; #define MAX 100000 int parent(int i) { return i / 2; } int left(int i) { return 2 * i; } int right(int i) { return 2 * i + 1; } int main() { int H, i, A[MAX + 1]; cin >> H; for (i = 1; i <= H; i++) { cin >> A[i]; } for (i = 1; i <= H; i++) { cout << "nod...
#include <iostream> using namespace std; #define MAX 100000 int parent(int i) { return i / 2; } int left(int i) { return 2 * i; } int right(int i) { return 2 * i + 1; } int main() { int H, i, A[MAX + 1]; cin >> H; for (i = 1; i <= H; i++) { cin >> A[i]; } for (i = 1; i <= H; i++) { cout << "nod...
[ "literal.string.change", "io.output.change" ]
125,314
125,313
u612835288
cpp
p02287
#include <iostream> using namespace std; #define MAX 100000 int parent(int i) { return i / 2; } int left(int i) { return 2 * i; } int right(int i) { return 2 * i + 1; } int main() { int H, i, A[MAX + 1]; cin >> H; for (i = 1; i <= H; i++) cin >> A[i]; for (i = 1; i < H; i++) { cout << "node" << i <<...
#include <iostream> using namespace std; #define MAX 100000 int parent(int i) { return i / 2; } int left(int i) { return 2 * i; } int right(int i) { return 2 * i + 1; } int main() { int H, i, A[MAX + 1]; cin >> H; for (i = 1; i <= H; i++) cin >> A[i]; for (i = 1; i <= H; i++) { cout << "node " << i ...
[ "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.off_by_one", "expression.operation.binary.change", "literal.string.change", "io.output.change" ]
125,315
125,316
u567212938
cpp
p02287
#include <iostream> using namespace std; #define MAX 100000 int parent(int i) { return i / 2; } int left(int i) { return 2 * i; } int right(int i) { return 2 * i + 1; } int main() { int H, i, A[MAX + 1]; cin >> H; for (i = 1; i <= H; i++) cin >> A[i]; for (i = 1; i < H; i++) { cout << "node " << i <...
#include <iostream> using namespace std; #define MAX 100000 int parent(int i) { return i / 2; } int left(int i) { return 2 * i; } int right(int i) { return 2 * i + 1; } int main() { int H, i, A[MAX + 1]; cin >> H; for (i = 1; i <= H; i++) cin >> A[i]; for (i = 1; i <= H; i++) { cout << "node " << i ...
[ "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.off_by_one", "expression.operation.binary.change" ]
125,317
125,316
u567212938
cpp
p02287
#include <cstdio> #include <iostream> #include <string> using namespace std; #define MAX_H 251 int main() { int h = 0; scanf("%d", &h); int heap[MAX_H] = {0}; for (int i = 1; i <= h; i++) { scanf("%d", &heap[i]); } for (int i = 1; i <= h; i++) { int parent = heap[i / 2]; int left = heap[i * 2]...
#include <cstdio> #include <iostream> #include <string> using namespace std; #define MAX_H 251 int main() { int h = 0; scanf("%d", &h); int heap[MAX_H] = {0}; for (int i = 1; i <= h; i++) { scanf("%d", &heap[i]); } for (int i = 1; i <= h; i++) { int parent = heap[i / 2]; int left = heap[i * 2]...
[ "control_flow.loop.for.condition.change", "control_flow.branch.if.condition.change" ]
125,318
125,319
u873323786
cpp
p02287
/* * Problem Description: Heaps - Complete Binary Tree * Category: * Author: Khan * Date: 17th October, 2017 */ #include <iostream> #define MAXN 100000 using namespace std; int parent(int i) { return i / 2; } int leftChild(int i) { return i * 2; } int rightChild(int i) { return i * 2 + 1; } int main(int argc, ...
/* * Problem Description: Heaps - Complete Binary Tree * Category: * Author: Khan * Date: 17th October, 2017 */ #include <iostream> #define MAXN 100000 using namespace std; int parent(int i) { return i / 2; } int leftChild(int i) { return i * 2; } int rightChild(int i) { return i * 2 + 1; } int main(int argc, ...
[ "literal.string.change", "io.output.change" ]
125,322
125,323
u701472721
cpp
p02287
#include <iostream> using namespace std; const int kMaxN = 100000; int parent(int i) { return i / 2; } int left(int i) { return 2 * i; } int right(int i) { return 2 * i + 1; } int main() { int n; int A[kMaxN]; cin >> n; for (int i = 1; i <= n; i++) { cin >> A[i]; } for (int i = 1; i <= n; i++) {...
#include <iostream> using namespace std; const int kMaxN = 100000; int parent(int i) { return i / 2; } int left(int i) { return 2 * i; } int right(int i) { return 2 * i + 1; } int main() { int n; int A[kMaxN]; cin >> n; for (int i = 1; i <= n; i++) { cin >> A[i]; } for (int i = 1; i <= n; i++) {...
[ "literal.string.change", "io.output.change" ]
125,324
125,325
u538099330
cpp
p02287
#include <iostream> using namespace std; const int kMaxN = 100000; int parent(int i) { return i / 2; } int left(int i) { return 2 * i; } int right(int i) { return 2 * i + 1; } int main() { int n; int A[kMaxN]; cin >> n; for (int i = 1; i <= n; i++) { cin >> A[i]; } for (int i = 1; i <= n; i++) {...
#include <iostream> using namespace std; const int kMaxN = 100000; int parent(int i) { return i / 2; } int left(int i) { return 2 * i; } int right(int i) { return 2 * i + 1; } int main() { int n; int A[kMaxN]; cin >> n; for (int i = 1; i <= n; i++) { cin >> A[i]; } for (int i = 1; i <= n; i++) {...
[ "literal.string.change", "io.output.change" ]
125,326
125,325
u538099330
cpp
p02287
#include <iostream> using namespace std; #define MAX 100000 int parent(int i) { return i / 2; } int left(int i) { return 2 * i; } int right(int i) { return 2 * i + 1; } int main() { int H, i, A[MAX + 1]; // 1をはじめに考える cin >> H; for (int i = 1; i <= H; i++) { cin >> A[i]; } for (int i = 1; i <= H; i++...
#include <iostream> using namespace std; #define MAX 100000 int parent(int i) { return i / 2; } int left(int i) { return 2 * i; } int right(int i) { return 2 * i + 1; } int main() { int H, i, A[MAX + 1]; // 1をはじめに考える cin >> H; for (int i = 1; i <= H; i++) { cin >> A[i]; } for (int i = 1; i <= H; i++...
[ "literal.string.change", "io.output.change" ]
125,331
125,332
u520784163
cpp
p02287
#include <iostream> using namespace std; #define MAX 100000 int parent(int i) { return i / 2; } int left(int i) { return 2 * i; } int right(int i) { return 2 * i + 1; } int main() { int H, i, A[MAX + 1]; // 1をはじめに考える cin >> H; for (int i = 1; i <= H; i++) { cin >> A[i]; } for (int i = 1; i <= H; i++...
#include <iostream> using namespace std; #define MAX 100000 int parent(int i) { return i / 2; } int left(int i) { return 2 * i; } int right(int i) { return 2 * i + 1; } int main() { int H, i, A[MAX + 1]; // 1をはじめに考える cin >> H; for (int i = 1; i <= H; i++) { cin >> A[i]; } for (int i = 1; i <= H; i++...
[ "literal.string.change", "io.output.change" ]
125,333
125,332
u520784163
cpp
p02287
#include <bits/stdc++.h> using namespace std; int parent(int i) { return i / 2; } int left(int i) { return i * 2; } int right(int i) { return i * 2 + 1; } int main() { int H, tree[100001]; scanf("%d", &H); for (int i = 1; i <= H; ++i) { scanf("%d", &tree[i]); } for (int i = 1; i <= H; ++i) { printf(...
#include <bits/stdc++.h> using namespace std; int parent(int i) { return i / 2; } int left(int i) { return i * 2; } int right(int i) { return i * 2 + 1; } int main() { int H, tree[100001]; scanf("%d", &H); for (int i = 1; i <= H; ++i) { scanf("%d", &tree[i]); } for (int i = 1; i <= H; ++i) { printf(...
[ "literal.string.change", "literal.string.case.change", "call.arguments.change", "io.output.change", "identifier.change", "call.function.change" ]
125,334
125,335
u038581274
cpp
p02287
#include <bits/stdc++.h> using namespace std; int parent(int i) { return i / 2; } int left(int i) { return i * 2; } int right(int i) { return i * 2 + 1; } int main() { int H, tree[100001]; scanf("%d", &H); for (int i = 1; i <= H; ++i) { scanf("%d", &tree[i]); } for (int i = 1; i <= H; ++i) { printf(...
#include <bits/stdc++.h> using namespace std; int parent(int i) { return i / 2; } int left(int i) { return i * 2; } int right(int i) { return i * 2 + 1; } int main() { int H, tree[100001]; scanf("%d", &H); for (int i = 1; i <= H; ++i) { scanf("%d", &tree[i]); } for (int i = 1; i <= H; ++i) { printf(...
[ "literal.string.change", "literal.string.case.change", "call.arguments.change", "io.output.change" ]
125,337
125,335
u038581274
cpp
p02287
#include <bits/stdc++.h> using namespace std; int parent(int i) { return i / 2; } int left(int i) { return i * 2; } int right(int i) { return i * 2 + 1; } int main() { int h, tree[100001]; scanf("%d", &h); for (int i = 1; i < h; i++) scanf("%d", &tree[i]); for (int i = 1; i < h; i++) { printf("node %d: ...
#include <bits/stdc++.h> using namespace std; int parent(int i) { return i / 2; } int left(int i) { return i * 2; } int right(int i) { return i * 2 + 1; } int main() { int h, tree[100001]; scanf("%d", &h); for (int i = 1; i <= h; i++) scanf("%d", &tree[i]); for (int i = 1; i <= h; i++) { printf("node %d...
[ "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.off_by_one", "expression.operation.binary.change", "literal.string.change", "call.arguments.change", "io.output.change" ]
125,338
125,339
u229486205
cpp
p02287
#include <bits/stdc++.h> using namespace std; int parent(int i) { return i / 2; } int left(int i) { return i * 2; } int right(int i) { return i * 2 + 1; } int main() { int h, tree[100001]; scanf("%d", &h); for (int i = 1; i <= h; i++) scanf("%d", &tree[i]); for (int i = 1; i <= h; i++) { printf("node %d...
#include <bits/stdc++.h> using namespace std; int parent(int i) { return i / 2; } int left(int i) { return i * 2; } int right(int i) { return i * 2 + 1; } int main() { int h, tree[100001]; scanf("%d", &h); for (int i = 1; i <= h; i++) scanf("%d", &tree[i]); for (int i = 1; i <= h; i++) { printf("node %d...
[ "literal.string.change", "call.arguments.change", "io.output.change" ]
125,340
125,339
u229486205
cpp
p02287
#include <bits/stdc++.h> using namespace std; int parent(int i) { return i / 2; } int left(int i) { return i * 2; } int right(int i) { return i * 2 + 1; } int main() { int H, tree[100001]; scanf("%d", &H); for (int i = 1; i <= H; i++) scanf("%d", &tree[i]); for (int i = 1; i <= H; i++) { cout << "node "...
#include <bits/stdc++.h> using namespace std; int parent(int i) { return i / 2; } int left(int i) { return i * 2; } int right(int i) { return i * 2 + 1; } int main() { int H, tree[100001]; scanf("%d", &H); for (int i = 1; i <= H; i++) scanf("%d", &tree[i]); for (int i = 1; i <= H; i++) { cout << "node "...
[ "literal.string.change", "io.output.change" ]
125,341
125,342
u837197924
cpp
p02287
#include <stdio.h> void check_parent(int i, int a[], int n) { if (i - 1 < 0) return; printf("parent key = %d,", a[(i - 1) / 2]); printf(" "); } void left_key(int i, int a[], int n) { if (i * 2 + 1 >= n) return; printf("left key = %d,", a[i * 2 + 1]); printf(" "); } void right_key(int i, int a[], ...
#include <stdio.h> void check_parent(int i, int a[], int n) { if (i - 1 < 0) return; printf("parent key = %d,", a[(i - 1) / 2]); printf(" "); } void left_key(int i, int a[], int n) { if (i * 2 + 1 >= n) return; printf("left key = %d,", a[i * 2 + 1]); printf(" "); } void right_key(int i, int a[], ...
[ "expression.operation.binary.add" ]
125,349
125,350
u460762955
cpp
p02287
#include <iostream> using namespace std; struct Node { int key; int parent; int left; int right; }; int h; void print(Node t[]) { for (int i = 1; i < h + 1; i++) { cout << "node" << i << ": "; cout << "key = " << t[i].key << ", "; if (t[i].parent != 0) cout << "parent key = " << t[t[i].pa...
#include <iostream> using namespace std; struct Node { int key; int parent; int left; int right; }; int h; void print(Node t[]) { for (int i = 1; i < h + 1; i++) { cout << "node " << i << ": "; cout << "key = " << t[i].key << ", "; if (t[i].parent != 0) cout << "parent key = " << t[t[i].p...
[ "literal.string.change", "io.output.change" ]
125,351
125,352
u279219044
cpp
p02287
#include <iostream> using namespace std; #define MAX 100000 int parent(int i) { return i / 2; } int left(int i) { return 2 * i; } int right(int i) { return 2 * i + 1; } int main() { int H, i, A[MAX + 1]; cin >> H; for (i = 0; i <= H; i++) cin >> A[i]; for (i = 0; i <= H; i++) { cout << "node" << ...
#include <iostream> using namespace std; #define MAX 100000 int parent(int i) { return i / 2; } int left(int i) { return 2 * i; } int right(int i) { return (2 * i + 1); } int main() { int H, i, A[MAX + 1]; cin >> H; for (i = 1; i <= H; i++) cin >> A[i]; for (i = 1; i <= H; i++) { cout << "node " ...
[ "function.return_value.change", "literal.number.change", "assignment.value.change", "control_flow.loop.for.initializer.change", "expression.off_by_one", "literal.string.change", "io.output.change", "misc.opposites", "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
125,358
125,359
u936175119
cpp
p02287
#include <iostream> using namespace std; #define MAX 100000 int parent(int i) { return i / 2; } int left(int i) { return 2 * i; } int right(int i) { return 2 * i + 1; } int main() { int H, i, A[MAX + 1]; cin >> H; for (i = 0; i <= H; i++) cin >> A[i]; for (i = 0; i <= H; i++) { cout << "node" << ...
#include <iostream> using namespace std; #define MAX 100000 int parent(int i) { return i / 2; } int left(int i) { return 2 * i; } int right(int i) { return (2 * i + 1); } int main() { int H, i, A[MAX + 1]; cin >> H; for (i = 1; i <= H; i++) cin >> A[i]; for (i = 1; i <= H; i++) { cout << "node " ...
[ "function.return_value.change", "literal.number.change", "assignment.value.change", "control_flow.loop.for.initializer.change", "expression.off_by_one", "literal.string.change", "io.output.change" ]
125,360
125,359
u936175119
cpp
p02287
#include <iostream> using namespace std; #define MAX 100000 int parent(int i) { return i / 2; } int left(int i) { return 2 * i; } int right(int i) { return 2 * i + 1; } int main() { int H, i, A[MAX + 1]; cin >> H; for (i = 0; i <= H; i++) cin >> A[i]; for (i = 0; i <= H; i++) { cout << "node " <<...
#include <iostream> using namespace std; #define MAX 100000 int parent(int i) { return i / 2; } int left(int i) { return 2 * i; } int right(int i) { return (2 * i + 1); } int main() { int H, i, A[MAX + 1]; cin >> H; for (i = 1; i <= H; i++) cin >> A[i]; for (i = 1; i <= H; i++) { cout << "node " ...
[ "function.return_value.change", "literal.number.change", "assignment.value.change", "control_flow.loop.for.initializer.change", "expression.off_by_one" ]
125,361
125,359
u936175119
cpp
p02287
#include <iostream> using namespace std; #define MAX 100000 int parent(int i) { return i / 2; } int left(int i) { return 2 * i; } int right(int i) { return 2 * i + 1; } int main() { int H, i, A[MAX + 1]; // 1-オリジンのため +1 する cin >> H; for (i = 1; i <= H; i++) cin >> A[i]; for (i = 1; i <= H; i++) { co...
#include <iostream> using namespace std; #define MAX 100000 int parent(int i) { return i / 2; } int left(int i) { return 2 * i; } int right(int i) { return 2 * i + 1; } int main() { int H, i, A[MAX + 1]; // 1-オリジンのため +1 する cin >> H; for (i = 1; i <= H; i++) cin >> A[i]; for (i = 1; i <= H; i++) { co...
[ "literal.string.change", "io.output.change", "identifier.change", "call.function.change", "control_flow.branch.if.condition.change" ]
125,362
125,363
u150984829
cpp
p02287
#include <iostream> using namespace std; #define MAX 100000 int parent(int i) { return i / 2; } int left(int i) { return 2 * i; } int right(int i) { return 2 * i + 1; } int main() { int H, i, A[MAX + 1]; // 1-オリジンのため +1 する cin >> H; for (i = 1; i <= H; i++) cin >> A[i]; for (i = 1; i <= H; i++) { co...
#include <iostream> using namespace std; #define MAX 100000 int parent(int i) { return i / 2; } int left(int i) { return 2 * i; } int right(int i) { return 2 * i + 1; } int main() { int H, i, A[MAX + 1]; // 1-オリジンのため +1 する cin >> H; for (i = 1; i <= H; i++) cin >> A[i]; for (i = 1; i <= H; i++) { co...
[ "identifier.change", "call.function.change", "control_flow.branch.if.condition.change" ]
125,364
125,363
u150984829
cpp
p02287
#include <iostream> using namespace std; #define MAX 100000 int parent(int i) { return i / 2; } int left(int i) { return 2 * i; } int right(int i) { return 2 * i + 1; } int main() { int H, i, A[MAX + 1]; // 1-オリジンのため +1 する cin >> H; for (i = 1; i <= H; i++) cin >> A[i]; for (i = 1; i <= H; i++) { co...
#include <iostream> using namespace std; #define MAX 100000 int parent(int i) { return i / 2; } int left(int i) { return 2 * i; } int right(int i) { return 2 * i + 1; } int main() { int H, i, A[MAX + 1]; // 1-オリジンのため +1 する cin >> H; for (i = 1; i <= H; i++) cin >> A[i]; for (i = 1; i <= H; i++) { co...
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change", "identifier.change", "call.function.change" ]
125,365
125,363
u150984829
cpp
p02287
#include <cstdio> #include <iostream> #define MAX 100000 using namespace std; int parent(int i) { return i / 2; } int left(int i) { return 2 * i; } int right(int i) { return 2 * i + 1; } int main() { int H, i, a[MAX + 1]; cin >> H; for (int i = 1; i <= H; i++) cin >> a[i]; for (int i = 1; i < H; i++) { ...
#include <cstdio> #include <iostream> #define MAX 100000 using namespace std; int parent(int i) { return i / 2; } int left(int i) { return 2 * i; } int right(int i) { return 2 * i + 1; } int main() { int H, i, a[MAX + 1]; cin >> H; for (i = 1; i <= H; i++) cin >> a[i]; for (i = 1; i <= H; i++) { cout <<...
[ "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.off_by_one", "expression.operation.binary.change", "literal.string.change", "io.output.change" ]
125,373
125,374
u796290719
cpp
p02287
#include <cstdio> #include <iostream> #define MAX 100000 using namespace std; int parent(int i) { return i / 2; } int left(int i) { return 2 * i; } int right(int i) { return 2 * i + 1; } int main() { int H, i, a[MAX + 1]; cin >> H; for (i = 1; i <= H; i++) cin >> a[i]; for (i = 1; i < H; i++) { cout << ...
#include <cstdio> #include <iostream> #define MAX 100000 using namespace std; int parent(int i) { return i / 2; } int left(int i) { return 2 * i; } int right(int i) { return 2 * i + 1; } int main() { int H, i, a[MAX + 1]; cin >> H; for (i = 1; i <= H; i++) cin >> a[i]; for (i = 1; i <= H; i++) { cout <<...
[ "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.off_by_one", "expression.operation.binary.change", "literal.string.change", "io.output.change" ]
125,376
125,374
u796290719
cpp
p02287
#include <cstdio> #include <iostream> #define MAX 100000 using namespace std; int parent(int i) { return i / 2; } int left(int i) { return 2 * i; } int right(int i) { return 2 * i + 1; } int main() { int H, i, a[MAX + 1]; cin >> H; for (i = 1; i <= H; i++) cin >> a[i]; for (i = 1; i <= H; i++) { cout <<...
#include <cstdio> #include <iostream> #define MAX 100000 using namespace std; int parent(int i) { return i / 2; } int left(int i) { return 2 * i; } int right(int i) { return 2 * i + 1; } int main() { int H, i, a[MAX + 1]; cin >> H; for (i = 1; i <= H; i++) cin >> a[i]; for (i = 1; i <= H; i++) { cout <<...
[ "literal.string.change", "io.output.change" ]
125,377
125,374
u796290719
cpp
p02287
#include <cstdio> #include <iostream> using namespace std; int N; int A[300]; int parent(int i) { return i / 2; } int leftchild(int i) { return 2 * i; } int rightchild(int i) { return 2 * i + 1; } int main() { cin >> N; for (int i = 1; i <= N; i++) { cin >> A[i]; } for (int i = 1; i <= N; i++) { int p...
#include <cstdio> #include <iostream> using namespace std; int N; int A[300]; int parent(int i) { return i / 2; } int leftchild(int i) { return 2 * i; } int rightchild(int i) { return 2 * i + 1; } int main() { cin >> N; for (int i = 1; i <= N; i++) { cin >> A[i]; } for (int i = 1; i <= N; i++) { int p...
[ "literal.string.change", "io.output.change" ]
125,378
125,379
u356390697
cpp
p02287
#include <algorithm> #include <stdio.h> using namespace std; #define NIL -1 #define MAX 250 int A[MAX]; void printHeap(int n) { for (int i = 0; i < n; i++) { printf("node %d: key = %d, ", i + 1, A[i]); if (i + 1 != 1) { printf("parent key = %d, ", A[(i + 1) / 2 - 1]); } if (A[2 * (i + 1) - 1] ...
#include <algorithm> #include <stdio.h> using namespace std; #define NIL -2000000001 #define MAX 250 int A[MAX]; void printHeap(int n) { for (int i = 0; i < n; i++) { printf("node %d: key = %d, ", i + 1, A[i]); if (i + 1 != 1) { printf("parent key = %d, ", A[(i + 1) / 2 - 1]); } if (A[2 * (i +...
[ "preprocessor.define.value.change", "literal.integer.change", "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
125,383
125,384
u683313189
cpp
p02287
// 2分ヒープ #include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <stack> #include <vector> using namespace std; #define MAX_H 250 const int INV = -2147483645; int main(void) { int H, node, parent, left, right; int ary_BinaryHeap[MAX_H + 1]; fo...
// 2分ヒープ #include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <stack> #include <vector> using namespace std; #define MAX_H 250 const int INV = -2147483645; int main(void) { int H, node, parent, left, right; int ary_BinaryHeap[MAX_H + 1]; fo...
[ "assignment.value.change", "identifier.change", "expression.operation.binary.change" ]
125,386
125,387
u444487239
cpp
p02287
#include <cstdio> int main() { int n; scanf("%d", &n); int heap[n + 1]; for (int i = 1; i <= n; ++i) scanf("%d", &heap[i]); for (int i = 1; i <= n; ++i) { printf("node %d: ", i); printf("key = %d, ", heap[i]); if (i > 1) printf("parent key = %d: ", heap[i / 2]); if (2 * i <= n) ...
#include <cstdio> int main() { int n; scanf("%d", &n); int heap[n + 1]; for (int i = 1; i <= n; ++i) scanf("%d", &heap[i]); for (int i = 1; i <= n; ++i) { printf("node %d: ", i); printf("key = %d, ", heap[i]); if (i > 1) printf("parent key = %d, ", heap[i / 2]); if (2 * i <= n) ...
[ "literal.string.change", "call.arguments.change", "io.output.change" ]
125,388
125,389
u780661189
cpp
p02287
/* * ALDS1_9_A.cpp * * Created on: May 5, 2018 * Author: 13743 */ #include <iostream> using namespace std; int main() { int n; int T[251]; cin >> n; for (int i = 0; i < n; i++) { cin >> T[i + 1]; } for (int i = 1; i <= n; i++) { cout << "node " << i << " key = " << T[i] << ", "; ...
/* * ALDS1_9_A.cpp * * Created on: May 5, 2018 * Author: 13743 */ #include <iostream> using namespace std; int main() { int n; int T[251]; cin >> n; for (int i = 0; i < n; i++) { cin >> T[i + 1]; } for (int i = 1; i <= n; i++) { cout << "node " << i << ": key = " << T[i] << ", "; ...
[ "literal.string.change", "io.output.change" ]
125,392
125,393
u115352705
cpp
p02287
#include <iostream> using namespace std; #define MAX 100000 int parent(int i) { return i / 2; } int left(int i) { return 2 * i; } int right(int i) { return 2 * i + 1; } int main() { int H; int A[MAX + 1]; cin >> H; for (int i = 1; i <= H; i++) { cin >> A[i]; } for (int i = 1; i <= H; i++) { co...
#include <iostream> using namespace std; #define MAX 100000 int parent(int i) { return i / 2; } int left(int i) { return 2 * i; } int right(int i) { return 2 * i + 1; } int main() { int H; int A[MAX + 1]; cin >> H; for (int i = 1; i <= H; i++) { cin >> A[i]; } for (int i = 1; i <= H; i++) { co...
[ "literal.string.change", "io.output.change" ]
125,396
125,397
u626935725
cpp
p02287
#include <iostream> using namespace std; #define MAX 100000 int parent(int i) { return i / 2; } int left(int i) { return 2 * i; } int right(int i) { return 2 * i + 1; } int main() { int H; int A[MAX + 1]; cin >> H; for (int i = 1; i <= H; i++) { cin >> A[i]; } for (int i = 1; i <= H; i++) { co...
#include <iostream> using namespace std; #define MAX 100000 int parent(int i) { return i / 2; } int left(int i) { return 2 * i; } int right(int i) { return 2 * i + 1; } int main() { int H; int A[MAX + 1]; cin >> H; for (int i = 1; i <= H; i++) { cin >> A[i]; } for (int i = 1; i <= H; i++) { co...
[ "literal.string.change", "io.output.change" ]
125,398
125,397
u626935725
cpp
p02287
#include <iostream> #include <map> #include <set> #include <string> using namespace std; #define MAX 100000 int parent(int i) { return i / 2; } int left(int i) { return i * 2; } int right(int i) { return i * 2 + 1; } int main() { int H, i, A[MAX + 1]; cin >> H; for (int i = 1; i <= H; i++) { cin >> A[i]; ...
#include <iostream> #include <map> #include <set> #include <string> using namespace std; #define MAX 100000 int parent(int i) { return i / 2; } int left(int i) { return i * 2; } int right(int i) { return i * 2 + 1; } int main() { int H, i, A[MAX + 1]; cin >> H; for (int i = 1; i <= H; i++) { cin >> A[i]; ...
[ "literal.string.change", "io.output.change" ]
125,401
125,402
u721251852
cpp
p02287
#include <cstdio> #include <cstdlib> #include <iostream> using namespace std; #define N 400 #define NIL -2100000000 int key[N]; int parent(int i) { return i / 2; } int leftc(int i) { return 2 * i; } int rightc(int i) { return 2 * i + 1; } int main() { int n, data; scanf("%d", &n); for (int i = 0; i < N; i++...
#include <cstdio> #include <cstdlib> #include <iostream> using namespace std; #define N 600 #define NIL -2100000000 int key[N]; int parent(int i) { return i / 2; } int leftc(int i) { return 2 * i; } int rightc(int i) { return 2 * i + 1; } int main() { int n, data; scanf("%d", &n); for (int i = 0; i < N; i++...
[ "preprocessor.define.value.change", "literal.integer.change", "literal.string.change", "call.arguments.change", "io.output.change" ]
125,405
125,404
u575882803
cpp
p02287
#include <algorithm> // require sort next_permutation count __gcd reverse etc. #include <cctype> // require tolower, toupper #include <cfloat> #include <climits> #include <cmath> // require fabs #include <cstdio> // require scanf printf #include <cstdlib> // require abs exit atof atoi #include <cstring> // requir...
#include <algorithm> // require sort next_permutation count __gcd reverse etc. #include <cctype> // require tolower, toupper #include <cfloat> #include <climits> #include <cmath> // require fabs #include <cstdio> // require scanf printf #include <cstdlib> // require abs exit atof atoi #include <cstring> // requir...
[ "literal.string.change", "call.arguments.change", "io.output.change" ]
125,410
125,411
u597396610
cpp
p02288
#include <cstdio> #include <iostream> using namespace std; #define left(x) (2 * (x) + 1) #define right(x) (2 * (x) + 2) void maxHeapify(int *heap, int i, int last_index) { int l = left(i); int r = right(i); int largest = i; if (l <= last_index && heap[l] > heap[largest]) largest = l; if (r <= last_ind...
#include <cstdio> #include <iostream> using namespace std; #define left(x) (2 * (x) + 1) #define right(x) (2 * (x) + 2) void maxHeapify(int *heap, int i, int last_index) { int l = left(i); int r = right(i); int largest = i; if (l <= last_index && heap[l] > heap[largest]) largest = l; if (r <= last_ind...
[ "expression.operation.binary.add" ]
125,771
125,772
u881491942
cpp
p02288
#include <iostream> using namespace std; int A[500001], n; void maxHeapify(int i) { int l, r, largest, tmp; l = i * 2; r = i * 2 + 1; if (l <= n && A[l] > A[i]) largest = l; else largest = i; if (r <= n && A[r] > A[largest]) largest = r; if (largest != i) { tmp = A[i], A[i] = A[largest]...
#include <iostream> using namespace std; int A[500001], n; void maxHeapify(int i) { int l, r, largest, tmp; l = i * 2; r = i * 2 + 1; if (l <= n && A[l] > A[i]) largest = l; else largest = i; if (r <= n && A[r] > A[largest]) largest = r; if (largest != i) { tmp = A[i], A[i] = A[largest]...
[ "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.off_by_one", "expression.operation.binary.change" ]
125,794
125,795
u849340810
cpp
p02288
#include <iostream> using namespace std; int A[500001], n; void maxHeapify(int i) { int l, r, largest, tmp; l = i * 2; r = i * 2 + 1; if (l <= n && A[l] > A[i]) largest = l; else largest = i; if (r <= n && A[r] > A[largest]) largest = r; if (largest != i) { tmp = A[i], A[i] = A[largest]...
#include <iostream> using namespace std; int A[500001], n; void maxHeapify(int i) { int l, r, largest, tmp; l = i * 2; r = i * 2 + 1; if (l <= n && A[l] > A[i]) largest = l; else largest = i; if (r <= n && A[r] > A[largest]) largest = r; if (largest != i) { tmp = A[i], A[i] = A[largest]...
[ "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.off_by_one", "expression.operation.binary.change" ]
125,796
125,795
u849340810
cpp
p02288
#include <iostream> using namespace std; const int MAX = 500000; int A[MAX + 1]; int H; void maxHeapify(int i) { int largest; int l = i * 2; int r = i * 2 + 1; if (i <= H && A[l] > A[i]) { largest = l; } else { largest = i; } if (i <= H && A[r] > A[largest]) largest = r; if (largest != i...
#include <iostream> using namespace std; const int MAX = 500000; int A[MAX + 1]; int H; void maxHeapify(int i) { int largest; int l = i * 2; int r = i * 2 + 1; if (l <= H && A[l] > A[i]) { largest = l; } else { largest = i; } if (r <= H && A[r] > A[largest]) largest = r; if (largest != i...
[ "identifier.change", "control_flow.branch.if.condition.change" ]
125,816
125,817
u531736422
cpp
p02288
#include <iostream> using namespace std; #define MAX 2000000 int H, A[MAX + 1]; void maxHeapify(int i) { int l, r, largest; l = 2 * i; r = 2 * i + 1; //????????????????????????????????????????????????????????§????????? if (l <= H && A[l] > A[i]) largest = l; else largest = i; if (r < H && A[r] ...
#include <iostream> using namespace std; #define MAX 2000000 int H, A[MAX + 1]; void maxHeapify(int i) { int l, r, largest; l = 2 * i; r = 2 * i + 1; //????????????????????????????????????????????????????????§????????? if (l <= H && A[l] > A[i]) largest = l; else largest = i; if (r <= H && A[r]...
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change", "control_flow.loop.for.condition.change", "expression.off_by_one", "expression.operation.binary.change" ]
125,824
125,825
u167064764
cpp
p02288
#include <iostream> using namespace std; #define MAX 2000000 int H, A[MAX + 1]; void maxHeapify(int i) { int l, r, largest; l = 2 * i; r = 2 * i + 1; //????????????????????????????????????????????????????????§????????? if (l <= H && A[l] > A[i]) largest = l; else largest = i; if (r <= H && A[r]...
#include <iostream> using namespace std; #define MAX 2000000 int H, A[MAX + 1]; void maxHeapify(int i) { int l, r, largest; l = 2 * i; r = 2 * i + 1; //????????????????????????????????????????????????????????§????????? if (l <= H && A[l] > A[i]) largest = l; else largest = i; if (r <= H && A[r]...
[ "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.off_by_one", "expression.operation.binary.change" ]
125,826
125,825
u167064764
cpp
p02288
#include <iostream> using namespace std; #define MAX 500005 int H, A[MAX + 1]; void maxHeap(int i) { int l, r, large; l = 2 * i; r = 2 * i + 1; if (l <= H && A[l] > A[i]) { large = l; } else { large = i; } if (r <= H && A[r] > A[i]) { large = r; } if (large != i) { swap(A[large], A[...
#include <iostream> using namespace std; #define MAX 500005 int H, A[MAX + 1]; void maxHeap(int i) { int l, r, large; l = 2 * i; r = 2 * i + 1; if (l <= H && A[l] > A[i]) { large = l; } else { large = i; } if (r <= H && A[r] > A[large]) { large = r; } if (large != i) { swap(A[large]...
[ "identifier.change", "variable_access.subscript.index.change", "control_flow.branch.if.condition.change" ]
125,827
125,828
u967088297
cpp
p02288
#include <stdio.h> #define MAX 500000 int N; int H[MAX]; int getLeft(int i) { return 2 * i + 1; } int getRight(int i) { return 2 * i + 2; } int getParent(int i) { return (i - 1) / 2; } void swap(int i, int j) { int temp = H[i]; H[i] = H[j]; H[j] = temp; } void heapify(int i) { while (i < N) { int max_idx ...
#include <stdio.h> #define MAX 500000 int N; int H[MAX]; int getLeft(int i) { return 2 * i + 1; } int getRight(int i) { return 2 * i + 2; } int getParent(int i) { return (i - 1) / 2; } void swap(int i, int j) { int temp = H[i]; H[i] = H[j]; H[j] = temp; } void heapify(int i) { while (i < N) { int max_idx ...
[ "literal.string.change", "call.arguments.change", "io.output.change" ]
125,834
125,833
u418791871
cpp
p02288
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < n; i++) #define REPP(i, n) for (int i = 1; i < n; i++) #define REPR(i, n) for (int i = n; i >= 1; i--) #define IFY 2000000000 #define MAX 500000 #define NIL -1 using namespace std; int H, A[MAX + 1]; void maxheapify(int i) { int l, r, largest; l = 2 * i...
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < n; i++) #define REPP(i, n) for (int i = 1; i <= n; i++) #define REPR(i, n) for (int i = n; i >= 1; i--) #define IFY 2000000000 #define MAX 500000 #define NIL -1 using namespace std; int H, A[MAX + 1]; void maxheapify(int i) { int l, r, largest; l = 2 * ...
[ "expression.operator.compare.change", "preprocessor.define.value.change" ]
125,867
125,868
u253376705
cpp
p02288
#include <bits/stdc++.h> using namespace std; int H, A[500001] = {}; void mh(int i) { int l = i * 2, r = i * 2 + 1, lar = i; if (A[l] > A[i] && l <= H) lar = l; if (A[r] > A[lar && r <= H]) lar = r; if (lar != i) { swap(A[lar], A[i]); mh(lar); } } int main() { cin >> H; for (int i = 1; ...
#include <bits/stdc++.h> using namespace std; int H, A[5000001] = {}; void mh(int i) { int l = i * 2, r = i * 2 + 1, lar = i; if (A[l] > A[i] && l <= H) lar = l; if (A[r] > A[lar] && r <= H) lar = r; if (lar != i) { swap(A[lar], A[i]); mh(lar); } } int main() { cin >> H; for (int i = 1;...
[ "literal.number.change", "variable_declaration.array_dimensions.change", "control_flow.branch.if.condition.change" ]
125,869
125,870
u278641778
cpp
p02288
#include <iostream> using namespace std; int H, A[500001]; void heapfy(int i) { int l, r; l = i * 2 + 1; r = i * 2 + 2; int i_ = i; if (l < H && A[l] > A[i_]) i_ = l; if (r < H && A[r] > A[i_]) i_ = r; if (i_ != i) { int tmp = A[i]; A[i] = A[i_]; A[i_] = tmp; heapfy(i_); } ...
#include <iostream> using namespace std; int H, A[500001]; void heapfy(int i) { int l, r; l = i * 2 + 1; r = i * 2 + 2; int i_ = i; if (l < H && A[l] > A[i_]) i_ = l; if (r < H && A[r] > A[i_]) i_ = r; if (i_ != i) { int tmp = A[i]; A[i] = A[i_]; A[i_] = tmp; heapfy(i_); } ...
[ "literal.number.change", "variable_declaration.value.change", "control_flow.loop.for.initializer.change", "expression.off_by_one" ]
125,886
125,887
u759934006
cpp
p02288
#include <iostream> using namespace std; #define MAX 2000000 int gHeap[MAX + 1], gSize; void maxHeapify(int i) { int left, right, largest; left = 2 * i; right = 2 * i + 1; // 左の子、自分、右の子で値が最大のノードを選択 if (left <= gSize && gHeap[left] > gHeap[i]) { largest = left; } else { largest = i; } // 右の子と比...
#include <iostream> using namespace std; #define MAX 2000000 int gHeap[MAX + 1], gSize; void maxHeapify(int i) { int left, right, largest; left = 2 * i; right = 2 * i + 1; // 左の子、自分、右の子で値が最大のノードを選択 if (left <= gSize && gHeap[left] > gHeap[i]) { largest = left; } else { largest = i; } // 右の子と比...
[ "misc.opposites", "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.operation.binary.change" ]
125,888
125,889
u630911389
cpp
p02288
#include <iostream> using namespace std; #define MAX 2000000 int H; int A[MAX + 1]; void maxHeapify(int i) { int largest, right, left; left = 2 * i; right = 2 * i + 1; if (left <= H && A[left] > A[i]) largest = left; else largest = i; if (right <= H && A[right] > A[i]) largest = right; if (...
#include <iostream> using namespace std; #define MAX 2000000 int H; int A[MAX + 1]; void maxHeapify(int i) { int largest, right, left; left = 2 * i; right = 2 * i + 1; if (left <= H && A[left] > A[i]) largest = left; else largest = i; if (right <= H && A[right] > A[largest]) largest = right; ...
[ "identifier.change", "variable_access.subscript.index.change", "control_flow.branch.if.condition.change" ]
125,894
125,895
u556014061
cpp
p02288
#include <cstdio> #include <iostream> #define MAX 2000000 using namespace std; int H, a[MAX + 1]; void max(int i) { int l, r, large; l = 2 * i; r = 2 * i + 1; if (l <= H && a[l] < a[i]) large = 1; else large = i; if (r <= H && a[r] > a[large]) large = r; if (large != i) swap(a[i], a[large]...
#include <cstdio> #include <iostream> #define MAX 2000000 using namespace std; int H, a[MAX + 1]; void max(int i) { int l, r, large; l = 2 * i; r = 2 * i + 1; if (l <= H && a[l] > a[i]) large = l; else large = i; if (r <= H && a[r] > a[large]) large = r; if (large != i) { swap(a[i], a[larg...
[ "misc.opposites", "expression.operator.compare.change", "control_flow.branch.if.condition.change", "assignment.value.change", "identifier.replace.add", "literal.replace.remove" ]
125,898
125,899
u796290719
cpp
p02288
#include <cstdio> #include <iostream> #define MAX 2000000 using namespace std; int H, a[MAX + 1]; void max(int i) { int l, r, large; l = 2 * i; r = 2 * i + 1; if (l <= H && a[l] < a[i]) large = 1; else large = i; if (r <= H && a[r] > a[large]) large = r; if (large != i) { swap(a[i], a[larg...
#include <cstdio> #include <iostream> #define MAX 2000000 using namespace std; int H, a[MAX + 1]; void max(int i) { int l, r, large; l = 2 * i; r = 2 * i + 1; if (l <= H && a[l] > a[i]) large = l; else large = i; if (r <= H && a[r] > a[large]) large = r; if (large != i) { swap(a[i], a[larg...
[ "misc.opposites", "expression.operator.compare.change", "control_flow.branch.if.condition.change", "assignment.value.change", "identifier.replace.add", "literal.replace.remove" ]
125,900
125,899
u796290719
cpp
p02288
#include <cstdio> #include <iostream> #define MAX 2000000 using namespace std; int H, a[MAX + 1]; void max(int i) { int l, r, large; l = 2 * i; r = 2 * i + 1; if (l <= H && a[l] > a[i]) large = 1; else large = i; if (r <= H && a[r] > a[large]) large = r; if (large != i) { swap(a[i], a[larg...
#include <cstdio> #include <iostream> #define MAX 2000000 using namespace std; int H, a[MAX + 1]; void max(int i) { int l, r, large; l = 2 * i; r = 2 * i + 1; if (l <= H && a[l] > a[i]) large = l; else large = i; if (r <= H && a[r] > a[large]) large = r; if (large != i) { swap(a[i], a[larg...
[ "assignment.value.change", "identifier.replace.add", "literal.replace.remove" ]
125,901
125,899
u796290719
cpp
p02288
#include <iostream> using namespace std; #define MAX 2000000 int H, A[MAX + 1]; void maxHeapify(int i) { int l, r, target; l = 2 * i; r = 2 * i + 1; //从左子节点,自身,右子节点中选出最大的节点值 if (l <= H && A[l] > A[i]) target = l; else target = i; if (r <= H && A[i] < A[r]) target = r; if (target != i...
#include <iostream> using namespace std; #define MAX 2000000 int H, A[MAX + 1]; void maxHeapify(int i) { int l, r, target; l = 2 * i; r = 2 * i + 1; //从左子节点,自身,右子节点中选出最大的节点值 if (l <= H && A[l] > A[i]) target = l; else target = i; if (r <= H && A[target] < A[r]) target = r; if (target...
[ "identifier.change", "variable_access.subscript.index.change", "control_flow.branch.if.condition.change" ]
126,342
126,343
u633823896
cpp
p02288
#include <algorithm> #include <cstdio> #include <iostream> using namespace std; const int maxx = 500100; int A[maxx]; int n; void max_heap(int i) { int left = 2 * i, right = left + 1, x; if (left <= n && A[left] > A[i]) x = left; else x = i; if (right <= n && A[right] > A[i]) x = right; if (x != ...
#include <algorithm> #include <cstdio> #include <iostream> using namespace std; const int maxx = 500100; int A[maxx]; int n; void max_heap(int i) { int left = 2 * i, right = 2 * i + 1, x; if (left <= n && A[left] > A[i]) x = left; else x = i; if (right <= n && A[right] > A[x]) x = right; if (x !=...
[ "identifier.replace.remove", "literal.replace.add", "expression.operation.binary.change", "identifier.change", "variable_access.subscript.index.change", "control_flow.branch.if.condition.change" ]
126,346
126,347
u347577008
cpp
p02281
#include <bits/stdc++.h> using namespace std; #define MAX 25 #define NIL -1 struct node { int parent, left, right; }; node T[MAX]; int n, D[MAX], H[MAX]; void insert() { int i; for (i = 0; i < n; i++) T[i].parent = T[i].left = T[i].right = NIL; for (i = 0; i < n; i++) { int id; scanf("%d", &id...
#include <bits/stdc++.h> using namespace std; #define MAX 25 #define NIL -1 struct node { int parent, left, right; }; node T[MAX]; int n, D[MAX], H[MAX]; void insert() { int i; for (i = 0; i < n; i++) T[i].parent = T[i].left = T[i].right = NIL; for (i = 0; i < n; i++) { int id; scanf("%d", &id...
[ "literal.string.change", "call.arguments.change", "io.output.change" ]
126,419
126,420
u100370736
cpp
p02281
#include <iostream> #include <stdio.h> #include <stdlib.h> #define MAX 100000 #define NIL -1 using namespace std; typedef struct { int right; int left; int parent; } Node; Node T[MAX]; void inorder(int x) { if (x == NIL) return; inorder(T[x].left); cout << " " << x; inorder(T[x].right); } void pr...
#include <iostream> #include <stdio.h> #include <stdlib.h> #define MAX 100000 #define NIL -1 using namespace std; typedef struct { int right; int left; int parent; } Node; Node T[MAX]; void inorder(int x) { if (x == NIL) return; inorder(T[x].left); cout << " " << x; inorder(T[x].right); } void pr...
[ "literal.string.change", "io.output.change" ]
126,423
126,424
u597704605
cpp
p02281
#include <iostream> using ll = long long; using namespace std; /* initialize */ struct Node { int p, l, r; }; struct Node T[10000]; int n; void preorder(int v) { if (v == -1) return; printf(" %d", v); preorder(T[v].l); preorder(T[v].r); }; void inorder(int v) { if (v == -1) return; inorder(T[v]....
#include <iostream> using ll = long long; using namespace std; /* initialize */ struct Node { int p, l, r; }; struct Node T[10000]; int n; void preorder(int v) { if (v == -1) return; printf(" %d", v); preorder(T[v].l); preorder(T[v].r); }; void inorder(int v) { if (v == -1) return; inorder(T[v]....
[ "literal.string.change", "call.arguments.change", "io.output.change" ]
126,426
126,427
u905313459
cpp
p02281
#include <stdio.h> #define MAX 10000 #define NIL -1 struct Node { int p, l, r; }; struct Node T[MAX]; int n; void preParse(int u) { if (u == NIL) return; printf("%d", u); preParse(T[u].l); preParse(T[u].r); } void inParse(int u) { if (u == NIL) return; inParse(T[u].l); printf(" %d", u); inPars...
#include <stdio.h> #define MAX 10000 #define NIL -1 struct Node { int p, l, r; }; struct Node T[MAX]; int n; void preParse(int u) { if (u == NIL) return; printf(" %d", u); preParse(T[u].l); preParse(T[u].r); } void inParse(int u) { if (u == NIL) return; inParse(T[u].l); printf(" %d", u); inPar...
[ "literal.string.change", "call.arguments.change", "io.output.change" ]
126,429
126,430
u011621222
cpp
p02281
#include <stdio.h> #define MAX 10000 #define NIL -1 struct Node { int p, l, r; }; struct Node T[MAX]; int n; void preParse(int u) { if (u == NIL) return; printf("%d", u); preParse(T[u].l); preParse(T[u].r); } void inParse(int u) { if (u == NIL) return; inParse(T[u].l); printf(" %d", u); inPars...
#include <cstdio> #define MAX 10000 #define NIL -1 struct Node { int p, l, r; }; struct Node T[MAX]; int n; void preParse(int u) { if (u == NIL) return; printf(" %d", u); preParse(T[u].l); preParse(T[u].r); } void inParse(int u) { if (u == NIL) return; inParse(T[u].l); printf(" %d", u); inPars...
[ "literal.string.change", "call.arguments.change", "io.output.change" ]
126,429
126,436
u011621222
cpp
p02281
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> using namespace std; typedef long long ll; typedef unsigned long long ull; const int MAX_N = 100000; const int INF = 0x3f3f3f3f; #define maxn...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> using namespace std; typedef long long ll; typedef unsigned long long ull; const int MAX_N = 100000; const int INF = 0x3f3f3f3f; #define maxn...
[ "literal.string.change", "literal.string.case.change", "io.output.change" ]
126,437
126,438
u011621222
cpp
p02281
#include <stdio.h> #define MAX 10000 #define NIL -1 struct Node { int p, l, r; }; struct Node T[MAX]; int n; //先行順巡回// void preParse(int u) { if (u == NIL) return; printf(" %d", u); preParse(T[u].l); preParse(T[u].r); } //中間巡回// void inParse(int u) { if (u == NIL) return; inParse(T[u].l); pri...
#include <stdio.h> #define MAX 10000 #define NIL -1 struct Node { int p, l, r; }; struct Node T[MAX]; int n; //先行順巡回// void preParse(int u) { if (u == NIL) return; printf(" %d", u); preParse(T[u].l); preParse(T[u].r); } //中間巡回// void inParse(int u) { if (u == NIL) return; inParse(T[u].l); pri...
[ "literal.string.change", "call.arguments.change", "io.output.change" ]
126,439
126,440
u199560691
cpp
p02281
#include <bits/stdc++.h> using namespace std; #define NIL -1 struct node { int p, r, l; }; node tree[30]; int n; void preorder(int u) { if (u == NIL) return; cout << " " << u; preorder(tree[u].r); preorder(tree[u].l); } void inorder(int u) { if (u == NIL) return; inorder(tree[u].r); cout <<...
#include <bits/stdc++.h> using namespace std; #define NIL -1 struct node { int p, r, l; }; node tree[30]; int n; void preorder(int u) { if (u == NIL) return; cout << " " << u; preorder(tree[u].r); preorder(tree[u].l); } void inorder(int u) { if (u == NIL) return; inorder(tree[u].r); cout <<...
[ "assignment.variable.change", "identifier.change", "variable_access.subscript.index.change" ]
126,443
126,444
u661973509
cpp
p02281
#include <iostream> const int MAXN = 10005; const int NIL = -1; using namespace std; struct Node { int l, r, p; }; struct Node T[MAXN]; void preoder(int u) { if (u == NIL) return; cout << " " << u; preoder(T[u].l); preoder(T[u].r); } void inorder(int u) { if (u == NIL) return; inorder(T[u].l); ...
#include <iostream> const int MAXN = 10005; const int NIL = -1; using namespace std; struct Node { int l, r, p; }; struct Node T[MAXN]; void preoder(int u) { if (u == NIL) return; cout << " " << u; preoder(T[u].l); preoder(T[u].r); } void inorder(int u) { if (u == NIL) return; inorder(T[u].l); ...
[ "literal.string.change", "io.output.change" ]
126,445
126,446
u869475364
cpp
p02281
#include <iostream> using namespace std; int P[26] = {}; int L[26] = {}; int R[26] = {}; void preorder(int root) { if (root < 0) return; cout << " " << root; preorder(L[root]); preorder(R[root]); } void inorder(int root) { if (root < 0) return; inorder(L[root]); cout << " " << root; inorder(R[...
#include <iostream> using namespace std; int P[26] = {}; int L[26] = {}; int R[26] = {}; void preorder(int root) { if (root < 0) return; cout << " " << root; preorder(L[root]); preorder(R[root]); } void inorder(int root) { if (root < 0) return; inorder(L[root]); cout << " " << root; inorder(R[...
[]
126,459
126,460
u701536962
cpp
p02281
#include <cstdio> #include <iostream> using namespace std; #define MAX 10000 #define NIL -1 struct Node { int p, l, r; }; struct Node T[MAX]; int n; //??????????????? void preParse(int u) { if (u == NIL) return; printf(" %d", u); preParse(T[u].l); preParse(T[u].r); } //??????????????? void inParse(int ...
#include <cstdio> #include <iostream> using namespace std; #define MAX 10000 #define NIL -1 struct Node { int p, l, r; }; struct Node T[MAX]; int n; //??????????????? void preParse(int u) { if (u == NIL) return; printf(" %d", u); preParse(T[u].l); preParse(T[u].r); } //??????????????? void inParse(int ...
[ "identifier.change", "call.function.change" ]
126,466
126,467
u114204200
cpp
p02281
// ALDS1_7_C #include <algorithm> #include <iostream> #include <vector> using namespace std; struct Node { int parent; int children[2]; }; void pre_walk(vector<Node> Tree, int p) { cout << " " << p; for (int i = 0; i < 2; i++) if (Tree[p].children[i] != -1) pre_walk(Tree, Tree[p].children[i]); } v...
// ALDS1_7_C #include <algorithm> #include <iostream> #include <vector> using namespace std; struct Node { int parent; int children[2]; }; void pre_walk(vector<Node> Tree, int p) { cout << " " << p; for (int i = 0; i < 2; i++) if (Tree[p].children[i] != -1) pre_walk(Tree, Tree[p].children[i]); } v...
[ "literal.string.change", "literal.string.case.change", "io.output.change" ]
126,474
126,475
u913726760
cpp
p02281
#include <algorithm> #include <cstdio> using namespace std; const int NIL = -1; struct node { int parent; int left; int right; }; node nodes[100000]; void preorder(int v) { if (v == NIL) return; printf(" %d", v); preorder(nodes[v].left); preorder(nodes[v].right); } void inorder(int v) { if (v ==...
#include <algorithm> #include <cstdio> using namespace std; const int NIL = -1; struct node { int parent; int left; int right; }; node nodes[100000]; void preorder(int v) { if (v == NIL) return; printf(" %d", v); preorder(nodes[v].left); preorder(nodes[v].right); } void inorder(int v) { if (v ==...
[ "literal.string.change", "call.arguments.change", "io.output.change", "io.output.newline.add" ]
126,476
126,477
u711393819
cpp
p02281
#include <algorithm> #include <iostream> using namespace std; struct node { node() : p(-1), l(-1), r(-1) {} int p, l, r; }; void preorder(node t[], int id) { if (id == -1) return; cout << ' ' << id; preorder(t, t[id].l); preorder(t, t[id].r); } void inorder(node t[], int id) { if (id == -1) retu...
#include <algorithm> #include <iostream> using namespace std; struct node { node() : p(-1), l(-1), r(-1) {} int p, l, r; }; void preorder(node t[], int id) { if (id == -1) return; cout << ' ' << id; preorder(t, t[id].l); preorder(t, t[id].r); } void inorder(node t[], int id) { if (id == -1) retu...
[ "misc.typo", "control_flow.loop.for.condition.change", "expression.operation.binary.change" ]
126,480
126,481
u277798389
cpp
p02281
#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 =...
[ "identifier.change", "call.function.change" ]
126,482
126,483
u177949486
cpp
p02281
/* * File: main.cpp * Author: masa * * Created on 2016/03/12, 7:31 */ #include <cstdlib> #include <string> //#include <fstream> #include <iostream> using namespace std; #define MAX 26 #define NIL -1 struct Node { int parent; int left; int right; }; Node treeNodes[MAX]; /* * */ void printPreOrder(i...
/* * File: main.cpp * Author: masa * * Created on 2016/03/12, 7:31 */ #include <cstdlib> #include <string> //#include <fstream> #include <iostream> using namespace std; #define MAX 26 #define NIL -1 struct Node { int parent; int left; int right; }; Node treeNodes[MAX]; /* * */ void printPreOrder(i...
[ "literal.string.change", "literal.string.case.change", "io.output.change" ]
126,486
126,487
u651428295
cpp
p02281
#include <bits/stdc++.h> using namespace std; struct node { int p, l, r; }; node N[30]; void dfs1(int x) { if (x == -1) return; cout << " " << x; dfs1(N[x].l); dfs1(N[x].r); } void dfs2(int x) { if (x == -1) return; dfs2(N[x].l); cout << " " << x; dfs2(N[x].r); } void dfs3(int x) { if (x ...
#include <bits/stdc++.h> using namespace std; struct node { int p, l, r; }; node N[30]; void dfs1(int x) { if (x == -1) return; cout << " " << x; dfs1(N[x].l); dfs1(N[x].r); } void dfs2(int x) { if (x == -1) return; dfs2(N[x].l); cout << " " << x; dfs2(N[x].r); } void dfs3(int x) { if (x ...
[ "literal.string.change", "io.output.change" ]
126,493
126,494
u952951927
cpp
p02281
// ALDS1_7C #include <iostream> using namespace std; #define MAX 10000 #define NIL -1 struct Node { int p, l, r; }; Node T[MAX]; int n; void preParse(int u) { if (u == NIL) return; cout << " " << u; preParse(T[u].l); preParse(T[u].r); } void inParse(int u) { if (u == NIL) return; inParse(T[u]....
// ALDS1_7C #include <iostream> using namespace std; #define MAX 10000 #define NIL -1 struct Node { int p, l, r; }; Node T[MAX]; int n; void preParse(int u) { if (u == NIL) return; cout << " " << u; preParse(T[u].l); preParse(T[u].r); } void inParse(int u) { if (u == NIL) return; inParse(T[u]....
[ "literal.string.change", "io.output.change", "literal.string.case.change" ]
126,495
126,496
u121040546
cpp
p02281
#include <cstdio> #include <iostream> using namespace std; static const int MAX_NUM = 25; static const int NOELEM = -1; struct stNode { int parent; int left; int right; }; void Preoder(stNode elem[], int root) { if (root != NOELEM) { printf(" %d", root); Preoder(elem, elem[root].left); Preoder(el...
#include <cstdio> #include <iostream> using namespace std; static const int MAX_NUM = 25; static const int NOELEM = -1; struct stNode { int parent; int left; int right; }; void Preoder(stNode elem[], int root) { if (root != NOELEM) { printf(" %d", root); Preoder(elem, elem[root].left); Preoder(el...
[ "literal.string.change", "call.arguments.change", "io.output.change" ]
126,499
126,500
u861447106
cpp
p02281
#include <iostream> using namespace std; struct Node { int p, l, r; }; struct Node T[10000]; int n; //先行順巡回 void preParse(int u) { if (u == -1) return; cout << " " << u; preParse(T[u].l); preParse(T[u].r); } //中間順巡回 void inParse(int u) { if (u == -1) return; inParse(T[u].l); cout << " " << u...
#include <iostream> using namespace std; struct Node { int p, l, r; }; struct Node T[10000]; int n; //先行順巡回 void preParse(int u) { if (u == -1) return; cout << " " << u; preParse(T[u].l); preParse(T[u].r); } //中間順巡回 void inParse(int u) { if (u == -1) return; inParse(T[u].l); cout << " " << u...
[ "literal.string.change", "io.output.change" ]
126,505
126,506
u955830252
cpp
p02281
#include <iostream> using namespace std; static const int NIL = -1; struct node { int p; int r; int l; }; node tree[9999]; int depth(int u) { int d = 0; while (tree[u].p != NIL) { u = tree[u].p; d++; } return d; } int printh(int u) { int h1, h2; h1 = h2 = 0; if (tree[u].l != NIL) h1...
#include <iostream> using namespace std; static const int NIL = -1; struct node { int p; int r; int l; }; node tree[9999]; int depth(int u) { int d = 0; while (tree[u].p != NIL) { u = tree[u].p; d++; } return d; } int printh(int u) { int h1, h2; h1 = h2 = 0; if (tree[u].l != NIL) h1...
[ "literal.string.change", "literal.string.case.change", "io.output.change" ]
126,512
126,513
u135421061
cpp
p02281
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; struct TNode { int Id; TNode *Parent; TNode *LChild; TNode *RChild; }; //???????????????????????????TNode*???????????????(vector??????????????¢?????????????????????) class TTable { private: vector<TNode *> FNod...
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; struct TNode { int Id; TNode *Parent; TNode *LChild; TNode *RChild; }; //???????????????????????????TNode*???????????????(vector??????????????¢?????????????????????) class TTable { private: vector<TNode *> FNod...
[]
126,523
126,524
u050511799
cpp
p02281
// ????????¨????????? #include <cmath> #include <cstdio> #include <iostream> using namespace std; #define MAX 30 #define NIL -1 struct Node { int parent, leftChild, rightSibling; }; Node tree[MAX]; void preorder(int root) { printf(" %d", root); if (tree[root].leftChild != NIL) { preorder(tree[root].leftCh...
// ????????¨????????? #include <cmath> #include <cstdio> #include <iostream> using namespace std; #define MAX 30 #define NIL -1 struct Node { int parent, leftChild, rightSibling; }; Node tree[MAX]; void preorder(int root) { printf(" %d", root); if (tree[root].leftChild != NIL) { preorder(tree[root].leftCh...
[ "literal.string.change", "call.arguments.change", "io.output.change" ]
126,525
126,526
u112247126
cpp
p02281
#include <algorithm> #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, D[N], H[N]; void preorder(int u) { if (NIL == u) ...
#include <algorithm> #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, D[N], H[N]; void preorder(int u) { if (NIL == u) ...
[ "identifier.change", "call.function.change", "literal.string.change", "call.arguments.change", "io.output.change" ]
126,529
126,530
u922538592
cpp
p02281
#include <algorithm> #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, D[N], H[N]; void preorder(int u) { if (NIL == u) ...
#include <algorithm> #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, D[N], H[N]; void preorder(int u) { if (NIL == u) ...
[ "identifier.change", "call.function.change" ]
126,531
126,530
u922538592
cpp
p02281
#include <algorithm> #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, D[N], H[N]; void preorder(int u) { if (NIL == u) ...
#include <algorithm> #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, D[N], H[N]; void preorder(int u) { if (NIL == u) ...
[ "identifier.change", "call.function.change" ]
126,533
126,530
u922538592
cpp
p02281
#include <bits/stdc++.h> #define MAX 10000 #define r(i, n) for (int i = 0; i < n; i++) using namespace std; struct Node { int p, l, r; }; Node T[MAX]; int D[MAX], H[MAX]; void preorder(int u) { if (u == -1) return; printf(" %d", u); preorder(T[u].l); preorder(T[u].r); } void inorder(int u) { if (u == -1...
#include <bits/stdc++.h> #define MAX 10000 #define r(i, n) for (int i = 0; i < n; i++) using namespace std; struct Node { int p, l, r; }; Node T[MAX]; int D[MAX], H[MAX]; void preorder(int u) { if (u == -1) return; printf(" %d", u); preorder(T[u].l); preorder(T[u].r); } void inorder(int u) { if (u == -1...
[ "literal.string.change", "literal.string.case.change", "call.arguments.change", "io.output.change" ]
126,534
126,535
u962041986
cpp
p02281
#include <cstdio> #define MAX 10000 #define NIL -1 using namespace std; struct Node { int p; int l; int r; }; Node T[MAX]; int n; //???????????? void preParse(int u) { if (u == NIL) return; printf(" %d", u); preParse(T[u].l); preParse(T[u].r); } //???????????? void inParse(int u) { if (u == NIL...
#include <cstdio> #define MAX 10000 #define NIL -1 using namespace std; struct Node { int p; int l; int r; }; Node T[MAX]; int n; //???????????? void preParse(int u) { if (u == NIL) return; printf(" %d", u); preParse(T[u].l); preParse(T[u].r); } //???????????? void inParse(int u) { if (u == NIL...
[]
126,540
126,541
u167064764
cpp
p02281
#include <iostream> using namespace std; #define MAX 10000 #define NIL -1 struct Node { int p, l, r; }; struct Node T[MAX]; int n; void preParse(int u) { if (u == NIL) return; cout << " " << u; preParse(T[u].l); preParse(T[u].r); } void inParse(int u) { if (u == NIL) return; inParse(T[u].l); ...
#include <iostream> using namespace std; #define MAX 10000 #define NIL -1 struct Node { int p, l, r; }; struct Node T[MAX]; int n; void preParse(int u) { if (u == NIL) return; cout << " " << u; preParse(T[u].l); preParse(T[u].r); } void inParse(int u) { if (u == NIL) return; inParse(T[u].l); ...
[ "identifier.replace.add", "literal.replace.remove", "call.arguments.change" ]
126,544
126,545
u967088297
cpp
p02281
#include <iostream> using namespace std; #define MAX 10000 #define NIL -1 struct Node { int p, l, r; }; struct Node T[MAX]; int n; void preParse(int u) { if (u == NIL) return; cout << " " << u; preParse(T[u].l); preParse(T[u].r); } void inParse(int u) { if (u == NIL) return; inParse(T[u].l); ...
#include <iostream> using namespace std; #define MAX 10000 #define NIL -1 struct Node { int p, l, r; }; struct Node T[MAX]; int n; void preParse(int u) { if (u == NIL) return; cout << " " << u; preParse(T[u].l); preParse(T[u].r); } void inParse(int u) { if (u == NIL) return; inParse(T[u].l); ...
[ "identifier.replace.add", "literal.replace.remove", "call.arguments.change" ]
126,546
126,545
u967088297
cpp
p02281
#include <cstdio> #include <iostream> #define MAX 25 #define NIL -1 struct Node { int parent, left, right; }; Node T[MAX]; void preParse(int u) { if (u == NIL) return; printf(" %d", u); preParse(T[u].left); preParse(T[u].right); } void inParse(int u) { if (u == NIL) return; inParse(T[u].left); ...
#include <cstdio> #include <iostream> #define MAX 25 #define NIL -1 struct Node { int parent, left, right; }; Node T[MAX]; void preParse(int u) { if (u == NIL) return; printf(" %d", u); preParse(T[u].left); preParse(T[u].right); } void inParse(int u) { if (u == NIL) return; inParse(T[u].left); ...
[ "literal.string.change", "expression.operation.binary.change" ]
126,547
126,548
u981523133
cpp
p02281
#include <iostream> #include <memory> #include <vector> using namespace std; enum { NA = -1, }; struct node { int id; int l; int r; node() : id(NA), l(NA), r(NA) {} }; inline void show_preorder(vector<node> v, int node_id) { cout << " " << v[node_id].id; if (v[node_id].l != NA) show_preorder(v, v[...
#include <iostream> #include <memory> #include <vector> using namespace std; enum { NA = -1, }; struct node { int id; int l; int r; node() : id(NA), l(NA), r(NA) {} }; inline void show_preorder(vector<node> v, int node_id) { cout << " " << v[node_id].id; if (v[node_id].l != NA) show_preorder(v, v[...
[ "identifier.change", "call.function.change", "literal.string.change", "io.output.change" ]
126,553
126,554
u422898789
cpp
p02281
#include <cstdio> #include <vector> class Node { public: int id; int left_id; int right_id; int parent_id; Node(); }; Node::Node() { id = -1; left_id = -1; right_id = -1; parent_id = -1; } int search_root(std::vector<Node> &data, int id) { if (data[id].parent_id == -1) { return id; } else {...
#include <cstdio> #include <vector> class Node { public: int id; int left_id; int right_id; int parent_id; Node(); }; Node::Node() { id = -1; left_id = -1; right_id = -1; parent_id = -1; } int search_root(std::vector<Node> &data, int id) { if (data[id].parent_id == -1) { return id; } else {...
[ "control_flow.branch.if.condition.change" ]
126,559
126,560
u371961438
cpp
p02281
#include <iostream> using namespace std; #define MAX 10000 #define NIL -1 struct Node { int p, l, r; }; Node T[MAX]; int n; void preParse(int u) { if (u == NIL) return; cout << " " << u; preParse(T[u].l); preParse(T[u].r); } void inParse(int u) { if (u == NIL) return; inParse(T[u].l); cout << "...
#include <iostream> using namespace std; #define MAX 10000 #define NIL -1 struct Node { int p, l, r; }; Node T[MAX]; int n; void preParse(int u) { if (u == NIL) return; cout << " " << u; preParse(T[u].l); preParse(T[u].r); } void inParse(int u) { if (u == NIL) return; inParse(T[u].l); cout << "...
[ "literal.string.change", "literal.string.case.change", "io.output.change" ]
126,561
126,562
u649417416
cpp
p02281
#include <cstdio> #define MAX 10000 #define NIL -1 struct Node { int parent, left, right; }; Node T[MAX]; int n; void preParse(int u) { if (u == NIL) return; printf(" %d", u); preParse(T[u].left); preParse(T[u].right); } void inParse(int u) { if (u == NIL) return; inParse(T[u].left); printf(...
#include <cstdio> #define MAX 10000 #define NIL -1 struct Node { int parent, left, right; }; Node T[MAX]; int n; void preParse(int u) { if (u == NIL) return; printf(" %d", u); preParse(T[u].left); preParse(T[u].right); } void inParse(int u) { if (u == NIL) return; inParse(T[u].left); printf(...
[ "identifier.change", "call.function.change" ]
126,564
126,565
u303240337
cpp
p02281
#include <bits/stdc++.h> using namespace std; #define MAX 10000 #define NIL -1 struct Node { int p; int left; int right; }; Node tree[MAX]; // int num; void preParse(int); void inParse(int); void postParse(int); int main() { int num; int i, v, left, right, root; cin >> num; for (i = 0; i < num; i++) ...
#include <bits/stdc++.h> using namespace std; #define MAX 10000 #define NIL -1 struct Node { int p; int left; int right; }; Node tree[MAX]; // int num; void preParse(int); void inParse(int); void postParse(int); int main() { int num; int i, v, left, right, root; cin >> num; for (i = 0; i < num; i++) ...
[ "literal.string.change", "io.output.change" ]
126,566
126,567
u133380340
cpp