s_id
string
p_id
string
u_id
string
date
string
language
string
original_language
string
filename_ext
string
status
string
cpu_time
string
memory
string
code_size
string
code
string
error
string
stdout
string
s913592298
p02281
u626266743
1511268069
Python
Python3
py
Runtime Error
0
0
722
n = int(input()) tree = [None for i in range(n)] root = set(range(n)) for i in range(n): i, l, r = map(int, input().split()) left[i] = l right[i] = r root -= {1, r} def preorder(i): if (i == -1): return print(" {}".format(i), end = "") preorder(left[i]) preorder(right[i]) ...
Traceback (most recent call last): File "/tmp/tmpa_20f71o/tmp9c1btp8v.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s138941615
p02281
u626266743
1511268125
Python
Python3
py
Runtime Error
0
0
785
n = int(input()) tree = [None for i in range(n)] root = set(range(n)) for i in range(n): i, l, r = map(int, input().split()) left[i] = l right[i] = r root -= {1, r} def preorder(i): if (i == -1): return (l, r) = tree[i] print(" {}".format(i), end = "") preorder(left[i]) pre...
Traceback (most recent call last): File "/tmp/tmp3iksa2qw/tmppq5eta7q.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s618567103
p02281
u626266743
1511268222
Python
Python3
py
Runtime Error
0
0
756
n = int(input()) left = [None for i in range(n)] right = [None for i in range(n)] root = set(range(n)) for i in range(n): i, l, r = map(int, input().split()) left[i] = l right[i] = r root -= (1 + r) def preorder(i): if (i == -1): return print(" {}".format(i), end = "") preorder(lef...
Traceback (most recent call last): File "/tmp/tmpo1jt63f4/tmpz7_roks0.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s704750874
p02281
u626266743
1511268270
Python
Python3
py
Runtime Error
0
0
756
n = int(input()) left = [None for i in range(n)] right = [None for i in range(n)] root = set(range(n)) for i in range(n): i, l, r = map(int, input().split()) left[i] = l right[i] = r root -= (l + r) def preorder(i): if (i == -1): return print(" {}".format(i), end = "") preorder(lef...
Traceback (most recent call last): File "/tmp/tmp87u0vwuv/tmpv1qyztd9.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s157419660
p02281
u626266743
1511268337
Python
Python3
py
Runtime Error
0
0
756
n = int(input()) left = [None for i in range(n)] right = [None for i in range(n)] root = set(range(n)) for i in range(n): i, l, r = map(int, input().split()) left[i] = l right[i] = r root -= (l + r) def Preorder(i): if (i == -1): return print(" {}".format(i), end = "") Preorder(lef...
Traceback (most recent call last): File "/tmp/tmpdp0dpx4z/tmpatoczhhf.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s904397671
p02281
u626266743
1511268406
Python
Python3
py
Runtime Error
0
0
756
n = int(input()) left = [None for i in range(n)] right = [None for i in range(n)] root = sum(range(n)) for i in range(n): i, l, r = map(int, input().split()) left[i] = l right[i] = r root -= (l + r) def Preorder(i): if (i == -1): return print(" {}".format(i), end = "") Preorder(lef...
Traceback (most recent call last): File "/tmp/tmpdyxcbarl/tmpbp3oiik8.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s806470884
p02281
u424457654
1511277455
Python
Python3
py
Runtime Error
0
0
694
n = int(input()) left = [None for i in range(n)] right = [None for i in range(n)] root = set(range(n)) for i in range(n): i, l, r = map(int, input().split()) left[i] = l right[i] = r root -= {l, r} def Preorder(i): if i == -1: return print(" {}".format(i), end = "") Preorder(left[i...
Traceback (most recent call last): File "/tmp/tmpagm9vkn5/tmpkk5wjufc.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s225573518
p02281
u424457654
1511277580
Python
Python3
py
Runtime Error
0
0
794
n = int(input()) left = [None for i in range(n)] right = [None for i in range(n)] root = set(range(n)) for i in range(n): i, l, r = map(int, input().split()) left[i] = l right[i] = r root -= {l, r} def Preorder(i): if i == -1: return (l, r) = tree[i] print(" {}".format(i), end = ""...
Traceback (most recent call last): File "/tmp/tmp3a_qo3_z/tmprw2xn6d1.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s215454602
p02281
u424457654
1511277644
Python
Python3
py
Runtime Error
0
0
825
n = int(input()) left = [None for i in range(n)] right = [None for i in range(n)] root = set(range(n)) for i in range(n): i, l, r = map(int, input().split()) left[i] = l right[i] = r root -= {l, r} root_n = root.pop() def Preorder(i): if i == -1: return (l, r) = tree[i] print(...
Traceback (most recent call last): File "/tmp/tmp36_tn_0_/tmp3ghp3ue5.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s281438885
p02281
u424457654
1511277859
Python
Python3
py
Runtime Error
0
0
762
n = int(input()) left = [None for _ in range(n)] right = [None for _ in range(n)] root = set(range(n)) for i in range(n): i, l, r = map(int, input().split()) left[i] = l right[i] = r root -= {l, r} root_n = root.pop() def Preorder(i): if i == -1: return print(" {}".format(i), end ...
Traceback (most recent call last): File "/tmp/tmp5wfsf4r2/tmpn4qg96wx.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s021139801
p02281
u150984829
1519145436
Python
Python3
py
Runtime Error
0
0
371
def p(u): if u+1:print(s,u,end=s);p(T[u]);p(T[u+N]) def i(u): if u+1:i(T[u]);print(s,u,end=s);i(T[u+N]) def o(u): if u+1:o(T[u]);o(T[u+N]);print(s,u,end=s) s,o='','order' N=int(input()) T=[0,0]*N R=set(range(N)) for _ in[0]*N: a,b,c=map(int,input().split()) T[a],T[a+N]=b,c R-={b,c} r=R.pop() print('Pre'+o) p(r) p...
Traceback (most recent call last): File "/tmp/tmpfyjwhm0t/tmpkm041dxy.py", line 8, in <module> N=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s060925120
p02281
u912143677
1521842159
Python
Python3
py
Runtime Error
0
0
795
NIL = -1 class Node: parent = NIL left = NIL right = NIL n = int(input()) t = [Node for i in range(n)] for i in range(n): tmp = list(map(int, input().split())) if tmp[1] != -1: t[i].left = tmp[1] t[tmp[1]].parent = i if tmp[2] != -1: t[i].right = tmp[2] t[tmp[2...
Traceback (most recent call last): File "/tmp/tmp4quoyj1f/tmpj2cka2sc.py", line 8, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s726245600
p02281
u912143677
1521843736
Python
Python3
py
Runtime Error
0
0
858
NIL = -1 class Node: def __init__(self): self.parent = NIL self.left = NIL self.right = NIL n = int(input()) t = [Node() for i in range(n)] for i in range(n): tmp = list(map(int, input().split())) if tmp[1] != -1: t[i].left = tmp[1] t[tmp[1]].parent = i if tmp...
Traceback (most recent call last): File "/tmp/tmpatojqorn/tmpilxq5knl.py", line 10, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s593563405
p02281
u912143677
1521843879
Python
Python3
py
Runtime Error
0
0
878
NIL = -1 class Node: def __init__(self): self.parent = NIL self.left = NIL self.right = NIL n = int(input()) t = [Node() for i in range(n)] for i in range(n): tmp = list(map(int, input().split())) if tmp[1] != -1: t[i].left = tmp[1] t[tmp[1]].parent = i if tmp...
Traceback (most recent call last): File "/tmp/tmp2remcyg1/tmp0i_ocssg.py", line 10, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s823935385
p02281
u007270338
1529778379
Python
Python3
py
Runtime Error
0
0
1562
#coding:utf-8 N = int(input()) class Tree: def __init__(self, ID,p=-1): self.ID = ID def makeTree(self, tree): ID = tree.ID if ID == -1: return else: [ID,l,r] = trees[ID] tree.l = Tree(l) tree.r = Tree(r) treeL = tree....
Traceback (most recent call last): File "/tmp/tmp_5yh1v9x/tmp0omikmxu.py", line 2, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s783945505
p02281
u782850731
1380159757
Python
Python
py
Runtime Error
20
4340
1452
#!/usr/bin/env python from __future__ import division, print_function from sys import stdin class Node(object): def __init__(self): self.id = None self.parent = -1 self.childs = None def preorder_walk(data, index, out): node = data[index] out.append(node.id) for cidx in node....
Traceback (most recent call last): File "/tmp/tmptkcxmssg/tmp7o2kz_g6.py", line 40, in <module> n = int(stdin.readline()) ^^^^^^^^^^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: ''
s882684352
p02282
u805716376
1556808837
Python
Python3
py
Runtime Error
0
0
297
n = int(input()) pre = list(map(int, input().split())) ino = list(map(int, input().split())) d = [] root = pre[1] pre = iter(pre).__next__ def dfs(l, r): if l >= r: return c = pre() m = ino.index(c) dfs(l, m) dfs(m+1, r) d += [c] dfs(0, len(ino)) print(*c)
Traceback (most recent call last): File "/tmp/tmpik48rbai/tmpd9hc40uq.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s358572571
p02282
u805716376
1556808861
Python
Python3
py
Runtime Error
0
0
297
n = int(input()) pre = list(map(int, input().split())) ino = list(map(int, input().split())) d = [] root = pre[1] pre = iter(pre).__next__ def dfs(l, r): if l >= r: return c = pre() m = ino.index(c) dfs(l, m) dfs(m+1, r) d += [c] dfs(0, len(ino)) print(*d)
Traceback (most recent call last): File "/tmp/tmp35mrr5_z/tmp6d9oxmk8.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s448542251
p02282
u805716376
1556808922
Python
Python3
py
Runtime Error
20
5600
310
n = int(input()) pre = list(map(int, input().split())) ino = list(map(int, input().split())) d = [] root = pre[1] pre = iter(pre).__next__ def dfs(l, r): global d if l >= r: return c = pre() m = ino.index(c) dfs(l, m) dfs(m+1, r) d += [c] dfs(0, len(ino)) print(*d)
Traceback (most recent call last): File "/tmp/tmp193xz4su/tmplzu_4lfi.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s135645222
p02282
u881590806
1469449250
Python
Python
py
Runtime Error
10
6404
1090
def postorder(n,preorder,inorder): if len(preorder) > 1: left_inorder = [] right_inorder = [] flag = False for i in range(len(inorder)): if flag == False: if n == inorder[i]: flag = True else: left_in...
File "/tmp/tmp698eaftt/tmpb4cip9gv.py", line 27 print n, ^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s192067775
p02282
u159356473
1478849579
Python
Python3
py
Runtime Error
20
7764
448
#coding:UTF-8 def RoT(A,B,ans): if A: root=A[0] rindex=B.index(root) Aleft=A[1:rindex+1] Aright=A[rindex+1:] Bleft=B[:rindex] Bright=B[rindex:] RoT(Aleft,Bleft,ans) RoT(Aright,Bright,ans) ans.append(root) if __name__=="__ma...
Traceback (most recent call last): File "/tmp/tmptb1p4qog/tmp7ta68s8_.py", line 19, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s234426509
p02282
u742013327
1479114641
Python
Python3
py
Runtime Error
20
7768
1565
#http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_7_D def postorder(binary_tree, target_index, result): left = binary_tree[target_index]["left"] right = binary_tree[target_index]["right"] if not left == -1: postorder(binary_tree, left, result) if not right == -1: ...
Traceback (most recent call last): File "/tmp/tmp3hlre7zi/tmp9bm57e63.py", line 47, in <module> main() File "/tmp/tmp3hlre7zi/tmp9bm57e63.py", line 39, in main node_num = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s736108789
p02282
u742013327
1479115038
Python
Python3
py
Runtime Error
20
7808
1594
#http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_7_D def postorder(binary_tree, target_index, result): left = binary_tree[target_index]["left"] right = binary_tree[target_index]["right"] if not left == -1: postorder(binary_tree, left, result) if not right == -1: ...
Traceback (most recent call last): File "/tmp/tmph9__k1sz/tmpcb8ciptc.py", line 47, in <module> main() File "/tmp/tmph9__k1sz/tmpcb8ciptc.py", line 39, in main node_num = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s573211672
p02282
u603049633
1496319124
Python
Python3
py
Runtime Error
0
0
374
#Reconstruction of the Tree n = int(input()) pre = list(map(int,input().split())) ino = list(map(int,input().split())) post=[] i = -1 def recaonstruction(l, r): global i if l >= r: return i += 1 c = pre[i] m = ino.index(c) reconstruction(l, m) reconstruction(m+1, r) post.append(...
Traceback (most recent call last): File "/tmp/tmp45hmkp5j/tmp9ef_2j7p.py", line 2, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s404319648
p02282
u533883485
1499157741
Python
Python3
py
Runtime Error
0
0
658
# coding=utf-8 from collections import deque def reconstruction(left, right): global pre_order global in_order global post_order global n if left > right: return None elif left == right: root = pre_order.popleft() post_order.append(root) return None else: ...
Traceback (most recent call last): File "/tmp/tmpevbd_iu1/tmpj9w1ngzq.py", line 24, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s110495984
p02282
u533883485
1499157865
Python
Python3
py
Runtime Error
0
0
658
# coding=utf-8 from collections import deque def reconstruction(left, right): global pre_order global in_order global post_order global n if left > right: return None elif left == right: root = pre_order.popleft() post_order.append(root) return None else: ...
Traceback (most recent call last): File "/tmp/tmpd9roaz7j/tmpkkziclp0.py", line 24, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s114150247
p02282
u193453446
1502171861
Python
Python3
py
Runtime Error
0
0
1604
I = 0 L = 1 R = 2 P = 3 B = 4 D = 5 H = 6 def search(N, A, B, num): """ N ??? Nodes A???Preorder?????? B???Inorder?????? ??????????????????????????§??? root ??? index ????????? """ # print(A) # print(B) root = A[0] ld = num for i in range(num): if B[i] == root: ld = i ...
Traceback (most recent call last): File "/tmp/tmpg97p5u1c/tmpcnck5dkh.py", line 81, in <module> main() File "/tmp/tmpg97p5u1c/tmpcnck5dkh.py", line 57, in main num = int(input().strip()) ^^^^^^^ EOFError: EOF when reading a line
s341251132
p02282
u193453446
1502175299
Python
Python3
py
Runtime Error
0
0
1432
I = 0 L = 1 R = 2 P = 3 B = 4 D = 5 H = 6 def getidx(Tree,value): idx = -1 for i in range(len(Tree)): if Tree[i][I] == value: idx = i break return idx def search(Tree, A, B, num): """ Tree ??? Tree A???Preorder?????? B???Inorder?????? ??????????????????????????§...
File "/tmp/tmpv59dk45p/tmp7kf196zl.py", line 42 ef postorder(Tree, nidx, A): ^^^^^^^^^ SyntaxError: invalid syntax
s567997852
p02282
u024715419
1509957030
Python
Python3
py
Runtime Error
0
0
666
n = int(input()) tree = [None for i in range(n +1)] list_pre = list(map(int, input().split())) list_in = list(map(int, input().split())) def reconstruct(tree_pre, tree_in): if not tree_pre: return -1 root = tree_pre[0] idx = tree_in.index(root) tree[root] = (reconstruct(tree_pre[1:i + 1], tr...
Traceback (most recent call last): File "/tmp/tmp6kqzd531/tmpmwbvh6sk.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s420523179
p02282
u007270338
1529801548
Python
Python3
py
Runtime Error
30
5604
394
#coding:utf-8 N = int(input()) preList = "".join(list(input().split())) inList = "".join(list(input().split())) def recon(l,r): if l >= r: return global pos c = preList[pos] index = inList.find(c) pos += 1 recon(l,index) recon(index+1,r) global answer answer.append(c) ...
Traceback (most recent call last): File "/tmp/tmpacdlltkf/tmpcpi88s3m.py", line 2, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s924136271
p02283
u292798607
1531210169
Python
Python3
py
Runtime Error
0
0
1652
%%cython class Node: def __init__(self,x): self.key = x self.left = None self.right = None def insert(node, x): if node is None: return Node(x) elif x == node.key: return node elif x < node.key: node.left = insert(node.left, x) else: node.righ...
File "/tmp/tmp0hx3c0yi/tmp_v81_34u.py", line 1 %%cython ^ SyntaxError: invalid syntax
s567180540
p02283
u292798607
1531210371
Python
Python3
py
Runtime Error
0
0
1148
#include<cstdio> #include<cstdlib> #include<string> #include<iostream> 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 ...
File "/tmp/tmp2lduydj_/tmpadgbpgzc.py", line 5 using namespace std; ^^^^^^^^^ SyntaxError: invalid syntax
s585111046
p02283
u292798607
1531265327
Python
Python3
py
Runtime Error
0
0
2143
#include<cstdio> #include<cstdlib> #include<string> #include<vector> #include<iostream> using namespace std; struct Node { int key; Node *right, *left, *parent; }; Node *root,*NIL; bool exist = false; vector<bool> v; void insert(int k){ Node *y = NIL; Node *x = root; Node *z; z = (Node *)malloc(sizeof(N...
File "/tmp/tmpbau7wdci/tmp605o33h_.py", line 6 using namespace std; ^^^^^^^^^ SyntaxError: invalid syntax
s674206974
p02283
u269568674
1531739569
Python
Python3
py
Runtime Error
0
0
1253
class binaryTree: def __init__(self,key,p=None,l=None,r=None): self.key = key self.p = p self.l = l self.r = r N = int(input()) treelist = [list(input().split()) for i in range(N)] root = None def inorder(root): x = root if x == None: return inorder(x.l) ...
Traceback (most recent call last): File "/tmp/tmpd2jcy8go/tmprvg3han5.py", line 8, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s283594810
p02283
u798803522
1540187163
Python
Python3
py
Runtime Error
0
0
1945
from io import StringIO class BinaryTree: class Node: def __init__(self, key): self.key = key self.left = None self.right = None self.parent = None def __init__(self): self.root = None self.output = StringIO() def insert(self, key...
Traceback (most recent call last): File "/tmp/tmptdt7yev_/tmpvsfc75lw.py", line 64, in <module> for _ in range(length): ^^^^^^ NameError: name 'length' is not defined
s800103695
p02283
u798803522
1540187319
Python
Python3
py
Runtime Error
0
0
2003
class BinaryTree: from io import StringIO class Node: def __init__(self, key): self.key = key self.left = None self.right = None self.parent = None def __init__(self): self.root = None self.output = StringIO() def insert(se...
Traceback (most recent call last): File "/tmp/tmpgky3e0rw/tmp_rdvh839.py", line 62, in <module> length = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s014652690
p02283
u677096240
1546310854
Python
Python3
py
Runtime Error
20
5612
1694
class Node: key = None left = None right = None def __init__(self, k): self.key = k class BST: root = None def insert(self, k): x = self.root y = None z = Node(k) while x is not None: y = x if z.key < y.key: x = x.left elif y.key < z.key: x = x.right ...
Traceback (most recent call last): File "/tmp/tmp9z70n74h/tmpr48be1fa.py", line 55, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s818826327
p02283
u677096240
1546317825
Python
Python3
py
Runtime Error
0
0
1155
import re class Node: key = None left = None right = None def __init__(self, k): self.key = k class BST: root = None def insert(self, k): x = self.root y = None z = Node(k) while x is not None: y = x if z.key < y.key: x = x.left elif y.key < z.key: x =...
Traceback (most recent call last): File "/tmp/tmprpa0_eqn/tmptpzoelon.py", line 48, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s681834371
p02283
u805716376
1551268608
Python
Python3
py
Runtime Error
0
0
789
import copy def selection_sort(A,n): for i in range(n): minj = i for j in range(i,n): if A[j] < A[minj]: minj = j A[i],A[minj] = A[minj], A[i] return A n = int(input()) r = [0]*n for i in range(n): r[i] = input().split() for i in range(n): if r[i][0...
File "/tmp/tmp1ptxqezh/tmp0rxh3grz.py", line 34 print(" " + *selection_sort(a,len(a))) ^ SyntaxError: invalid syntax
s664363594
p02283
u805716376
1551281201
Python
Python3
py
Runtime Error
0
0
827
import copy def selection_sort(A,n): for i in range(n): minj = i for j in range(i,n): if A[j] < A[minj]: minj = j A[i],A[minj] = A[minj], A[i] return A n = int(input()) r = [0]*n for i in range(n): r[i] = input().split() for i in range(n): if r[i][0...
File "/tmp/tmpbsowutp5/tmpvpxavgn4.py", line 33 elif r ^ SyntaxError: expected ':'
s072390015
p02283
u799595944
1556582846
Python
Python3
py
Runtime Error
0
0
1982
class Node(): def __init__(self,id,value): self.id = id self.child = [None,None] self.parent = -1 self.value = value def addChild(self,child): self.child = child def setParent(self,parent): self.parent = parent nodes = {} def movePreorder(nodes,order,start...
Traceback (most recent call last): File "/tmp/tmpq12ipe3b/tmpo_apykfq.py", line 35, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s359816870
p02283
u799595944
1556582884
Python
Python3
py
Runtime Error
0
0
1982
class Node(): def __init__(self,id,value): self.id = id self.child = [None,None] self.parent = -1 self.value = value def addChild(self,child): self.child = child def setParent(self,parent): self.parent = parent nodes = {} def movePreorder(nodes,order,start...
Traceback (most recent call last): File "/tmp/tmp50yfm502/tmp0vl7bia0.py", line 35, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s563939583
p02283
u799595944
1556583039
Python
Python3
py
Runtime Error
0
0
1976
class Node(): def __init__(self,id,value): self.id = id self.child = [None,None] self.parent = -1 self.value = value def addChild(self,child): self.child = child def setParent(self,parent): self.parent = parent nodes = {} def movePreorder(nodes,order,start...
Traceback (most recent call last): File "/tmp/tmpfstw55lb/tmpji2dsit9.py", line 35, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s386802803
p02283
u799595944
1556583102
Python
Python3
py
Runtime Error
0
0
1976
class Node(): def __init__(self,id,value): self.id = id self.child = [None,None] self.parent = -1 self.value = value def addChild(self,child): self.child = child def setParent(self,parent): self.parent = parent nodes = {} def movePreorder(nodes,order,start...
Traceback (most recent call last): File "/tmp/tmptacgrmy0/tmp4ne4j2f7.py", line 35, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s812904803
p02283
u805716376
1556850686
Python
Python3
py
Runtime Error
0
0
750
class Node(): def __init__(self, key): self.key = key self.left = self.right = None def insert(key): global root x = root y = None while x:x, y = x.left if key < x.key else x.right , x if y == None:root = Node(key) elif y.key < key:y.right = Node(key) else:y.lef...
File "/tmp/tmp3_gtjrp_/tmp52zt872r.py", line 32 ino(root);print('');pre(root)print() ^^^^^ SyntaxError: invalid syntax
s620438108
p02283
u799595944
1558995089
Python
Python3
py
Runtime Error
0
0
1976
class Node(): def __init__(self,id,value): self.id = id self.child = [None,None] self.parent = -1 self.value = value def addChild(self,child): self.child = child def setParent(self,parent): self.parent = parent nodes = {} def movePreorder(nodes,order,start...
Traceback (most recent call last): File "/tmp/tmp31716wmr/tmprer7n1qe.py", line 35, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s807323550
p02283
u284474275
1424399495
Python
Python
py
Runtime Error
0
0
1221
import sys class TreeNode: def __init__(self, val): self.val = val self.left = self.right = None class BST: def __init__(self): self.root = None def insert(self, node): def helper(root): if root is None: root = node elif node.val...
File "/tmp/tmpb4dajetu/tmp0i4oofqr.py", line 41 print ' '.join(map(lambda x: str(x), bst.inorder())) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s029665875
p02283
u024599888
1433055076
Python
Python
py
Runtime Error
0
0
1366
import sys class Node: def __init__(self, key): self.key = key self.right = None self.left = None def insert(T, z): #z is node which you would like to insert #initialization y = ...
File "/tmp/tmph76p6tp7/tmpvjbqeyss.py", line 26 y.left = z TabError: inconsistent use of tabs and spaces in indentation
s377854157
p02283
u024599888
1433055937
Python
Python3
py
Runtime Error
0
0
1437
import sys #run by python3 class Node: def __init__(self, key): self.key = key self.right = None self.left = None def insert(T, z): #z is node which you would like to insert #initializati...
File "/tmp/tmpyioh4zvt/tmpng4plzqb.py", line 7 self.key = key TabError: inconsistent use of tabs and spaces in indentation
s198270470
p02283
u024599888
1433056224
Python
Python3
py
Runtime Error
0
0
1138
import sys class Node: def __init__(self, key): self.key = key self.right = None self.left = None def insert(T, z): y = None x = T ...
File "/tmp/tmp678yjbj3/tmpefrzyyeb.py", line 5 self.key = key TabError: inconsistent use of tabs and spaces in indentation
s772735416
p02283
u024599888
1433056388
Python
Python3
py
Runtime Error
0
0
391
def preorder_walk(node): print ('', node.key,end='') if node.left: preorder_walk(node.left) if node.right: preorder_walk(node.right) T = None num = int(sys.stdin.readline()) for _ in range(num): cmd = sys.stdin.readline() if(cmd.startswith('i')): n = Node(int(cmd[7:])) T = insert(T, n...
File "/tmp/tmp1q0xslip/tmpyqikx_bw.py", line 7 preorder_walk(node.right) TabError: inconsistent use of tabs and spaces in indentation
s560710215
p02283
u024599888
1433056399
Python
Python
py
Runtime Error
0
0
391
def preorder_walk(node): print ('', node.key,end='') if node.left: preorder_walk(node.left) if node.right: preorder_walk(node.right) T = None num = int(sys.stdin.readline()) for _ in range(num): cmd = sys.stdin.readline() if(cmd.startswith('i')): n = Node(int(cmd[7:])) T = insert(T, n...
File "/tmp/tmpihym4rzc/tmpc16l48f3.py", line 7 preorder_walk(node.right) TabError: inconsistent use of tabs and spaces in indentation
s604133085
p02283
u024599888
1433056831
Python
Python
py
Runtime Error
0
0
1606
#!/usr/bin/env python3 import sys #run by python3 class Node: def __init__(self, key): self.key = key self.right = None self.left = None def ins...
File "/tmp/tmplj2l2t7i/tmp2dixsjfw.py", line 48 preorder_walk(node.right) TabError: inconsistent use of tabs and spaces in indentation
s078880866
p02283
u024599888
1433056890
Python
Python3
py
Runtime Error
0
0
1682
#!/usr/bin/env python3 import sys #run by python3 class Node: def __init__(self, key): self.key = key self.right = None self.left = None def ins...
File "/tmp/tmps58eeo90/tmpyaoqifa0.py", line 41 inorder_walk(node.right) TabError: inconsistent use of tabs and spaces in indentation
s950798353
p02283
u024599888
1433057080
Python
Python3
py
Runtime Error
0
0
654
def inorder_walk(node): if node.left: inorder_walk(node.left) print ('', node.key, end='') if node.right: inorder_walk(node.right) def preorder_walk(node): print ('', node.key,end='') if node.left: preorder_walk(node.left) if node.right: preorder_walk(node.right) if __name__...
File "/tmp/tmpynbcmo_y/tmp0hp2cay5.py", line 6 inorder_walk(node.right) TabError: inconsistent use of tabs and spaces in indentation
s549836942
p02283
u024599888
1433057142
Python
Python3
py
Runtime Error
0
0
1743
File Edit Options Buffers Tools Python Help #!/usr/bin/env python3 #run by python3 class Node: def __init__(self, key): ...
File "/tmp/tmp4rjuts0p/tmpx4pycbt_.py", line 1 File Edit Options Buffers Tools Python Help ^^^^ SyntaxError: invalid syntax
s186825785
p02283
u024599888
1433057157
Python
Python3
py
Runtime Error
0
0
1651
#!/usr/bin/env python3 #run by python3 class Node: def __init__(self, key): self.key = key self.right = None self.left = None def insert(T, z): #...
File "/tmp/tmp0no1hdu0/tmpsjywo_9w.py", line 25 T = z TabError: inconsistent use of tabs and spaces in indentation
s057807890
p02283
u024599888
1433057205
Python
Python3
py
Runtime Error
0
0
1497
#!/usr/bin/env python3 class Node: def __init__(self, key): self.key = key self.right = None self.left = None def insert(T, z): #initialization ...
File "/tmp/tmpajeisx4v/tmp3idzmyhr.py", line 24 T = z TabError: inconsistent use of tabs and spaces in indentation
s644916446
p02283
u567281053
1460795103
Python
Python
py
Runtime Error
0
0
1387
import sys class binarySearchTree: def __init__(self): self.root = None def insert(self, key): z = Node(key) y = None x = self.root while x: y = x if z.key < x.key: x = x.left else: x = x.right ...
File "/tmp/tmp7vgpzjux/tmpckxspl24.py", line 26 print self.root.inorderTreeWalk() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s312998993
p02283
u567281053
1460796549
Python
Python
py
Runtime Error
0
0
1227
import sys class binarySearchTree: def __init__(self): self.root = None def insert(self, key): z = Node(key) y = None x = self.root while x: y = x if z.key < x.key: x = x.left else: x = x.right ...
File "/tmp/tmp451zlx6l/tmp7f9a48lc.py", line 26 print inorderTreeWalk(self.root) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s127188054
p02283
u567281053
1460817958
Python
Python
py
Runtime Error
0
0
1035
import sys import time class Node: def __init__(self, key = None): self.key = key self.left = None self.right = None def insert(key): global root z = Node(key) y = None x = root while x: y = x if z.key < x.key: x = x.left else: ...
File "/tmp/tmpzmlso6k7/tmpw_r118bi.py", line 48 print inorderTreeWalk(root) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s103629490
p02283
u567281053
1460818919
Python
Python
py
Runtime Error
0
0
1202
import sys import time class Node: def __init__(self, key): self.key = key self.parent = None self.left = None self.right = None def insert(key, z): global root y = None x = root while x: y = x if z.key < x.key: x = x.left else: ...
File "/tmp/tmp1ts13kzt/tmpitkr5hzo.py", line 55 print " " + " ".join(map(str, In)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s202071722
p02283
u742013327
1480313827
Python
Python3
py
Runtime Error
40
7744
1382
#http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_8_A #???????????? def insert(root, insert_node): focus_node = root parent = None while not focus_node == None: parent = focus_node if focus_node["data"] > insert_node["data"]: focus_node = focus_node["left"] ...
Traceback (most recent call last): File "/tmp/tmp1yi0o256/tmp3e_r3d2q.py", line 55, in <module> main() File "/tmp/tmp1yi0o256/tmp3e_r3d2q.py", line 43, in main n_line = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s005104551
p02283
u112247126
1487673571
Python
Python3
py
Runtime Error
0
0
1381
import sys class Node(): def __init__(self, key): self.key = key self.left = None self.right = None self.parent = None def prewalk(self): nodeList = [self.key] if self.left: nodeList += self.left.prewalk() if self.right: nodeList ...
s573461463
p02283
u462831976
1489795829
Python
Python3
py
Runtime Error
0
0
4760
# -*- coding: utf-8 -*- import random class Tree: def __init__(self): self.root = None def __str__(self): if self.root == None: return None else: return "TODO" def print_inorder(self): self.__inorder(self.root) def __inorder(self, node): ...
Traceback (most recent call last): File "/tmp/tmpyc05t5of/tmp_9e2z6pe.py", line 174, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s168537355
p02283
u462831976
1489804226
Python
Python3
py
Runtime Error
40
11672
5113
# -*- coding: utf-8 -*- import random import sys import os class Tree: def __init__(self): self.root = None def __str__(self): if self.root == None: return None else: return "TODO" def print_inorder(self): self.inorder_list = [] self.__ino...
Traceback (most recent call last): File "/tmp/tmp55u1lsru/tmparselldq.py", line 181, in <module> s = input() ^^^^^^^ EOFError: EOF when reading a line
s870356863
p02283
u426534722
1491180791
Python
Python3
py
Runtime Error
30
7740
800
class Node(): key = 0 l = None r = None def __init__(self, key): self.key = key T = [] * int(5e6) def insert(z): if z == 0: return y = None x = 0 while x is not None: y = x x = (T[x].l if T[z].key < T[x].key else T[x].r) if T[z].key < T[y].key: T[y].l = z ...
Traceback (most recent call last): File "/tmp/tmp8jogxhx5/tmp5hcq_19_.py", line 27, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s416566935
p02283
u603049633
1496322087
Python
Python3
py
Runtime Error
0
0
1160
# Binary Search Tree1 class BinaryTree(): def __init__(self): self.key = None self.parent = None self.left = None self.right = None def insert(z): global root y = None x = root while(x != None): y = x if z.key < x.key: x = x.left e...
File "/tmp/tmp7594i093/tmpdpbv464f.py", line 28 if x == No???e: return ^ SyntaxError: invalid syntax
s336896183
p02283
u603049633
1496322126
Python
Python3
py
Runtime Error
0
0
1160
# Binary Search Tree1 class BinaryTree(): def __init__(self): self.key = None self.parent = None self.left = None self.right = None def insert(z): global root y = None x = root while(x != None): y = x if z.key < x.key: x = x.left e...
File "/tmp/tmpthkofhxw/tmpd64wm0a6.py", line 28 if x == No???e: return ^ SyntaxError: invalid syntax
s642485871
p02283
u603049633
1496323089
Python
Python3
py
Runtime Error
0
0
1086
class BinaryTree(): def __init__(self): self.key = None self.parent = None self.left = None self.right = None def insert(z): global root y = None x = root while(x != None): y = x if z.key < x.key: x = x.left else: x = x...
File "/tmp/tmpeq89xpbv/tmp7e8x4kbn.py", line 27 if x == No???e: return [] ^ SyntaxError: invalid syntax
s653538229
p02283
u603049633
1496323202
Python
Python3
py
Runtime Error
0
0
1085
class BinaryTree(): def __init__(self): self.key = None self.parent = None self.left = None self.right = None def insert(z): global root y = None x = root while x != None: y = x if z.key < x.key: x = x.left else: x = x....
File "/tmp/tmpl2xlxsol/tmpfk0_ibvz.py", line 27 if x == No???e: return [] ^ SyntaxError: invalid syntax
s088783784
p02283
u491916705
1502512102
Python
Python
py
Runtime Error
0
0
2157
class Node(): def __init__(self, id, left=-1, right=-1, parent=-1): self.id = id self.left = left self.right = right self.parent = parent def show(self): print 'node %d: parent = %d, left = %d, right = %d' % (self.id, self.parent, self.left, self.right) class Stack(): ...
File "/tmp/tmpg02lozbx/tmp0b3mznv8.py", line 8 print 'node %d: parent = %d, left = %d, right = %d' % (self.id, self.parent, self.left, self.right) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you me...
s305386069
p02283
u939814144
1503158543
Python
Python3
py
Runtime Error
0
0
1833
class Node(): def __init__(self, key): self.key = key self.left = None self.right = None self.parent = None class BinarySearchTree(): def __init__(self): self.root = None def insert(self, key): root_node = self.root insert_node = Node(key) p...
File "/tmp/tmpl93ohyde/tmpft5nsp_l.py", line 57 print(' ' + *self.show_inorder(self.root)) ^ SyntaxError: invalid syntax
s443580935
p02283
u798803522
1512402695
Python
Python3
py
Runtime Error
0
0
1855
with open("test.txt", "r") as f: class BinarySearchTree: def __init__(self): self.root = None def insert(self, x): node = self.Node(x) if self.root is None: self.root = node else: here = self.root # ...
/tmp/tmph0d6907q/tmppqndgukp.py:26: SyntaxWarning: "is" with a literal. Did you mean "=="? if address is "root": /tmp/tmph0d6907q/tmppqndgukp.py:35: SyntaxWarning: "is" with a literal. Did you mean "=="? if address is "root": Traceback (most recent call last): File "/tmp/tmph0d6907q/tmppqndgukp.py", line 1, in <m...
s502099647
p02283
u798803522
1512402722
Python
Python3
py
Runtime Error
0
0
1602
class BinarySearchTree: def __init__(self): self.root = None def insert(self, x): node = self.Node(x) if self.root is None: self.root = node else: here = self.root # temp = None while here is not None: t...
/tmp/tmprgmbtva2/tmp30r75xg7.py:25: SyntaxWarning: "is" with a literal. Did you mean "=="? if address is "root": /tmp/tmprgmbtva2/tmp30r75xg7.py:34: SyntaxWarning: "is" with a literal. Did you mean "=="? if address is "root": Traceback (most recent call last): File "/tmp/tmprgmbtva2/tmp30r75xg7.py", line 48, in <...
s911339157
p02283
u150984829
1519492343
Python
Python3
py
Runtime Error
0
0
1124
import sys class Node: __slots__ = ['key', 'left', 'right'] def __init__(self, key): self.key = key self.left = None self.right = None class BST: def __init__(self): self.root = None def insert(self, key): x = self.root y = None z = Node(key) ...
Traceback (most recent call last): File "/tmp/tmpjm3fthq9/tmpy5mkrgqs.py", line 43, in <module> input() EOFError: EOF when reading a line
s532432716
p02283
u150984829
1519493578
Python
Python3
py
Runtime Error
0
0
911
import sys class Node: __slots__ = ['key', 'left', 'right'] def __init__(self, key): self.key = key self.left = self.right = None class BST: def __init__(self): self.root = None def insert(self, key): x, y = self.root, None while x != None: x, y = x.left if key ...
Traceback (most recent call last): File "/tmp/tmp2o5zzp84/tmp9doyl1ly.py", line 27, in <module> input() EOFError: EOF when reading a line
s208113231
p02283
u150984829
1519493621
Python
Python3
py
Runtime Error
0
0
911
import sys class Node: __slots__ = ['key', 'left', 'right'] def __init__(self, key): self.key = key self.left = self.right = None class BST: def __init__(self): self.root = None def insert(self, key): x, y = self.root, None while x != None: x, y = x.left if key ...
Traceback (most recent call last): File "/tmp/tmp52vz2c54/tmpcngf7rgx.py", line 27, in <module> input() EOFError: EOF when reading a line
s967276402
p02283
u724548524
1525403009
Python
Python3
py
Runtime Error
0
0
828
import sys class Node(): __slots__ = ['key', 'left', 'right'] def __init__(self, key): self.key = key self.left, self.right = None root = None def insert(z): global root x, y = root, None while x: y = x if z < x.key: x = x.left else: ...
Traceback (most recent call last): File "/tmp/tmplugwf5np/tmp03pfw8r7.py", line 33, in <module> input() EOFError: EOF when reading a line
s205629382
p02283
u724548524
1525403028
Python
Python3
py
Runtime Error
0
0
822
import sys class Node(): __slots__ = ['key', 'left', 'right'] def __init__(self, key): self.key = key self.left, self.right = None root = None def insert(z): global root x, y = root, None while x: y = x if z < x.key: x = x.left else: ...
Traceback (most recent call last): File "/tmp/tmpuk3i5lwn/tmpy03izcx1.py", line 33, in <module> input() EOFError: EOF when reading a line
s695690316
p02283
u724548524
1525403037
Python
Python3
py
Runtime Error
0
0
821
import sys class Node(): __slots__ = ['key', 'left', 'right'] def __init__(self, key): self.key = key self.left, self.right = None root = None def insert(z): global root x, y = root, None while x: y = x if z < x.key: x = x.left else: ...
File "/tmp/tmpkq0o5lva/tmp0yavqp0v.py", line 41 insert(int(s[7:]) ^ SyntaxError: '(' was never closed
s704164289
p02283
u724548524
1525403067
Python
Python3
py
Runtime Error
0
0
822
import sys class Node(): __slots__ = ['key', 'left', 'right'] def __init__(self, key): self.key = key self.left, self.right = None root = None def insert(z): global root x, y = root, None while x: y = x if z < x.key: x = x.left else: ...
Traceback (most recent call last): File "/tmp/tmpk53j525n/tmp04dbw3i_.py", line 33, in <module> input() EOFError: EOF when reading a line
s344393163
p02283
u126478680
1526904012
Python
Python3
py
Runtime Error
0
0
2268
from collections import deque from enum import Enum, auto class BinaryTreeNode(): __slots__ = ['left', 'right', 'val'] def __init__(self, left=None, right=None, val=None): self.left = left self.right = right self.val = val class BinarySearchTree(): def __init__(self): self....
Traceback (most recent call last): File "/tmp/tmpswu_scsn/tmp5kazi23y.py", line 71, in <module> m = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s561799819
p02283
u126478680
1526904508
Python
Python3
py
Runtime Error
30
6344
2292
from collections import deque from enum import Enum, auto class BinaryTreeNode(): __slots__ = ['left', 'right', 'val'] def __init__(self, left=None, right=None, val=None): self.left = left self.right = right self.val = val class BinarySearchTree(): def __init__(self): self....
Traceback (most recent call last): File "/tmp/tmpjfunivg0/tmpb0edhmi8.py", line 71, in <module> m = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s261151222
p02283
u404682284
1528281866
Python
Python3
py
Runtime Error
0
0
2824
class NullNode(): def __init__(self): self.id = None class Node(): def __init__(self, id): self.id = id self.parent = NullNode() self.left = NullNode() self.right = NullNode() def preorder(node, out_list=[]): if node.id is not None: out_list.append(str(node....
Traceback (most recent call last): File "/tmp/tmp5c_3wj15/tmphzyrhfxx.py", line 81, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s233038328
p02283
u318430977
1528995477
Python
Python3
py
Runtime Error
0
0
687
def reconstruct(pre_list, in_list): if len(pre_list) <= 1: return pre_list now = pre_list[0] split_place = in_list.index(now) pre_left = pre_list[1:split_place + 1] in_left = in_list[0:split_place] pre_right = pre_list[split_place + 1:] in_right = in_list[split_place + 1:] return...
Traceback (most recent call last): File "/tmp/tmp87dqqkok/tmpvbspg73i.py", line 18, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s229440462
p02284
u798803522
1540187834
Python
Python3
py
Runtime Error
0
0
2430
from io import StringIO class BinaryTree: class Node: def __init__(self, key): self.key = key self.left = None self.right = None self.parent = None def __init__(self): self.root = None self.output = StringIO() def insert(self, key)...
Traceback (most recent call last): File "/tmp/tmptrouagz1/tmp38361mgb.py", line 77, in <module> length = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s203806655
p02284
u798803522
1540187915
Python
Python3
py
Runtime Error
0
0
2423
from io import StringIO class BinaryTree: class Node: def __init__(self, key): self.key = key self.left = None self.right = None self.parent = None def __init__(self): self.root = None self.output = StringIO() def insert(self, key)...
Traceback (most recent call last): File "/tmp/tmp899n_0_r/tmpjy_j7pod.py", line 77, in <module> length = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s703531704
p02284
u798803522
1540188008
Python
Python3
py
Runtime Error
0
0
2423
from io import StringIO class BinaryTree: class Node: def __init__(self, key): self.key = key self.left = None self.right = None self.parent = None def __init__(self): self.root = None self.output = StringIO() def insert(self, key)...
Traceback (most recent call last): File "/tmp/tmpvkhr1jtv/tmpffeu84e6.py", line 77, in <module> length = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s215648082
p02284
u130979865
1460172044
Python
Python
py
Runtime Error
0
0
1361
# -*- coding: utf-8 -*- class Node_Class(): def __init__(self, key, parent, left, right): self.key = key self.parent = parent self.left = left self.right = right def insert(z): global root y = None x = root while x != None: y = x if z.key < x.key: ...
File "/tmp/tmpnd9coaa5/tmpepzxacgp.py", line 33 print "yes" ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s574410279
p02284
u684241248
1528193020
Python
Python3
py
Runtime Error
0
0
2004
class Tree: def __init__(self, orders): self.root = None for order in orders: if len(order) == 1: self.inorder_print() self.preorder_print() else: if len(order[0]) == 4: self.find(int(order[1])) ...
Traceback (most recent call last): File "/tmp/tmpf_s_z777/tmp9x22j2ck.py", line 84, in <module> m = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s708922663
p02284
u912237403
1373888572
Python
Python
py
Runtime Error
0
0
1151
import sys tree={} np = -1 home=0 tree[home]=[None, None, None] def search(p, x): while p != None: tmp = tree[p] if tmp[0] == x: return True if x < tmp[0]: p = tmp[1] else: p = tmp[2] return False def node(x): global np np += 1 tree[np] = [...
File "/tmp/tmpa48f9d5i/tmp7nova1dg.py", line 52 if search(0,int(s[5:])): print 'yes' ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s803992963
p02285
u597769560
1551539244
Python
Python3
py
Runtime Error
20
5648
2368
# -*- coding: utf-8 -*- """ Created on Sat Mar 2 17:11:49 2019 @author: Yamazaki Kenichi """ m = int(input()) A = [list(input().split()) for i in range(m)] T = [[-1,-1,-1,-1]] def insert(T,u,x): if T[0][3] == -1: T[0][3] = x return if x < T[u][3]: if T[u][1] == -1: T[u][1...
Traceback (most recent call last): File "/tmp/tmpy7zx4l4h/tmp3b0kuxvo.py", line 8, in <module> m = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s830438275
p02285
u357267874
1556281307
Python
Python3
py
Runtime Error
20
5620
4456
class Node: def __init__(self, key): self.key = key self.parent = None self.left = None self.right = None class Tree: def __init__(self): self.root = None self.inorder = [] self.preorder = [] def insert(self, node): p = None x = self....
Traceback (most recent call last): File "/tmp/tmp53hgapzn/tmp398ks248.py", line 133, in <module> m = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s224309963
p02285
u357267874
1556328066
Python
Python3
py
Runtime Error
20
5624
4409
class Node: def __init__(self, key): self.key = key self.parent = None self.left = None self.right = None class Tree: def __init__(self): self.root = None self.inorder = [] self.preorder = [] def insert(self, node): p = None x = self....
Traceback (most recent call last): File "/tmp/tmpbmf44lx_/tmp3ahggh0k.py", line 131, in <module> m = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s847618281
p02285
u357267874
1556336570
Python
Python3
py
Runtime Error
30
5624
5022
class Node: def __init__(self, key): self.key = key self.parent = None self.left = None self.right = None class Tree: def __init__(self): self.root = None self.inorder = [] self.preorder = [] def insert(self, node): p = None x = self....
Traceback (most recent call last): File "/tmp/tmpu0855l1b/tmphreyvbo1.py", line 136, in <module> m = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s127995951
p02285
u567380442
1421931241
Python
Python3
py
Runtime Error
30
6828
2327
import sys class Tree(): def __init__(self): self.root = None def insert(self, key): z = Node(key) y = None x = self.root while x: y = x if z.key < x.key: x = x.left else: x = x.right z.parent = y...
s713087730
p02285
u882992966
1442416090
Python
Python3
py
Runtime Error
20
7804
5041
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_8_A&lang=jp # cat alds1_8_c.txt | ./alds1_8_c.py import sys class Node(object): def __init__(self, key=None, parent=None): self.key = key self.parent = parent self.left = None ...
s111020150
p02285
u669284080
1446889127
Python
Python
py
Runtime Error
10
6620
2403
from __future__ import print_function from sys import stdin class Node: def __init__(self, id): self.id = id self.left = None self.right = None self.parent = None def preorder_tree_walk(root): print('', root.id, end='') if root.left != None: preorder_tree_walk(root.l...
Traceback (most recent call last): File "/tmp/tmpx68huxpz/tmpz28x5fdh.py", line 94, in <module> n = int(raw_input()) ^^^^^^^^^ NameError: name 'raw_input' is not defined
s136709154
p02285
u881590806
1449657318
Python
Python
py
Runtime Error
10
6372
2406
def insert(tree,k): y = None x = tree z = {'key':k, 'parent':None, 'left':None, 'right':None} while x != None: y = x if x['key'] > k: x = x['left'] else: x = x['right'] z['parent'] = y if y == None: tree = z elif y['key'] > k: y...
File "/tmp/tmp6_dui1_f/tmp_95utzeh.py", line 84 print x['key'], ^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?