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 |
|---|---|---|---|---|---|---|---|
p02284 | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
using namespace std;
struct Node {
int key;
Node *r, *l, *p;
};
Node *root, *NIL;
Node *find(Node *u, int k) {
while (u != NIL && k != u->key) {
if (k < u->key)
u = u->l;
else
u = u->r;
}
return u;
}
void inse... | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
using namespace std;
struct Node {
int key;
Node *r, *l, *p;
};
Node *root, *NIL;
Node *find(Node *u, int k) {
while (u != NIL && k != u->key) {
if (k < u->key)
u = u->l;
else
u = u->r;
}
return u;
}
void inse... | [
"literal.string.change",
"call.arguments.change",
"io.output.change",
"io.output.newline.add"
] | 124,627 | 124,628 | u533866056 | cpp |
p02284 | #include <iostream>
#include <stdio.h>
#include <string>
#define MAX 500000
struct node {
int key;
int parent, left, right;
} T[MAX];
int root;
void PrePrint(int t) {
if (t == -1)
return;
printf(" %d", T[t].key);
PrePrint(T[t].left);
PrePrint(T[t].right);
}
void InPrint(int t) {
if (t == -1)
r... | #include <iostream>
#include <stdio.h>
#include <string>
#define MAX 500000
struct node {
int key;
int parent, left, right;
} T[MAX];
int root;
void PrePrint(int t) {
if (t == -1)
return;
printf(" %d", T[t].key);
PrePrint(T[t].left);
PrePrint(T[t].right);
}
void InPrint(int t) {
if (t == -1)
r... | [
"misc.opposites",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 124,632 | 124,633 | u693262017 | cpp |
p02284 | #include <cstdio>
#include <iostream>
#include <string>
using namespace std;
struct Node {
int key;
Node *p, *l, *r;
};
int n;
Node *NIL, *root;
void preorder(Node *u) {
if (u == NIL)
return;
cout << ' ' << u->key;
preorder(u->l);
preorder(u->r);
}
void inorder(Node *u) {
if (u == NIL)
return... | #include <cstdio>
#include <iostream>
#include <string>
using namespace std;
struct Node {
int key;
Node *p, *l, *r;
};
int n;
Node *NIL, *root;
void preorder(Node *u) {
if (u == NIL)
return;
cout << ' ' << u->key;
preorder(u->l);
preorder(u->r);
}
void inorder(Node *u) {
if (u == NIL)
return... | [
"literal.string.change",
"io.output.change"
] | 124,636 | 124,637 | u678006013 | cpp |
p02284 | #include <iostream>
#define eol '\n';
using namespace std;
class Node {
public:
int k;
Node *p;
Node *l;
Node *r;
Node() : k(-1), p(nullptr), l(nullptr), r(nullptr){};
};
Node *root;
void insert(Node *z) {
Node *y = nullptr;
Node *x = root;
while (x != nullptr) {
y = x;
if (z->k < x->k) {
... | #include <iostream>
#define eol '\n';
using namespace std;
class Node {
public:
int k;
Node *p;
Node *l;
Node *r;
Node() : k(-1), p(nullptr), l(nullptr), r(nullptr){};
};
Node *root;
void insert(Node *z) {
Node *y = nullptr;
Node *x = root;
while (x != nullptr) {
y = x;
if (z->k < x->k) {
... | [
"identifier.change",
"control_flow.branch.if.condition.change"
] | 124,638 | 124,639 | u813563655 | cpp |
p02284 | #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 key;
node *parent, *left, *right;
};
node *roo... | #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 key;
node *parent, *left, *right;
};
node *roo... | [
"expression.operation.binary.remove",
"control_flow.branch.if.condition.change"
] | 124,642 | 124,643 | u177949486 | cpp |
p02284 | #include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
using namespace std;
struct Node {
int key;
Node *right, *left, *parent;
};
Node *root, *NIL;
void insert(int k) {
Node *y = NIL;
Node *x = root;
Node *z;
z = new Node;
z->key = k;
z->left = NIL;
z->right = NIL;
while (x... | #include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
using namespace std;
struct Node {
int key;
Node *right, *left, *parent;
};
Node *root, *NIL;
void insert(int k) {
Node *y = NIL;
Node *x = root;
Node *z;
z = new Node;
z->key = k;
z->left = NIL;
z->right = NIL;
while (x... | [
"misc.opposites",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 124,644 | 124,645 | u210148484 | cpp |
p02284 | #include <cstdio>
#include <cstdlib>
struct Node {
int key;
Node *p, *l, *r;
};
Node *root;
void insert(int key_) {
Node *x = root, *y = 0, *z;
z = (Node *)malloc(sizeof(Node));
z->key = key_, z->l = 0, z->r = 0;
while (x)
y = x, x = (z->key < x->key) ? x->l : x->r;
z->p = y;
if (!y)
root = z;
... | #include <cstdio>
#include <cstdlib>
struct Node {
int key;
Node *p, *l, *r;
};
Node *root;
void insert(int key_) {
Node *x = root, *y = 0, *z;
z = (Node *)malloc(sizeof(Node));
z->key = key_, z->l = 0, z->r = 0;
while (x)
y = x, x = (z->key < x->key) ? x->l : x->r;
z->p = y;
if (!y)
root = z;
... | [
"literal.string.change",
"call.arguments.change",
"io.output.change"
] | 124,646 | 124,647 | u823513038 | cpp |
p02284 | #include <algorithm>
#include <cstdio>
#include <string>
#include <vector>
using namespace std;
template <class T> struct Node {
T value;
size_t parent, left, right;
Node() : value(), parent(-1), left(-1), right(-1) {}
Node(T v) : value(v), parent(-1), left(-1), right(-1) {}
};
template <class T> struct Bina... | #include <algorithm>
#include <cstdio>
#include <string>
#include <vector>
using namespace std;
template <class T> struct Node {
T value;
size_t parent, left, right;
Node() : value(), parent(-1), left(-1), right(-1) {}
Node(T v) : value(v), parent(-1), left(-1), right(-1) {}
};
template <class T> struct Bina... | [
"identifier.change",
"variable_access.subscript.index.change",
"control_flow.branch.if.condition.change",
"expression.operator.compare.change"
] | 124,651 | 124,652 | u144532944 | cpp |
p02284 | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
using namespace std;
typedef long long ll;
int n;
struct node {
int l, r;
int key;
void init(int a) {
l = r = -1;
key = a;
}
};
struct bst {
int size;
node t[600001];
void init() { size = 0; }
void in... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
using namespace std;
typedef long long ll;
int n;
struct node {
int l, r;
int key;
void init(int a) {
l = r = -1;
key = a;
}
};
struct bst {
int size;
node t[600001];
void init() { size = 0; }
void in... | [] | 124,653 | 124,654 | u732263603 | cpp |
p02284 | #include <stdio.h>
#include <stdlib.h>
struct node {
struct node *right;
struct node *left;
struct node *parent;
int key;
};
typedef struct node *Node;
#define NIL NULL
Node root;
Node treeMinimum(Node x) {}
Node treeMaximum(Node x) {}
Node treeSearch(Node u, int k) {
Node x = u;
while (x != NIL) {
... | #include <stdio.h>
#include <stdlib.h>
struct node {
struct node *right;
struct node *left;
struct node *parent;
int key;
};
typedef struct node *Node;
#define NIL NULL
Node root;
Node treeMinimum(Node x) {}
Node treeMaximum(Node x) {}
Node treeSearch(Node u, int k) {
Node x = u;
while (x != NIL) {
... | [
"identifier.change",
"call.function.change"
] | 124,657 | 124,658 | u947975951 | cpp |
p02284 | //============================================================================
// Name : one.cpp
// Author : Lich_Ning
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#incl... | //============================================================================
// Name : one.cpp
// Author : Lich_Ning
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#incl... | [
"literal.string.change",
"literal.string.case.change",
"io.output.change"
] | 124,665 | 124,666 | u413770293 | cpp |
p02284 | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
using namespace std;
struct Node {
int key;
Node *right, *left, *parent;
};
Node *root, *NIL;
Node *find(Node *u, int k) {
while (u != NIL && k != u->key) {
if (k < u->key)
u = u->left;
else
u = u->right;
}
ret... | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
using namespace std;
struct Node {
int key;
Node *right, *left, *parent;
};
Node *root, *NIL;
Node *find(Node *u, int k) {
while (u != NIL && k != u->key) {
if (k < u->key)
u = u->left;
else
u = u->right;
}
ret... | [
"expression.operation.compare.replace.add",
"assignment.replace.remove",
"misc.typo"
] | 124,667 | 124,668 | u043039307 | cpp |
p02284 | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
using namespace std;
struct Node {
int key;
Node *right, *left, *parent;
};
Node *root, *NIL;
Node *find(Node *u, int k) {
while (u != NIL && k != u->key) {
if (k < u->key)
u = u->left;
else
u = u->right;
}
ret... | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
using namespace std;
struct Node {
int key;
Node *right, *left, *parent;
};
Node *root, *NIL;
Node *find(Node *u, int k) {
while (u != NIL && k != u->key) {
if (k < u->key)
u = u->left;
else
u = u->right;
}
ret... | [
"literal.string.change",
"literal.string.case.change",
"call.arguments.change",
"io.output.change"
] | 124,671 | 124,672 | u932691750 | cpp |
p02284 | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
using namespace std;
struct Node {
int key;
Node *right, *left, *parent;
};
Node *root, *NIL;
Node *find(Node *u, int k) {
while (u != NIL && k) {
if (k < u->key) {
u = u->left;
} else {
u = u->right;
}
}
... | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
using namespace std;
struct Node {
int key;
Node *right, *left, *parent;
};
Node *root, *NIL;
Node *find(Node *u, int k) {
while (u != NIL && k != u->key) {
if (k < u->key) {
u = u->left;
} else {
u = u->right;
... | [
"control_flow.loop.condition.change"
] | 124,674 | 124,675 | u500386459 | cpp |
p02284 | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
using namespace std;
struct Node {
int key;
Node *right, *left, *parent;
};
Node *root, *NIL;
Node *find(Node *u, int k) {
while (u != NIL && k != u->key) {
if (k < u->key)
u = u->left;
else
u = u->right;
}
ret... | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
using namespace std;
struct Node {
int key;
Node *right, *left, *parent;
};
Node *root, *NIL;
Node *find(Node *u, int k) {
while (u != NIL && k != u->key) {
if (k < u->key)
u = u->left;
else
u = u->right;
}
re... | [
"identifier.change",
"call.function.change",
"function.parameters.parameter.add"
] | 124,676 | 124,677 | u333124620 | cpp |
p02284 | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
using namespace std;
struct Node {
int key;
Node *right, *left, *parent;
};
Node *root, *NIL;
Node *find(Node *u, int k) {
while (u != NIL && k != u->key) {
if (k = u->key) {
u = u->left;
} else {
u = u->right;
... | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
using namespace std;
struct Node {
int key;
Node *right, *left, *parent;
};
Node *root, *NIL;
Node *find(Node *u, int k) {
while (u != NIL && k != u->key) {
if (k < u->key) {
u = u->left;
} else {
u = u->right;
... | [
"control_flow.branch.if.condition.change"
] | 124,678 | 124,679 | u936175119 | cpp |
p02284 | #include <iostream>
#include <stdio.h>
using namespace std;
struct Node {
int key;
Node *parent;
Node *left;
Node *right;
};
struct Node *NIL, *root;
void init() { root = NIL; }
void insert(Node *z) {
struct Node *y = NIL; // xの親
struct Node *x = root;
while (x != NIL) {
y = x;
if (z->key < x... | #include <iostream>
#include <stdio.h>
using namespace std;
struct Node {
int key;
Node *parent;
Node *left;
Node *right;
};
struct Node *NIL, *root;
void init() { root = NIL; }
void insert(Node *z) {
struct Node *y = NIL; // xの親
struct Node *x = root;
while (x != NIL) {
y = x;
if (z->key < x... | [
"literal.string.change",
"call.arguments.change",
"io.output.change",
"io.output.newline.add"
] | 124,680 | 124,681 | u173597612 | cpp |
p02284 | #include <cstdio>
#include <iostream>
#include <memory>
using namespace std;
struct Node {
int key;
Node *parent;
Node *left;
Node *right;
Node(int key = -1)
: key(key), parent(nullptr), left(nullptr), right(nullptr){};
};
struct Tree {
Node *root;
Tree() : root(nullptr){};
};
static void inse... | #include <cstdio>
#include <iostream>
#include <memory>
using namespace std;
struct Node {
int key;
Node *parent;
Node *left;
Node *right;
Node(int key = -1)
: key(key), parent(nullptr), left(nullptr), right(nullptr){};
};
struct Tree {
Node *root;
Tree() : root(nullptr){};
};
static void inse... | [
"misc.opposites",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 124,682 | 124,683 | u677185583 | cpp |
p02284 | #include <cstdlib>
#include <iostream>
#include <string>
using namespace std;
struct Node {
int key;
Node *right;
Node *left;
Node *parent;
};
Node *root;
Node *NIL;
Node *find(Node *u, int k) {
while (u != NIL && k != u->key) {
if (k < u->key) {
u = u->left;
} else {
u = u->right;
... | #include <cstdlib>
#include <iostream>
#include <string>
using namespace std;
struct Node {
int key;
Node *right;
Node *left;
Node *parent;
};
Node *root;
Node *NIL;
Node *find(Node *u, int k) {
while (u != NIL && k != u->key) {
if (k < u->key) {
u = u->left;
} else {
u = u->right;
... | [] | 124,684 | 124,685 | u626935725 | cpp |
p02284 | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
using namespace std;
struct Node {
int key;
Node *right, *left, *parent;
};
Node *root, *NIL;
Node *find(Node *u, int k) {
while (u != NIL && k != u->key) {
if (k < u->key) {
u = u->left;
} else
u = u->right;
}
... | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
using namespace std;
struct Node {
int key;
Node *right, *left, *parent;
};
Node *root, *NIL;
Node *find(Node *u, int k) {
while (u != NIL && k != u->key) {
if (k < u->key) {
u = u->left;
} else
u = u->right;
}
... | [
"literal.string.change",
"call.arguments.change",
"io.output.change"
] | 124,686 | 124,687 | u578092577 | cpp |
p02285 | /*
???????????????????????????????????????¢??I
???????????????????\??????????????±??????????????????????I
*/
#define VERNIY \
st(); \
int ver = 0, niy = 0, hbk = 0
#includ... | /*
???????????????????????????????????????¢??I
???????????????????\??????????????±??????????????????????I
*/
#define VERNIY \
st(); \
int ver = 0, niy = 0, hbk = 0
#includ... | [] | 124,819 | 124,820 | u993397917 | cpp |
p02285 | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
using namespace std;
struct Node {
int key;
Node *right, *left, *parent;
};
Node *root, *NIL;
Node *treeMinimum(Node *x) {
while (x->left != NIL)
x = x->left;
return x;
}
Node *find(Node *u, int k) {
while (u != NIL && k != u... | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
using namespace std;
struct Node {
int key;
Node *right, *left, *parent;
};
Node *root, *NIL;
Node *treeMinimum(Node *x) {
while (x->left != NIL)
x = x->left;
return x;
}
Node *find(Node *u, int k) {
while (u != NIL && k != u... | [
"expression.operation.compare.replace.add",
"assignment.replace.remove",
"misc.typo"
] | 124,823 | 124,824 | u043039307 | cpp |
p02285 | #include <iostream>
using namespace std;
struct Node {
int key;
Node *left, *right, *parent;
};
Node *root, *NIL;
Node *find(Node *u, int k) {
while (u != NIL && k != u->key) {
if (k < u->key) {
u = u->left;
} else {
u = u->right;
}
}
return u;
}
Node *getMinimum(Node *u) {
whi... | #include <iostream>
using namespace std;
struct Node {
int key;
Node *left, *right, *parent;
};
Node *root, *NIL;
Node *find(Node *u, int k) {
while (u != NIL && k != u->key) {
if (k < u->key) {
u = u->left;
} else {
u = u->right;
}
}
return u;
}
Node *getMinimum(Node *u) {
whi... | [
"assignment.variable.change"
] | 124,825 | 124,826 | u538099330 | cpp |
p02285 | #include <iostream>
#include <stdio.h>
#include <string.h>
#define MAX 100
//#define NIL -1
struct Node {
int key;
Node *parent, *left, *right;
};
Node *root, *NIL;
int n;
void insert(int val) {
Node *y = NIL;
Node *x = root;
Node *z = new Node();
z->key = val;
z->left = NIL;
z->right = NIL;
whi... | #include <iostream>
#include <stdio.h>
#include <string.h>
#define MAX 100
//#define NIL -1
struct Node {
int key;
Node *parent, *left, *right;
};
Node *root, *NIL;
int n;
void insert(int val) {
Node *y = NIL;
Node *x = root;
Node *z = new Node();
z->key = val;
z->left = NIL;
z->right = NIL;
whi... | [] | 124,828 | 124,829 | u888548672 | cpp |
p02285 | #include <iostream>
#include <stdio.h>
#include <string>
struct Node {
int key;
Node *parent, *left, *right;
};
Node *root, *NIL;
int n;
Node *getSuccessor(Node *u) {
Node *x = u->right;
while (x != NIL) {
x = x->left;
}
return x;
}
void insert(int val) {
Node *x = root;
Node *y = NIL;
Node *z... | #include <iostream>
#include <stdio.h>
#include <string>
struct Node {
int key;
Node *parent, *left, *right;
};
Node *root, *NIL;
int n;
Node *getSuccessor(Node *u) {
Node *x = u->right;
while (x->left != NIL) {
x = x->left;
}
return x;
}
void insert(int val) {
Node *x = root;
Node *y = NIL;
N... | [
"control_flow.loop.condition.change"
] | 124,831 | 124,832 | u888548672 | cpp |
p02285 | #include <iostream>
#include <stdio.h>
#include <string>
struct Node {
int key;
Node *parent, *left, *right;
};
Node *root, *NIL;
int n;
Node *getSuccessor(Node *u) {
Node *x = u->right;
while (x != NIL) {
x = x->left;
}
return x;
}
void insert(int val) {
Node *x = root;
Node *y = NIL;
Node *z... | #include <iostream>
#include <stdio.h>
#include <string>
struct Node {
int key;
Node *parent, *left, *right;
};
Node *root, *NIL;
int n;
Node *getSuccessor(Node *u) {
Node *x = u->right;
while (x->left != NIL) {
x = x->left;
}
return x;
}
void insert(int val) {
Node *x = root;
Node *y = NIL;
N... | [
"control_flow.loop.condition.change"
] | 124,833 | 124,832 | u888548672 | cpp |
p02285 | // Ref : https://book.mynavi.jp/ec/products/detail/id=35408
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
using namespace std;
struct Node {
int key;
Node *parent, *left, *right;
};
// These pointer adress is NULL until first store (root == NIL).
// NIL adress is permanently NULL for... | // Ref : https://book.mynavi.jp/ec/products/detail/id=35408
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
using namespace std;
struct Node {
int key;
Node *parent, *left, *right;
};
// These pointer adress is NULL until first store (root == NIL).
// NIL adress is permanently NULL for... | [
"identifier.change",
"call.arguments.change"
] | 124,834 | 124,835 | u862038050 | cpp |
p02285 | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
using namespace std;
struct Node {
int key;
Node *parent, *left, *right;
};
Node *root, *NIL;
Node *treeMinimum(Node *x) {
while (x->left != NIL)
x = x->left;
return x;
}
Node *find(Node *u, int k) {
while (u != NIL && k != u->... | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
using namespace std;
struct Node {
int key;
Node *parent, *left, *right;
};
Node *root, *NIL;
Node *treeMinimum(Node *x) {
while (x->left != NIL)
x = x->left;
return x;
}
Node *find(Node *u, int k) {
while (u != NIL && k != u->... | [
"call.arguments.change",
"function.return_value.change",
"identifier.change",
"control_flow.branch.if.condition.change"
] | 124,836 | 124,837 | u032207327 | cpp |
p02285 | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <string>
using namespace std;
struct node {
int num;
node *parent, *left, *right;
};
node *root, *NIL;
node *nextnode(node *x) {
node *z = x->left;
while (z->right != NIL) {
z = z->right;
}
return z;
}
void denode(node *z) {
node *... | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <string>
using namespace std;
struct node {
int num;
node *parent, *left, *right;
};
node *root, *NIL;
node *nextnode(node *x) {
node *z = x->right;
while (z->left != NIL) {
z = z->left;
}
return z;
}
void denode(node *z) {
node *x... | [
"control_flow.loop.condition.change",
"assignment.value.change"
] | 124,842 | 124,843 | u347577008 | cpp |
p02285 | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
using namespace std;
struct Node {
int key;
Node *right, *left, *parent;
};
Node *root, *NIL;
Node *treeMinimum(Node *x) {
while (x->left != NIL)
x = x->left;
return x;
}
Node *find(Node *u, int k) {
while (u != NIL && k != u... | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
using namespace std;
struct Node {
int key;
Node *right, *left, *parent;
};
Node *root, *NIL;
Node *treeMinimum(Node *x) {
while (x->left != NIL)
x = x->left;
return x;
}
Node *find(Node *u, int k) {
while (u != NIL && k != u... | [
"literal.string.change",
"call.arguments.change",
"io.output.change"
] | 124,844 | 124,845 | u578092577 | cpp |
p02285 | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
using namespace std;
struct Node {
int key;
Node *parent, *left, *right;
};
Node *root, *NIL;
void insert(int k) {
Node *y = NIL;
Node *x = root;
Node *z;
z = (Node *)malloc(sizeof(Node));
z->key = k;
z->left = NIL;
z->ri... | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
using namespace std;
struct Node {
int key;
Node *parent, *left, *right;
};
Node *root, *NIL;
void insert(int k) {
Node *y = NIL;
Node *x = root;
Node *z;
z = (Node *)malloc(sizeof(Node));
z->key = k;
z->left = NIL;
z->ri... | [
"control_flow.branch.if.condition.change"
] | 124,846 | 124,847 | u815527706 | cpp |
p02285 | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
using namespace std;
// NIL is NULL
#define NIL NULL
// Node structure
struct Node {
int key;
struct Node *parent;
struct Node *leftc;
struct Node *rightc;
};
// define Nodepointer
typedef struct Node *Nodepointer;
// root
Nodepointer ... | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
using namespace std;
// NIL is NULL
#define NIL NULL
// Node structure
struct Node {
int key;
struct Node *parent;
struct Node *leftc;
struct Node *rightc;
};
// define Nodepointer
typedef struct Node *Nodepointer;
// root
Nodepointer ... | [] | 124,848 | 124,849 | u575882803 | cpp |
p02285 | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
using namespace std;
// NIL is NULL
#define NIL NULL
// Node structure
struct Node {
int key;
struct Node *parent;
struct Node *leftc;
struct Node *rightc;
};
// define Nodepointer
typedef struct Node *Nodepointer;
// root
Nodepointer ... | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
using namespace std;
// NIL is NULL
#define NIL NULL
// Node structure
struct Node {
int key;
struct Node *parent;
struct Node *leftc;
struct Node *rightc;
};
// define Nodepointer
typedef struct Node *Nodepointer;
// root
Nodepointer ... | [] | 124,848 | 124,850 | u575882803 | cpp |
p02285 | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
using namespace std;
// NIL is NULL
#define NIL NULL
// Node structure
struct Node {
int key;
struct Node *parent;
struct Node *leftc;
struct Node *rightc;
};
// define Nodepointer
typedef struct Node *Nodepointer;
// root
Nodepointer ... | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
using namespace std;
// NIL is NULL
#define NIL NULL
// Node structure
struct Node {
int key;
struct Node *parent;
struct Node *leftc;
struct Node *rightc;
};
// define Nodepointer
typedef struct Node *Nodepointer;
// root
Nodepointer ... | [] | 124,851 | 124,850 | u575882803 | cpp |
p02285 | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
using namespace std;
// NIL is NULL
#define NIL NULL
// Node structure
struct Node {
int key;
struct Node *parent;
struct Node *leftc;
struct Node *rightc;
};
// define Nodepointer
typedef struct Node *Nodepointer;
// root
Nodepointer ... | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
using namespace std;
// NIL is NULL
#define NIL NULL
// Node structure
struct Node {
int key;
struct Node *parent;
struct Node *leftc;
struct Node *rightc;
};
// define Nodepointer
typedef struct Node *Nodepointer;
// root
Nodepointer ... | [
"identifier.change"
] | 124,848 | 124,860 | u575882803 | cpp |
p02285 | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
using namespace std;
// NIL is NULL
#define NIL NULL
// Node structure
struct Node {
int key;
struct Node *parent;
struct Node *leftc;
struct Node *rightc;
};
// define Nodepointer
typedef struct Node *Nodepointer;
// root
Nodepointer ... | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
using namespace std;
// NIL is NULL
#define NIL NULL
// Node structure
struct Node {
int key;
struct Node *parent;
struct Node *leftc;
struct Node *rightc;
};
// define Nodepointer
typedef struct Node *Nodepointer;
// root
Nodepointer ... | [] | 124,851 | 124,860 | u575882803 | cpp |
p02285 | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
using namespace std;
// NIL is NULL
#define NIL NULL
// Node structure
struct Node {
int key;
struct Node *parent;
struct Node *leftc;
struct Node *rightc;
};
// define Nodepointer
typedef struct Node *Nodepointer;
// root
Nodepointer ... | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
using namespace std;
// NIL is NULL
#define NIL NULL
// Node structure
struct Node {
int key;
struct Node *parent;
struct Node *leftc;
struct Node *rightc;
};
// define Nodepointer
typedef struct Node *Nodepointer;
// root
Nodepointer ... | [] | 124,853 | 124,860 | u575882803 | cpp |
p02285 | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
using namespace std;
// NIL is NULL
#define NIL NULL
// Node structure
struct Node {
int key;
struct Node *parent;
struct Node *leftc;
struct Node *rightc;
};
// define Nodepointer
typedef struct Node *Nodepointer;
// root
Nodepointer ... | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
using namespace std;
// NIL is NULL
#define NIL NULL
// Node structure
struct Node {
int key;
struct Node *parent;
struct Node *leftc;
struct Node *rightc;
};
// define Nodepointer
typedef struct Node *Nodepointer;
// root
Nodepointer ... | [
"call.arguments.change"
] | 124,855 | 124,860 | u575882803 | cpp |
p02285 | /*
二つの子がいる節点をdeleteするときは、
「左の部分木の中で最大のkeyをもつ節点(左の部分木の中で一番右下)」 もしくは、
「右の部分木の中で最少のkeyをもつ節点(右の部分木の中で一番左下)」
の節点が、消した位置に来るようにすればよい。
今回は小難しい節点の入れ替えの処理をしなくても
キーだけ変えて、左下or右下 の節点を消しておけばよい。
*/
/*
キーの重複がないそうなので、
配列の添え字をそのままキーにするのが最速っぽい。
(vectorは添え字の指定ができないからダメ、キーがzの時 left[z]、right[z]みたいに使えるのが最速
)
でも重複に備えるorキーがデカいなら、上のやり方は使えない... | /*
二つの子がいる節点をdeleteするときは、
「左の部分木の中で最大のkeyをもつ節点(左の部分木の中で一番右下)」 もしくは、
「右の部分木の中で最少のkeyをもつ節点(右の部分木の中で一番左下)」
の節点が、消した位置に来るようにすればよい。
今回は小難しい節点の入れ替えの処理をしなくても
キーだけ変えて、左下or右下 の節点を消しておけばよい。
*/
/*
キーの重複がないそうなので、
配列の添え字をそのままキーにするのが最速っぽい。
(vectorは添え字の指定ができないからダメ、キーがzの時 left[z]、right[z]みたいに使えるのが最速
)
でも重複に備えるorキーがデカいなら、上のやり方は使えない... | [
"misc.opposites",
"expression.operator.compare.change",
"control_flow.loop.condition.change"
] | 124,861 | 124,862 | u708195431 | cpp |
p02285 | #include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
using namespace std;
struct Node {
int key;
Node *right, *left, *parent;
};
Node *root, *NIL;
void insert(int k) {
Node *y = NIL;
Node *x = root;
Node *z;
z = (Node *)malloc(sizeof(Node));
z->key = k;
z->left = NIL;
z->right... | #include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
using namespace std;
struct Node {
int key;
Node *right, *left, *parent;
};
Node *root, *NIL;
void insert(int k) {
Node *y = NIL;
Node *x = root;
Node *z;
z = (Node *)malloc(sizeof(Node));
z->key = k;
z->left = NIL;
z->right... | [
"call.arguments.change"
] | 124,884 | 124,885 | u071753419 | cpp |
p02285 | #include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
using namespace std;
struct Node {
int key;
Node *parent, *left, *right;
};
Node *root, *NIL;
void insert(int k) {
Node *y = NIL;
Node *x = root;
Node *z;
z = (Node *)malloc(sizeof(Node));
z->key = k;
z->left = NIL;
z->right =... | #include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
using namespace std;
struct Node {
int key;
Node *parent, *left, *right;
};
Node *root, *NIL;
void insert(int k) {
Node *y = NIL;
Node *x = root;
Node *z;
z = (Node *)malloc(sizeof(Node));
z->key = k;
z->left = NIL;
z->right =... | [
"assignment.value.change",
"identifier.change",
"call.function.change"
] | 124,886 | 124,887 | u367386691 | cpp |
p02285 | #include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#define INTINF 2147483647
#define LLINF 9223372036854775807
typedef long long ll;
using namespace std;
struct Node {
int key;
Node *parent, *left, *right;
... | #include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#define INTINF 2147483647
#define LLINF 9223372036854775807
typedef long long ll;
using namespace std;
struct Node {
int key;
Node *parent, *left, *right;
... | [] | 124,889 | 124,890 | u417793585 | cpp |
p02285 | #include <iostream>
#include <stdio.h>
#include <string>
#define MAX 500000
struct node {
int key;
int parent, left, right;
} T[MAX];
int root;
void PrePrint(int t) {
if (t == -1)
return;
printf(" %d", T[t].key);
PrePrint(T[t].left);
PrePrint(T[t].right);
}
void InPrint(int t) {
if (t == -1)
r... | #include <iostream>
#include <stdio.h>
#include <string>
#define MAX 500000
struct node {
int key;
int parent, left, right;
} T[MAX];
int root;
void PrePrint(int t) {
if (t == -1)
return;
printf(" %d", T[t].key);
PrePrint(T[t].left);
PrePrint(T[t].right);
}
void InPrint(int t) {
if (t == -1)
r... | [] | 124,891 | 124,892 | u693262017 | cpp |
p02285 | #include <cstdlib>
#include <iostream>
#include <string>
using namespace std;
struct node {
int key;
node *lc, *rc, *p;
};
node *root = 0;
void insert(int x) {
node *pre = root; //设当前节点为根,以根为起点
node *temp = pre; //用来保存当前节点的临时指针
node *in = (node *)malloc(sizeof(node));
in->key = x;
in->lc = 0;
in->rc... | #include <cstdlib>
#include <iostream>
#include <string>
using namespace std;
struct node {
int key;
node *lc, *rc, *p;
};
node *root = 0;
void insert(int x) {
node *pre = root; //设当前节点为根,以根为起点
node *temp = pre; //用来保存当前节点的临时指针
node *in = (node *)malloc(sizeof(node));
in->key = x;
in->lc = 0;
in->rc... | [] | 124,893 | 124,894 | u963117907 | cpp |
p02285 | #include <cstdio>
#include <iostream>
using namespace std;
struct Node {
int key;
Node *parent, *left, *right;
};
Node *root, *NIL;
void insert(int k) {
Node *y = NIL;
Node *x = root;
Node *z;
z = new Node;
z->key = k;
z->left = NIL;
z->right = NIL;
while (x != NIL) {
y = x;
if (z->key ... | #include <cstdio>
#include <iostream>
using namespace std;
struct Node {
int key;
Node *parent, *left, *right;
};
Node *root, *NIL;
void insert(int k) {
Node *y = NIL;
Node *x = root;
Node *z;
z = new Node;
z->key = k;
z->left = NIL;
z->right = NIL;
while (x != NIL) {
y = x;
if (z->key ... | [
"control_flow.branch.if.condition.change"
] | 124,897 | 124,898 | u819979588 | cpp |
p02285 | #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 key;
node *parent, *left, *right;
};
node *roo... | #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 key;
node *parent, *left, *right;
};
node *roo... | [
"control_flow.loop.condition.change",
"expression.operation.compare.replace.add",
"assignment.replace.remove",
"misc.typo"
] | 124,899 | 124,900 | u177949486 | cpp |
p02285 | #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 key;
node *parent, *left, *right;
};
node *roo... | #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 key;
node *parent, *left, *right;
};
node *roo... | [
"control_flow.loop.condition.change"
] | 124,901 | 124,900 | u177949486 | cpp |
p02285 | #include <cstdio>
#include <vector>
using namespace std;
struct node {
int key;
int parent, left, right;
node() {
parent = -1;
left = -1;
right = -1;
}
};
vector<node> tree;
int root = -1;
void print_pre(int id) {
if (id == -1) {
return;
}
printf(" %d", tree[id].key);
print_pre(tree[... | #include <cstdio>
#include <vector>
using namespace std;
struct node {
int key;
int parent, left, right;
node() {
parent = -1;
left = -1;
right = -1;
}
};
vector<node> tree;
int root = -1;
void print_pre(int id) {
if (id == -1) {
return;
}
printf(" %d", tree[id].key);
print_pre(tree[... | [
"function.parameters.parameter.add",
"call.arguments.change"
] | 124,902 | 124,903 | u091662260 | cpp |
p02285 | #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 key;
node *left, *right, *parent;
node() : key(0), lef... | #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 key;
node *left, *right, *parent;
node() : key(0), lef... | [
"assignment.value.change",
"identifier.change"
] | 124,906 | 124,907 | u350754611 | cpp |
p02285 | #include <cstdlib>
#include <iostream>
#include <string>
using namespace std;
struct Node {
int key;
Node *parent, *left, *right;
};
void insert(int key);
Node *find(Node *x, int key);
void inorder(Node *u);
void preorder(Node *u);
void deleteNode(int key);
Node *getSuccessor(Node *z);
Node *getMinimum(Node *z);
... | #include <cstdlib>
#include <iostream>
#include <string>
using namespace std;
struct Node {
int key;
Node *parent, *left, *right;
};
void insert(int key);
Node *find(Node *x, int key);
void inorder(Node *u);
void preorder(Node *u);
void deleteNode(int key);
Node *getSuccessor(Node *z);
Node *getMinimum(Node *z);
... | [
"misc.opposites",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 124,908 | 124,909 | u779591421 | cpp |
p02285 | #include <stdio.h>
#include <stdlib.h>
struct node {
struct node *right;
struct node *left;
struct node *parent;
int key;
};
typedef struct node *Node;
#define NIL NULL
Node root;
Node treeMinimum(Node x) {}
Node treeMaximum(Node x) {}
Node treeSearch(Node u, int k) {
Node x = u;
while (x != NIL) {
... | #include <stdio.h>
#include <stdlib.h>
struct node {
struct node *right;
struct node *left;
struct node *parent;
int key;
};
typedef struct node *Node;
#define NIL NULL
Node root;
Node treeMinimum(Node x) {}
Node treeMaximum(Node x) {}
Node treeSearch(Node u, int k) {
Node x = u;
while (x != NIL) {
... | [] | 124,910 | 124,911 | u947975951 | cpp |
p02285 | #include <cstdio>
#include <queue>
#define NIL (-1)
using namespace std;
struct node {
int parent;
int left;
int right;
int key;
};
node tree[500001];
int treesize;
int root = NIL;
void pre(int id) {
if (id == -1)
return;
printf(" %d", tree[id].key);
if (tree[id].left >= 0)
pre(tree[id].left);... | #include <cstdio>
#include <queue>
#define NIL (-1)
using namespace std;
struct node {
int parent;
int left;
int right;
int key;
};
node tree[500001];
int treesize;
int root = NIL;
void pre(int id) {
if (id == -1)
return;
printf(" %d", tree[id].key);
if (tree[id].left >= 0)
pre(tree[id].left);... | [
"control_flow.loop.condition.change",
"assignment.value.change"
] | 124,912 | 124,913 | u172120093 | cpp |
p02285 | #include <iostream>
#include <string>
using namespace std;
struct Node {
int val;
Node *parent;
Node *left;
Node *right;
};
Node *nil;
class Tree {
Node *root;
void preorder(Node *p) {
if (p == nil)
return;
cout << " " << p->val;
preorder(p->left);
preorder(p->right);
}
void inor... | #include <iostream>
#include <string>
using namespace std;
struct Node {
int val;
Node *parent;
Node *left;
Node *right;
};
Node *nil;
class Tree {
Node *root;
void preorder(Node *p) {
if (p == nil)
return;
cout << " " << p->val;
preorder(p->left);
preorder(p->right);
}
void inor... | [
"control_flow.return.add"
] | 124,917 | 124,918 | u510526182 | cpp |
p02285 | #include <assert.h>
#include <iostream>
#include <string>
using namespace std;
struct Node {
int iKey_;
Node *pParent_;
Node *pLeftChild_;
Node *pRightChild_;
};
class Tree {
public:
Tree(int iNum) : iMaxNodeNum_(iNum), iCurNodeNum_(0) {}
void setNodeValue() {
for (int iCurNode_i = 0; iCurNode_i < iM... | #include <assert.h>
#include <iostream>
#include <string>
using namespace std;
struct Node {
int iKey_;
Node *pParent_;
Node *pLeftChild_;
Node *pRightChild_;
};
class Tree {
public:
Tree(int iNum) : iMaxNodeNum_(iNum), iCurNodeNum_(0) {}
void setNodeValue() {
for (int iCurNode_i = 0; iCurNode_i < iM... | [
"assignment.value.change",
"identifier.change"
] | 124,919 | 124,920 | u253923767 | cpp |
p02285 | #include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
using namespace std;
struct Node {
int key;
Node *p, *l, *r;
};
Node *root, *NIL;
void insert(int k) {
Node *x = root;
Node *y = NIL;
Node *z;
z = (Node *)malloc(sizeof(Node));
z->key = k;
z->l = NIL;
z->r = NIL;
while ... | #include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
using namespace std;
struct Node {
int key;
Node *p, *l, *r;
};
Node *root, *NIL;
void insert(int k) {
Node *x = root;
Node *y = NIL;
Node *z;
z = (Node *)malloc(sizeof(Node));
z->key = k;
z->l = NIL;
z->r = NIL;
while ... | [] | 124,921 | 124,922 | u612835288 | cpp |
p02287 | #include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <map>
#include <queue>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#define rep(i, begin, end) \
for ... | #include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <map>
#include <queue>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#define rep(i, begin, end) \
for ... | [
"io.output.change"
] | 125,114 | 125,115 | u766183517 | cpp |
p02287 | #include <iostream>
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];
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 i * 2; }
int right(int i) { return (i * 2 + 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... | [] | 125,120 | 125,121 | u267916634 | cpp |
p02287 | #include <iostream>
using namespace std;
#define MAX 100000
int parent(int i) { return i / 2; }
int left(int i) { return 2 * 1; }
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 ... | [
"identifier.replace.add",
"literal.replace.remove",
"function.return_value.change",
"expression.operation.binary.change"
] | 125,123 | 125,124 | u246775415 | cpp |
p02287 | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define SORT(c) sort((c).begin(), (c).end())
#define CLR(a) memset((&a), 0, sizeof(a)) // clear memory
#define dump(x) cerr << #x << " = " << (x) << endl; // debug... | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define SORT(c) sort((c).begin(), (c).end())
#define CLR(a) memset((&a), 0, sizeof(a)) // clear memory
#define dump(x) cerr << #x << " = " << (x) << endl; // debug... | [
"io.output.change"
] | 125,130 | 125,131 | u376120896 | 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 << "mode " << ... | #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 " << ... | [
"literal.string.change",
"io.output.change"
] | 125,132 | 125,133 | u962332067 | cpp |
p02287 | #include <bits/stdc++.h>
using namespace std;
#define MAX 100000
int parent(int a) { return a / 2; }
int left(int a) { return 2 * a; }
int right(int a) { return 2 * a + 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 << ... | #include <bits/stdc++.h>
using namespace std;
#define MAX 100000
int parent(int a) { return a / 2; }
int left(int a) { return 2 * a; }
int right(int a) { return 2 * a + 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 << ... | [
"literal.string.change",
"io.output.change"
] | 125,143 | 125,144 | u106492454 | cpp |
p02287 | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int *A = new int[n + 1];
for (int i = 1; i <= n; i++)
cin >> A[i];
for (int i = 1; i <= n; ++i) {
cout << "node " << i << ": key = " << A[i] << ", ";
if (i > 1)
cout << "parent key=" << A[i / 2] << ", ";
if (2 * i <... | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int *A = new int[n + 1];
for (int i = 1; i <= n; i++)
cin >> A[i];
for (int i = 1; i <= n; ++i) {
cout << "node " << i << ": key = " << A[i] << ", ";
if (i > 1)
cout << "parent key = " << A[i / 2] << ", ";
if (2 * i... | [
"literal.string.change",
"io.output.change"
] | 125,145 | 125,146 | u166697967 | 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 ... | [
"literal.string.change",
"io.output.change"
] | 125,149 | 125,150 | u399851654 | 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 ... | [
"literal.string.change",
"io.output.change"
] | 125,151 | 125,150 | u399851654 | cpp |
p02287 | #include <bits/stdc++.h>
using namespace std;
int A[251];
int main() {
int H;
cin >> H;
for (int i = 1; i <= H; i++)
cin >> A[i];
cout << H;
for (int i = 1; i <= H; i++) {
cout << "node " << i << ": key = " << A[i] << ", ";
if (i != 1)
cout << "parent key = " << A[i / 2] << ", ";
if (i... | #include <bits/stdc++.h>
using namespace std;
int A[251];
int main() {
int H;
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] << ", ";
if (i != 1)
cout << "parent key = " << A[i / 2] << ", ";
if (i * 2 <= H)
... | [] | 125,156 | 125,157 | u175705399 | 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 (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, i, A[MAX + 1];
cin >> H;
for (int i = 1; i <= H; i++)
cin >> A[i];
for (int i = 1; i <= H; i++) {
cout << "node " <... | [
"literal.string.change",
"io.output.change"
] | 125,163 | 125,164 | u011621222 | cpp |
p02287 | #include <iostream>
#include <queue>
#include <sstream>
#include <string>
using namespace std;
struct dot {
int k, p, l, r;
};
int main(int argc, char **argv) {
int n;
while (cin >> n) {
dot p[n + 1];
for (int i = 1; i <= n; i++) {
cin >> p[i].k;
if (i / 2)
p[i].p = i / 2;
else
... | #include <iostream>
#include <queue>
#include <sstream>
#include <string>
using namespace std;
struct dot {
long long int k, p, l, r;
};
int main(int argc, char **argv) {
int n;
while (cin >> n) {
dot p[n + 100];
for (int i = 1; i <= n; i++) {
cin >> p[i].k;
if (i / 2)
p[i].p = i / 2;
... | [
"literal.number.change",
"expression.operation.binary.change",
"assignment.variable.change"
] | 125,167 | 125,168 | u011621222 | cpp |
p02287 | #include <iostream>
using namespace std;
#define MAX \
100000 // defineは文字列を指定した文字で置き換える。constは変数を格納している。
// 2分接点の各情報を出力する
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... | #include <iostream>
using namespace std;
#define MAX \
100000 // defineは文字列を指定した文字で置き換える。constは変数を格納している。
// 2分接点の各情報を出力する
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... | [
"literal.string.change",
"io.output.change"
] | 125,171 | 125,172 | u643021750 | cpp |
p02287 | #include <iostream>
using namespace std;
#define MAX \
100000 // defineは文字列を指定した文字で置き換える。constは変数を格納している。
// 2分接点の各情報を出力する
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... | #include <iostream>
using namespace std;
#define MAX \
100000 // defineは文字列を指定した文字で置き換える。constは変数を格納している。
// 2分接点の各情報を出力する
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... | [
"literal.string.change",
"io.output.change"
] | 125,173 | 125,172 | u643021750 | cpp |
p02287 | #include <iostream>
#include <vector>
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 n;
cin >> n;
vector<int> a(n + 1);
for (int i = 1; i < n + 1; i++)
cin >> a[i];
for (int i = 1; i < n + 1; i++) {
c... | #include <iostream>
#include <vector>
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 n;
cin >> n;
vector<int> a(n + 1);
for (int i = 1; i < n + 1; i++)
cin >> a[i];
for (int i = 1; i < n + 1; i++) {
c... | [
"literal.string.change",
"io.output.change"
] | 125,174 | 125,175 | u955939940 | cpp |
p02287 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int 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(void) {
int n;
cin >> n;
int A[n + 1];
for (int i = 1; i <= n; i++)
cin >> A[i];
for (int i ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int 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(void) {
int n;
cin >> n;
int A[n + 1];
for (int i = 1; i <= n; i++)
cin >> A[i];
for (int i ... | [
"literal.string.change",
"call.arguments.change",
"io.output.change"
] | 125,176 | 125,177 | u771410206 | cpp |
p02287 | #include <cmath>
#include <iostream>
using namespace std;
#define MAX 250
int parent(int i) { return (int)floor(i / 2); };
int left(int i) { return i * 2; }
int right(int i) { return i * 2 + 1; }
int main() {
int H;
int A[MAX + 1];
cin >> H;
for (int i = 1; i <= H; i++) {
cin >> A[i];
}
for (int... | #include <cmath>
#include <iostream>
using namespace std;
#define MAX 250
int parent(int i) { return (int)floor(i / 2); };
int left(int i) { return i * 2; }
int right(int i) { return i * 2 + 1; }
int main() {
int H;
int A[MAX + 1];
cin >> H;
for (int i = 1; i <= H; i++) {
cin >> A[i];
}
for (int... | [
"literal.string.change",
"io.output.change"
] | 125,180 | 125,181 | u164798161 | cpp |
p02287 | #include <iostream>
using namespace std;
int H, N[800];
void print() {
for (int i = 1; i <= H; i++) {
cout << "node " << i << ": "
<< "key = " << N[i] << ", ";
if (N[i / 2] >= 1)
cout << "parent key = " << N[i / 2] << ", ";
if (i * 2 <= H)
cout << "left key = " << N[i * 2] << ", ";
... | #include <iostream>
using namespace std;
int H, N[3000];
void print() {
for (int i = 1; i <= H; i++) {
cout << "node " << i << ": "
<< "key = " << N[i] << ", ";
if (i / 2 >= 1)
cout << "parent key = " << N[i / 2] << ", ";
if (i * 2 <= H)
cout << "left key = " << N[i * 2] << ", ";
... | [
"literal.number.change",
"variable_declaration.array_dimensions.change",
"control_flow.loop.for.condition.change",
"control_flow.branch.if.condition.change"
] | 125,183 | 125,184 | u963117907 | cpp |
p02287 | #include <bits/stdc++.h>
using namespace std;
int main() {
int h;
cin >> h;
int h_lst[h + 1];
for (int i = 1; i < h + 1; i++)
cin >> h_lst[i];
for (int i = 1; i < h + 1; i++) {
cout << "node " << i << ": key = " << h_lst[i] << ", ";
if (i > 1)
cout << "parent key = " << h_lst[i / 2] << ",... | #include <bits/stdc++.h>
using namespace std;
int main() {
int h;
cin >> h;
int h_lst[h + 1];
for (int i = 1; i < h + 1; i++)
cin >> h_lst[i];
for (int i = 1; i < h + 1; i++) {
cout << "node " << i << ": key = " << h_lst[i] << ", ";
if (i > 1)
cout << "parent key = " << h_lst[i / 2] << ",... | [
"expression.operation.binary.add"
] | 125,186 | 125,187 | u554503378 | cpp |
p02287 | #include <cstdio>
#include <iostream>
#include <string>
using namespace std;
struct Node {
int key;
Node *p, *l, *r;
};
Node *NIL, *root;
void preorder(Node *u) {
if (u == NIL)
return;
cout << ' ' << u->key;
preorder(u->l);
preorder(u->r);
}
void inorder(Node *u) {
if (u == NIL)
return;
inor... | #include <cstdio>
#include <iostream>
#include <string>
using namespace std;
struct Node {
int key;
Node *p, *l, *r;
};
Node *NIL, *root;
void preorder(Node *u) {
if (u == NIL)
return;
cout << ' ' << u->key;
preorder(u->l);
preorder(u->r);
}
void inorder(Node *u) {
if (u == NIL)
return;
inor... | [
"literal.string.change",
"io.output.change"
] | 125,190 | 125,191 | u678006013 | cpp |
p02287 | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int *Tree = new int[n + 1];
for (int i = 1; i <= n; i++) {
cin >> Tree[i];
}
for (int i = 1; i <= n; i++) {
cout << "node " << i + 1 << ": key = " << Tree[i];
if (i / 2 > 0) {
cout << ", parent key = " << Tree[i / 2]... | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int *Tree = new int[n + 1];
for (int i = 1; i <= n; i++) {
cin >> Tree[i];
}
for (int i = 1; i <= n; i++) {
cout << "node " << i << ": key = " << Tree[i];
if (i / 2 > 0) {
cout << ", parent key = " << Tree[i / 2];
... | [
"expression.operation.binary.remove"
] | 125,192 | 125,193 | u920023587 | cpp |
p02287 | #include <stdio.h>
#define MAX 250
typedef struct Node {
int key;
Node *parent, *left, *right;
} Node;
Node *NIL, T[MAX];
void print(int n) {
int i;
Node *N;
for (i = 1; i <= n; i++) {
N = &T[i];
printf("node %d: key = %d, ", i + 1, N->key);
if (N->parent != NIL)
printf("parent key = %d, ... | #include <stdio.h>
#define MAX 250
typedef struct Node {
int key;
Node *parent, *left, *right;
} Node;
Node *NIL, T[MAX];
void print(int n) {
int i;
Node *N;
for (i = 1; i <= n; i++) {
N = &T[i];
printf("node %d: key = %d, ", i, N->key);
if (N->parent != NIL)
printf("parent key = %d, ", N... | [
"expression.operation.binary.remove",
"literal.number.change",
"control_flow.branch.if.condition.change"
] | 125,197 | 125,198 | u711264127 | cpp |
p02287 | #include <array>
#include <iostream>
using namespace std;
int n;
int getP(int i) {
if (i / 2 < n)
return i / 2;
else
return 0;
}
int getL(int i) {
if (2 * i < n)
return 2 * i;
else
return 0;
}
int getR(int i) {
if (2 * i + 1 < n)
return 2 * i + 1;
else
return 0;
}
int main() {
a... | #include <array>
#include <iostream>
using namespace std;
int n;
int getP(int i) {
if (i / 2 <= n)
return i / 2;
else
return 0;
}
int getL(int i) {
if (2 * i <= n)
return 2 * i;
else
return 0;
}
int getR(int i) {
if (2 * i + 1 <= n)
return 2 * i + 1;
else
return 0;
}
int main() {
... | [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change",
"expression.operation.binary.remove"
] | 125,199 | 125,200 | u387690318 | cpp |
p02287 | #include <array>
#include <iostream>
using namespace std;
int n;
int getP(int i) {
if (i / 2 < n)
return i / 2;
else
return 0;
}
int getL(int i) {
if (2 * i < n)
return 2 * i;
else
return 0;
}
int getR(int i) {
if (2 * i + 1 < n)
return 2 * i + 1;
else
return 0;
}
int main() {
a... | #include <array>
#include <iostream>
using namespace std;
int n;
int getP(int i) {
if (i / 2 <= n)
return i / 2;
else
return 0;
}
int getL(int i) {
if (2 * i <= n)
return 2 * i;
else
return 0;
}
int getR(int i) {
if (2 * i + 1 <= n)
return 2 * i + 1;
else
return 0;
}
int main() {
... | [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 125,201 | 125,200 | u387690318 | cpp |
p02287 | #include <iostream>
#define MAX 100000
int parent(int i) { return i / 2; }
int left(int i) { return 2 * i; }
int right(int i) { return i * 2 + 1; }
int main() {
int i, H, A[MAX + 1];
std::cin >> H;
for (i = 1; i <= H; ++i)
std::cin >> A[i];
for (i = 1; i <= H; ++i) {
std::cout << "node " << i << ": ke... | #include <iostream>
#define MAX 100000
int parent(int i) { return i / 2; }
int left(int i) { return 2 * i; }
int right(int i) { return i * 2 + 1; }
int main() {
int i, H, A[MAX + 1];
std::cin >> H;
for (i = 1; i <= H; ++i)
std::cin >> A[i];
for (i = 1; i <= H; ++i) {
std::cout << "node " << i << ": ke... | [
"literal.string.change",
"expression.operation.binary.change"
] | 125,207 | 125,208 | u376194616 | cpp |
p02287 | #include <iostream>
using namespace std;
int main() {
int n;
int H[251];
cin >> n;
for (int i = 1; i < n + 1; ++i) {
cin >> H[i];
}
for (int i = 1; i < n + 1; ++i) {
if (i == 1) {
cout << "node " << i << ": key = " << H[i] << ", left key = " << H[i * 2]
<< ", right key = " << H[i *... | #include <iostream>
using namespace std;
int main() {
int n;
int H[251];
cin >> n;
for (int i = 1; i < n + 1; ++i) {
cin >> H[i];
}
for (int i = 1; i < n + 1; ++i) {
if (i == 1) {
cout << "node " << i << ": key = " << H[i] << ", left key = " << H[i * 2]
<< ", right key = " << H[i *... | [
"expression.operation.binary.remove"
] | 125,209 | 125,210 | u064467943 | cpp |
p02287 | #include <bits/stdc++.h>
#define rep(i, a) for (i = 0; i < a; i++)
using namespace std;
int main(void) {
int i, H, buf;
vector<int> A;
cin >> H;
rep(i, H) {
cin >> buf;
A.push_back(buf);
}
rep(i, H) {
cout << "node" << i + 1 << ": key =" << A[i] << ", ";
if (i > 0)
cout << "parent ke... | #include <bits/stdc++.h>
#define rep(i, a) for (i = 0; i < a; i++)
using namespace std;
int main(void) {
int i, H, buf;
vector<int> A;
cin >> H;
rep(i, H) {
cin >> buf;
A.push_back(buf);
}
rep(i, H) {
cout << "node " << i + 1 << ": key = " << A[i] << ", ";
if (i > 0)
cout << "parent ... | [
"literal.string.change",
"io.output.change"
] | 125,211 | 125,212 | u458804662 | cpp |
p02287 | #include <bits/stdc++.h>
#define rep(i, a) for (i = 0; i < a; i++)
using namespace std;
int main(void) {
int i, H, buf;
vector<int> A;
cin >> H;
rep(i, H) {
cin >> buf;
A.push_back(buf);
}
rep(i, H) {
cout << "node" << i + 1 << ": key = " << A[i] << ", ";
if (i > 0)
cout << "parent k... | #include <bits/stdc++.h>
#define rep(i, a) for (i = 0; i < a; i++)
using namespace std;
int main(void) {
int i, H, buf;
vector<int> A;
cin >> H;
rep(i, H) {
cin >> buf;
A.push_back(buf);
}
rep(i, H) {
cout << "node " << i + 1 << ": key = " << A[i] << ", ";
if (i > 0)
cout << "parent ... | [
"literal.string.change",
"io.output.change"
] | 125,213 | 125,212 | u458804662 | cpp |
p02287 | /* ALDS1_9_A: Complete Binary Tree */
#include <cstdio>
#include <iostream>
inline bool between(int value, int begin, int end) {
return begin <= value && value <= end;
}
int main() {
int n_nodes;
scanf("%d\n", &n_nodes);
int tree[n_nodes + 1];
for (int i = 1; i <= n_nodes; i++)
scanf("%d", &tree[i]);
... | /* ALDS1_9_A: Complete Binary Tree */
#include <cstdio>
#include <iostream>
inline bool between(int value, int begin, int end) {
return begin <= value && value <= end;
}
int main() {
int n_nodes;
scanf("%d\n", &n_nodes);
int tree[n_nodes + 1];
for (int i = 1; i <= n_nodes; i++)
scanf("%d", &tree[i]);
... | [
"literal.string.change",
"call.arguments.change",
"io.output.change"
] | 125,216 | 125,217 | u559743044 | cpp |
p02287 | #include <cstdio>
using namespace std;
int parent(int x) { return x / 2; }
int left(int x) { return x * 2; }
int right(int x) { return (x * 2) + 1; }
int A[600];
int main() {
int n;
scanf("%d", &n);
for (int i = 1; i <= n; i++)
scanf("%d", &A[i]);
for (int i = 1; i <= n; i++) {
printf("node %d: ", ... | #include <cstdio>
using namespace std;
int parent(int x) { return x / 2; }
int left(int x) { return x * 2; }
int right(int x) { return (x * 2) + 1; }
int A[600];
int main() {
int n;
scanf("%d", &n);
for (int i = 1; i <= n; i++)
scanf("%d", &A[i]);
for (int i = 1; i <= n; i++) {
printf("node %d: ", ... | [
"literal.string.change",
"call.arguments.change",
"io.output.change"
] | 125,224 | 125,225 | u078112258 | cpp |
p02287 | #include <iostream>
using namespace std;
const int MAX = 1000000;
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) {
cou... | #include <iostream>
using namespace std;
const int MAX = 1000000;
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) {
cou... | [
"literal.string.change",
"literal.string.case.change",
"io.output.change"
] | 125,227 | 125,228 | u210148484 | cpp |
p02287 | #include <iostream>
using namespace std;
const int MAX = 1000000;
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 = 0; i <= H; ++i) {
cou... | #include <iostream>
using namespace std;
const int MAX = 1000000;
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) {
cou... | [
"literal.number.change",
"variable_declaration.value.change",
"control_flow.loop.for.initializer.change",
"expression.off_by_one",
"literal.string.change",
"literal.string.case.change",
"io.output.change"
] | 125,230 | 125,228 | u210148484 | cpp |
p02287 | #include <iostream>
using namespace std;
const int MAX = 1000000;
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) {
cou... | #include <iostream>
using namespace std;
const int MAX = 1000000;
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) {
cou... | [
"literal.string.change",
"literal.string.case.change",
"io.output.change"
] | 125,232 | 125,228 | u210148484 | cpp |
p02287 | #include <iostream>
#include <vector>
using namespace std;
int main() {
int n, i;
cin >> n;
vector<int> h(n);
for (i = 0; i < n; i++) {
cin >> h[i];
}
for (i = 0; i < n; i++) {
cout << "node " << i + 1 << ": key=" << h[i] << ", ";
if (i != 0) {
cout << "parent key = " << h[((i + 1) / 2)... | #include <iostream>
#include <vector>
using namespace std;
int main() {
int n, i;
cin >> n;
vector<int> h(n);
for (i = 0; i < n; i++) {
cin >> h[i];
}
for (i = 0; i < n; i++) {
cout << "node " << i + 1 << ": key = " << h[i] << ", ";
if (i != 0) {
cout << "parent key = " << h[((i + 1) / ... | [
"literal.string.change",
"io.output.change"
] | 125,237 | 125,238 | u176732165 | cpp |
p02287 | #include <iostream>
using namespace std;
#define MAX 250
int parent(int key) { return key / 2; }
int right(int key) { return (key * 2) + 1; }
int left(int key) { return key * 2; }
int main() {
int s, T[MAX];
cin >> s;
for (int i = 1; i <= s; i++) {
cin >> T[i];
}
for (int i = 1; i <= s; i++) {
cou... | #include <iostream>
using namespace std;
#define MAX 250
int parent(int key) { return key / 2; }
int right(int key) { return (key * 2) + 1; }
int left(int key) { return key * 2; }
int main() {
int s, T[MAX];
cin >> s;
for (int i = 1; i <= s; i++) {
cin >> T[i];
}
for (int i = 1; i <= s; i++) {
cou... | [
"literal.string.change",
"io.output.change"
] | 125,239 | 125,240 | u358181410 | cpp |
p02287 | #include <iostream>
#define ll long long
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;
ll A[251];
cin >> H;
for (int i = 1; i <= H; i++)
cin >> A[i];
for (int i = 1; i <= H; i++) {
cout << "node... | #include <iostream>
#define ll long long
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;
ll A[251];
cin >> H;
for (int i = 1; i <= H; i++)
cin >> A[i];
for (int i = 1; i <= H; i++) {
cout << "node... | [
"literal.string.change",
"io.output.change"
] | 125,241 | 125,242 | u229094612 | cpp |
p02287 | #include <bits/stdc++.h>
#define H 255
using namespace std;
int main() {
int h, A[H];
cin >> h;
for (int i = 1; i <= h; i++)
cin >> A[i];
for (int i = 1; i <= h; i++) {
cout << "node " << i << ": key = ";
cout << A[i] << ",";
if (i != 1)
cout << "parent key = " << A[i / 2] << ", ";
if... | #include <bits/stdc++.h>
#define H 255
using namespace std;
int main() {
int h, A[H];
cin >> h;
for (int i = 1; i <= h; i++)
cin >> A[i];
for (int i = 1; i <= h; i++) {
cout << "node " << i << ": key = ";
cout << A[i] << ", ";
if (i != 1)
cout << "parent key = " << A[i / 2] << ", ";
i... | [
"literal.string.change",
"io.output.change"
] | 125,245 | 125,246 | u084540620 | cpp |
p02287 | #include <bits/stdc++.h>
using namespace std;
#define N 100000
int main() {
int H, Heap[N + 1];
cin >> H;
for (int i = 1; i <= H; i++) {
cin >> Heap[i];
}
for (int i = 1; i <= H; i++) {
cout << "node" << i << ": key = " << Heap[i] << ", ";
if (i / 2 >= 1) {
cout << "parent key = " << ... | #include <bits/stdc++.h>
using namespace std;
#define N 100000
int main() {
int H, Heap[N + 1];
cin >> H;
for (int i = 1; i <= H; i++) {
cin >> Heap[i];
}
for (int i = 1; i <= H; i++) {
cout << "node " << i << ": key = " << Heap[i] << ", ";
if (i / 2 >= 1) {
cout << "parent key = " <<... | [
"literal.string.change",
"io.output.change"
] | 125,247 | 125,248 | u567521458 | cpp |
p02287 | // http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_9_A
//????§£?????????
#include <iostream>
using namespace std;
int main() {
int N, H[250];
cin >> N;
for (int i = 0; i < N; i++)
cin >> H[i];
int k = 0;
while (k < N) {
cout << "node " << k + 1 << ": key = " << H[k] << ", ";
int ... |
#include <iostream>
using namespace std;
int main() {
int N, H[250];
cin >> N;
for (int i = 0; i < N; i++)
cin >> H[i];
int k = 0;
while (k < N) {
cout << "node " << k + 1 << ": key = " << H[k] << ", ";
int l = (k + 1) / 2 - 1;
if (k != 0)
cout << "parent key = " << H[l] << ", ";
... | [
"literal.string.change",
"io.output.change"
] | 125,249 | 125,250 | u829912068 | cpp |
p02287 | #include "bits/stdc++.h"
#include <unordered_set>
#define REP(i, n) for (decltype(n) i = 0; i < (n); i++)
#define REP2(i, x, n) for (decltype(x) i = (x); i < (n); i++)
#define REP3(i, x, n) for (decltype(x) i = (x); i <= (n); i++)
#define RREP(i, n) for (decltype(n) i = (n)-1; i >= 0; i--)
#define ALL(a) (a).begin(),... | #include "bits/stdc++.h"
#include <unordered_set>
#define REP(i, n) for (decltype(n) i = 0; i < (n); i++)
#define REP2(i, x, n) for (decltype(x) i = (x); i < (n); i++)
#define REP3(i, x, n) for (decltype(x) i = (x); i <= (n); i++)
#define RREP(i, n) for (decltype(n) i = (n)-1; i >= 0; i--)
#define ALL(a) (a).begin(),... | [
"literal.string.change",
"io.output.change"
] | 125,259 | 125,260 | u452958267 | 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 <<... | [
"literal.string.change",
"io.output.change"
] | 125,261 | 125,262 | u927516039 | cpp |
p02287 | #include <iostream>
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(void) {
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 <iostream>
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(void) {
int H, i, A[MAX + 1];
cin >> H;
for (i = 1; i <= H; i++) {
cin >> A[i];
}
for (i = 1; i <= H; i++) {
cout << ... | [
"io.output.change"
] | 125,263 | 125,264 | u699373030 | cpp |
p02287 | #include <iostream>
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(void) {
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 <iostream>
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(void) {
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,265 | 125,264 | u699373030 | cpp |
p02287 | #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 500001
int A[N], n;
int par(int i) { return i / 2; }
int lef(int i) { return i * 2; }
int rig(int i) { return i *... | #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 500001
int A[N], n;
int par(int i) { return i / 2; }
int lef(int i) { return i * 2; }
int rig(int i) { return i *... | [
"literal.string.change",
"io.output.change"
] | 125,275 | 125,276 | u922538592 | cpp |
p02287 | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define irep(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define FOR(i, m, n) for (int i = int(m); i < (int)(n); i++)
using namespace std;
// namespace utils
namespace utils {
template <typename T> void print(vector<vector<T>> mat) {
rep... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define irep(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define FOR(i, m, n) for (int i = int(m); i < (int)(n); i++)
using namespace std;
// namespace utils
namespace utils {
template <typename T> void print(vector<vector<T>> mat) {
rep... | [
"literal.string.change",
"io.output.change"
] | 125,281 | 125,282 | u910106747 | cpp |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.