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
s560163810
p02285
u881590806
1449668448
Python
Python
py
Runtime Error
10
6392
2175
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/tmpywsb74ok/tmpib0w25l8.py", line 75 print x['key'], ^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s679489398
p02285
u797673668
1454182412
Python
Python3
py
Runtime Error
30
7768
2282
class Tree: root = None def insert(self, node): y = None x = self.root while x: y = x x = x.left if node.key < x.key else x.right node.parent = y if not y: self.root = node elif node.key < y.key: y.left = node ...
Traceback (most recent call last): File "/tmp/tmpobsqtry4/tmpgu607pvf.py", line 82, in <module> m = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s247645851
p02285
u247976584
1455382247
Python
Python3
py
Runtime Error
20
7892
2579
class BinarySearchTree: root = None def insert(self, k): y = None x = self.root z = Node(k) while x: y = x if z.k < x.k: x = x.l else: x = x.r z.p = y if y == None: self.root...
Traceback (most recent call last): File "/tmp/tmpwqzq8ajk/tmp0xsuri_u.py", line 94, in <module> n = int(input().rstrip()) ^^^^^^^ EOFError: EOF when reading a line
s387900155
p02285
u342312206
1463422152
Python
Python3
py
Runtime Error
80
7776
5512
import sys import os class Node: def __init__(self, value): self.value = value self.left = None self.right = None def insert_node(self, node): if node.value <= self.value: if self.left is None: self.left = node else: ...
Traceback (most recent call last): File "/tmp/tmp1jhmqmy6/tmpl7h1tjts.py", line 163, in <module> num_cmds = int(lines[0]) ~~~~~^^^ IndexError: list index out of range
s290572618
p02285
u890722286
1475422754
Python
Python3
py
Runtime Error
20
7760
2354
def insert(r, n): if 0 == len(T): T[n] = [None, None, None] else: if n < r: left = T[r][0] if left == None: T[r][0] = n T[n] = [None, None, r] else: insert(left, n) if r < n: right = T[r][1] ...
Traceback (most recent call last): File "/tmp/tmpijxf3rpe/tmp1ixndosr.py", line 80, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s216977630
p02285
u890722286
1475426516
Python
Python3
py
Runtime Error
30
7820
2717
def insert(r, n): if 0 == len(T): T[n] = [None, None, None] else: if n < r: left = T[r][0] if left == None: T[r][0] = n T[n] = [None, None, r] else: insert(left, n) if r < n: right = T[r][1] ...
Traceback (most recent call last): File "/tmp/tmpaluclj_3/tmp5zwvac5c.py", line 87, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s450938898
p02285
u367979558
1477437112
Python
Python3
py
Runtime Error
30
7860
3481
import sys class Node: def __init__(self, x, parent=None): self.key = x self.left = None self.right = None self.parent = parent def append_child(self, child): if self.key > child.key: self.left = child child.parent = self elif self.key < ...
s997698070
p02285
u159356473
1479113486
Python
Python3
py
Runtime Error
0
0
1101
def Pre(t,l): l.append(str(t.n)) if t.left!=None: Pre(t.left,l) if t.right!=None: Pre(t.right,l) def In(t,l): if t.left!=None: In(t.left,l) l.append(str(t.n)) if t.right!=None: In(t.right,l) def BST3(A,n): tree=None for i in range(n): if A[i]=="...
Traceback (most recent call last): File "/tmp/tmpvq42pbb4/tmpm0erlqme.py", line 41, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s880062429
p02285
u159356473
1479113752
Python
Python3
py
Runtime Error
30
7756
2373
#coding:UTF-8 class Node: def __init__(self,point): self.n=point self.left=None self.right=None def Insert(t,z): y=None x=t while x!=None: y=x if z.n<x.n: x=x.left else: x=x.right if y==None: return z else: ...
Traceback (most recent call last): File "/tmp/tmpruaysc2k/tmpo_gqi37y.py", line 98, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s135585703
p02285
u742013327
1480576471
Python
Python3
py
Runtime Error
40
7844
3586
#http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_8_A #???????????? 15??? 8A???????????? 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 = focu...
Traceback (most recent call last): File "/tmp/tmpknmu11me/tmplepln4nm.py", line 120, in <module> main() File "/tmp/tmpknmu11me/tmplepln4nm.py", line 96, in main n_line = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s286631900
p02285
u811733736
1481003950
Python
Python3
py
Runtime Error
30
7772
5861
class Node(object): root = None def __init__(self, key, parent=None, left=None, right=None): self.key = key self.parent = parent self.left = left self.right = right self.height = None @classmethod def insert(cls, z): y = None x = cls.root ...
Traceback (most recent call last): File "/tmp/tmpkixatf06/tmpfx8adas8.py", line 192, in <module> num_of_nodes = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s612748559
p02285
u923668099
1485033821
Python
Python3
py
Runtime Error
20
7884
3209
import sys NIL = -1 class Node: def __init__(self, key): self.key = key self.parent = NIL self.left = NIL self.right = NIL class Tree: def __init__(self): self.root = NIL def insert(self, z): y = NIL x = self.root while x != NIL: ...
Traceback (most recent call last): File "/tmp/tmprua93fxq/tmpxpaic0ge.py", line 118, in <module> n = int(sys.stdin.readline()) ^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: ''
s380049206
p02285
u462831976
1489839444
Python
Python3
py
Runtime Error
50
11704
5485
# -*- 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/tmpjlxolq7x/tmpsvobiu0m.py", line 181, in <module> s = input() ^^^^^^^ EOFError: EOF when reading a line
s136748110
p02285
u089830331
1493691624
Python
Python3
py
Runtime Error
20
7648
1801
class Node: def __init__(self, num): self.key = num self.p = None self.left = None self.right = None class BinarySearchTree: def __init__(self): self.root = None def insert(self, z): y = None x = self.root while x != None: y = x if z.key < x.key: x = x.left ...
Traceback (most recent call last): File "/tmp/tmpz_okcmgd/tmp2lqfo1qx.py", line 69, in <module> for i in range(int(input())): ^^^^^^^ EOFError: EOF when reading a line
s658491441
p02285
u603049633
1496368528
Python
Python3
py
Runtime Error
20
7800
2941
#BinarySearchTree class TreeNode(): def __init__(self): self.key = None self.parent = None self.left = None self.right = None def inoder(self): r=[] if self.left: r += self.left.inoder() r += [self.key] if self.right: r += s...
Traceback (most recent call last): File "/tmp/tmps59adsz9/tmpsv58_4et.py", line 97, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s266235921
p02285
u067677727
1498791300
Python
Python3
py
Runtime Error
20
7900
3077
import sys class Node: def __init__(self, x): self.data = x self.left = None self.right = None def insert(node, x): if node == None: return Node(x) elif x == node.data: return node elif x < node.data: node.left = Node.inse...
Traceback (most recent call last): File "/tmp/tmpjsun98y4/tmp0sdu_3hu.py", line 113, in <module> main() File "/tmp/tmpjsun98y4/tmp0sdu_3hu.py", line 99, in main m = int(sys.stdin.readline()) ^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: ''
s911997217
p02285
u067677727
1498791344
Python
Python3
py
Runtime Error
30
7812
3077
import sys class Node: def __init__(self, x): self.data = x self.left = None self.right = None def insert(node, x): if node == None: return Node(x) elif x == node.data: return node elif x < node.data: node.left = Node.inse...
Traceback (most recent call last): File "/tmp/tmpcy76b7ju/tmpktn0iv7o.py", line 113, in <module> main() File "/tmp/tmpcy76b7ju/tmpktn0iv7o.py", line 99, in main m = int(sys.stdin.readline()) ^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: ''
s957522152
p02285
u796784914
1500101679
Python
Python
py
Runtime Error
10
6496
3052
import sys def main(): n = input() tree = MyBinaryTree(n) for i in range(n): cmd = map(str,raw_input().split()) if cmd[0] == "insert": insert(tree,MyNode(int(cmd[1]))) elif cmd[0] == "print": tree.inorder(tree.root) print "" tree.preor...
File "/tmp/tmpr8yn0df9/tmpy9tj4d4o.py", line 12 print "" ^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s423814458
p02285
u193453446
1502259715
Python
Python3
py
Runtime Error
20
7828
3080
import sys YES = "yes" NO = "no" class Node: def __init__(self, value, p = None, l = None, r = None): self.key = value self.p = p self.left = l self.right = r def chgchild(parent, old, new = None): if parent == None: return else: # print("parent:{}".format(...
Traceback (most recent call last): File "/tmp/tmp2jmkbsfw/tmpmli4a654.py", line 143, in <module> main() File "/tmp/tmp2jmkbsfw/tmpmli4a654.py", line 119, in main num = int(input().strip()) ^^^^^^^ EOFError: EOF when reading a line
s792540443
p02285
u491916705
1502717357
Python
Python
py
Runtime Error
10
6576
3713
class Node(): def __init__(self, id, left=-1, right=-1, parent=-1, type=None): 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...
File "/tmp/tmp6m4yvaep/tmp8gdpn60r.py", line 9 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...
s228178932
p02285
u519227872
1503239339
Python
Python3
py
Runtime Error
20
7756
2483
m = int(input()) class Node: def __init__(self, key, left ,right): self.key = key self.left = left self.right = right class BinaryTree(): def __init__(self): self.root = None def getRoot(self): return self.root def setRoot(self, v): self.root = v ...
Traceback (most recent call last): File "/tmp/tmp1y5kz0oa/tmpkcq7ui_s.py", line 1, in <module> m = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s092615453
p02285
u024715419
1510050987
Python
Python3
py
Runtime Error
30
7888
2975
class BinaryTree(): def __init__(self): self.root = None def insert(self, insert_node): p = None r = self.root while r: p = r if insert_node.value < r.value: r = r.left else: r = r.right if not p: ...
Traceback (most recent call last): File "/tmp/tmpprx4zsr9/tmpavejf10u.py", line 100, in <module> m = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s741820554
p02285
u024715419
1510052250
Python
Python3
py
Runtime Error
20
7824
2976
class BinaryTree(): def __init__(self): self.root = None def insert(self, insert_node): p = None r = self.root while r: p = r if insert_node.value < r.value: r = r.left else: r = r.right if not p: ...
Traceback (most recent call last): File "/tmp/tmpfg0a3x7v/tmphh4paeqm.py", line 98, in <module> m = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s335531148
p02285
u248416507
1512966532
Python
Python
py
Runtime Error
10
4864
3462
class Node(object): def __init__(self, key): self.left = None self.right = None self.parent = None self.key = key class Tree(object): def __init__(self): self.root = None def insert(self, new_key): x = self.root y = None while x is not...
File "/tmp/tmpkhbu97de/tmp_paflbgp.py", line 65 print "", ^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s833525987
p02285
u426534722
1518024018
Python
Python3
py
Runtime Error
20
5624
3366
import sys readline = sys.stdin.readline class Node: __slots__ = ['value', 'p', 'left', 'right'] def __init__(self, value = None, p = None, left = None, right = None): self.value = value self.p = p self.left = left self.right = right class BinTree: __slots__ = ['_tree', 'resu...
Traceback (most recent call last): File "/tmp/tmpw4_ylv_d/tmp8xagpz_3.py", line 93, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s049975866
p02285
u426534722
1518200760
Python
Python3
py
Runtime Error
20
5624
2740
import sys readline = sys.stdin.readline class Node: __slots__ = ['value', 'left', 'right'] def __init__(self, value = None, left = None, right = None): self.value = value self.left = left self.right = right class BinTree: __slots__ = ['_tree', 'result'] def __init__(self): ...
Traceback (most recent call last): File "/tmp/tmpxgbsxwvv/tmp3vu68hfc.py", line 83, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s077990273
p02285
u426534722
1518200817
Python
Python3
py
Runtime Error
20
5624
2846
import sys readline = sys.stdin.readline class Node: __slots__ = ['value', 'left', 'right'] def __init__(self, value = None, left = None, right = None): self.value = value self.left = left self.right = right class BinTree: __slots__ = ['_tree', 'result'] def __init__(self): ...
Traceback (most recent call last): File "/tmp/tmp5timl26r/tmpcspwa43q.py", line 86, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s340711662
p02285
u426534722
1518200864
Python
Python3
py
Runtime Error
20
5624
2837
import sys readline = sys.stdin.readline class Node: __slots__ = ['value', 'left', 'right'] def __init__(self, value = None, left = None, right = None): self.value = value self.left = left self.right = right class BinTree: __slots__ = ['_tree', 'result'] def __init__(self): ...
Traceback (most recent call last): File "/tmp/tmp_28qc0zs/tmp8peu0i9o.py", line 86, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s479544306
p02285
u177808190
1519676917
Python
Python3
py
Runtime Error
30
6020
3770
import collections sent = -1 def insert(hoge, new_node, root): #print(hoge) parent_maybe = sent now_looking = root hoge[new_node]['node_id'] = new_node while now_looking != sent: parent_maybe = now_looking if new_node < hoge[now_looking]['node_id']: now_looking = hoge[no...
Traceback (most recent call last): File "/tmp/tmpeti0u9w9/tmp_04i2who.py", line 107, in <module> num = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s069318709
p02285
u177808190
1519682280
Python
Python3
py
Runtime Error
30
6028
4155
import collections sent = None def insert(hoge, new_node, root): parent_maybe = sent now_looking = root hoge[new_node]['node_id'] = new_node while now_looking != sent: parent_maybe = now_looking if new_node < hoge[now_looking]['node_id']: now_looking = hoge[now_looking]['lef...
Traceback (most recent call last): File "/tmp/tmpcgw4pt4g/tmpu4g_9bjm.py", line 117, in <module> num = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s742306974
p02285
u177808190
1519721157
Python
Python3
py
Runtime Error
30
6032
4164
import collections sent = None def insert(hoge, new_node, root): parent_maybe = sent now_looking = root hoge[new_node]['node_id'] = new_node while now_looking != sent: parent_maybe = now_looking #print(hoge[now_looking], now_looking) if new_node < hoge[now_looking]['node_id']: ...
Traceback (most recent call last): File "/tmp/tmping70kun/tmpwy_jyf_3.py", line 118, in <module> num = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s502182930
p02285
u613534067
1522284191
Python
Python3
py
Runtime Error
20
5616
2656
# Binary Search Tree class Node: def __init__(self, v): self.value = v self.parent = None self.left = None self.right = None # 再帰を使わないパターンの方が早い def insert(node): global root y = None x = root while x is not None: y = x if node.value < x.value: ...
Traceback (most recent call last): File "/tmp/tmpi8sh7u6c/tmpyzeztr4t.py", line 98, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s413123620
p02285
u126478680
1526977821
Python
Python3
py
Runtime Error
30
5640
3155
class BinaryTreeNode(): def __init__(self, val, parent=None, left=None, right=None): self.parent = parent self.left = None self.right = None self.val = val def get_child_num(self): num = 0 if self.left != None: num += 1 if self.right != None: num += 1 ...
Traceback (most recent call last): File "/tmp/tmphi1r5i9y/tmpdlf9jz1j.py", line 118, in <module> m = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s697770948
p02285
u912237403
1374055917
Python
Python
py
Runtime Error
0
0
2092
import sys tree={} np = -1 home=0 tree[home]=[None, None, None] def search(p, x): node_pos=[None,None] while p != None: tmp = tree[p] if tmp[0] == x: node_pos[0] = p return node_pos node_pos[1] = p if x < tmp[0]: p = tmp[1] else: ...
File "/tmp/tmpy2uyw1ml/tmpwsctn1_x.py", line 87 if search(0,int(s[5:]))[0]!=None: print 'yes' ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s779959076
p02285
u912237403
1374056420
Python
Python
py
Runtime Error
20
4444
2091
import sys tree={} np = -1 home=0 tree[home]=[None, None, None] def search(p, x): node_pos=[None,None] while p != None: tmp = tree[p] if tmp[0] == x: node_pos[0] = p return node_pos node_pos[1] = p if x < tmp[0]: p = tmp[1] else: ...
File "/tmp/tmp5ibj2oic/tmpbii9hgre.py", line 87 if search(0,int(s[5:]))[0]!=None: print 'yes' ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s039258973
p02286
u686180487
1559201043
Python
Python3
py
Runtime Error
0
0
2030
# -*- coding: utf-8 -*- class Node: def __init__(self, key, priority): self.key = key self.priority = priority self.left = None self.right = None def rightRotate(t): s = t.left t.left = s.right s.right = t return s def leftRotate(t): s = t.right t.right = s.left s.left = t return ...
Traceback (most recent call last): File "/tmp/tmpquhuksdj/tmpywpbimng.py", line 88, in <module> num = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s788602531
p02286
u686180487
1559202368
Python
Python3
py
Runtime Error
0
0
2037
# -*- coding: utf-8 -*- class Node: def __init__(self, key, priority): self.key = key self.priority = priority self.left = None self.right = None def rightRotate(t): s = t.left t.left = s.right s.right = t return s def leftRotate(t): s = t.right t.right = s.left s.left = t return ...
Traceback (most recent call last): File "/tmp/tmpw8z9pdvp/tmppjabowqw.py", line 88, in <module> num = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s360246109
p02286
u686180487
1559202550
Python
Python3
py
Runtime Error
0
0
2053
# -*- coding: utf-8 -*- class Node: def __init__(self, key, priority): self.key = key self.priority = priority self.left = None self.right = None def rightRotate(t): s = t.left t.left = s.right s.right = t return s def leftRotate(t): s = t.right t.right = s.left s.left = t return ...
Traceback (most recent call last): File "/tmp/tmpaescqn7_/tmpecyuuxs1.py", line 88, in <module> num = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s604940630
p02286
u686180487
1559202639
Python
Python3
py
Runtime Error
0
0
2077
# -*- coding: utf-8 -*- class Node: def __init__(self, key, priority, left=None, right=None): self.key = key self.priority = priority self.left = left self.right = right def rightRotate(t): s = t.left t.left = s.right s.right = t return s def leftRotate(t): s = t.right t.right = s.lef...
Traceback (most recent call last): File "/tmp/tmp1crmv8cp/tmpa4oyh9b9.py", line 88, in <module> num = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s605174680
p02286
u686180487
1559203552
Python
Python3
py
Runtime Error
0
0
2068
# -*- coding: utf-8 -*- class Node: def __init__(self, key, priority, left=None, right=None): self.key = key self.priority = priority self.left = left self.right = right def rightRotate(t): s = t.left t.left = s.right s.right = t return s def leftRotate(t): s = t.right t.right = s.lef...
Traceback (most recent call last): File "/tmp/tmpnx_ywp94/tmps56bf9gw.py", line 87, in <module> num = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s477913671
p02286
u686180487
1559204035
Python
Python3
py
Runtime Error
0
0
2084
# -*- coding: utf-8 -*- class Node: def __init__(self, key, priority, left=None, right=None): self.key = key self.priority = priority self.left = left self.right = right def rightRotate(t): s = t.left t.left = s.right s.right = t return s def leftRotate(t): s = t.right t.right = s.lef...
Traceback (most recent call last): File "/tmp/tmp7au29j0e/tmpzmbz2dyd.py", line 87, in <module> num = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s645249951
p02286
u686180487
1559204359
Python
Python3
py
Runtime Error
0
0
1999
# -*- coding: utf-8 -*- class Node: def __init__(self, key, priority, left=None, right=None): self.key = key self.priority = priority self.left = left self.right = right def rightRotate(t): s = t.left t.left = s.right s.right = t return s def leftRotate(t): s = t.right t.right = s.lef...
Traceback (most recent call last): File "/tmp/tmpixebac1g/tmpcm8qvevu.py", line 82, in <module> num = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s342737246
p02286
u825008385
1527002690
Python
Python3
py
Runtime Error
0
0
2556
# Treap class Node(): def __init__(self, k, p): self.k = k self.p = p self.left = None self.right = None def rightRotate(t): s = t.left t.left = s.right s.right = t return s def leftRotate(t): s = t.right t.right = s.left s.left = t return s def ins...
Traceback (most recent call last): File "/tmp/tmplkxpeu3q/tmppzgavpn7.py", line 95, in <module> m = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s718839646
p02287
u643021750
1545223782
Python
Python3
py
Runtime Error
0
0
798
#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 H, i, A[MAX+1]; // 1-オリジンのため +1する cin >> H; for (i =1; i <= H; i++)...
File "/tmp/tmppg3mtfkd/tmps43xr7zr.py", line 2 using namespace std; ^^^^^^^^^ SyntaxError: invalid syntax
s783922582
p02287
u130979865
1460500529
Python
Python
py
Runtime Error
0
0
472
# -*- coding: utf-8 -*- n = int(raw_input()) l = map(int, raw_input().split()) A = [0] for i in range(n): A.append(l[i]) print "node %d: key = %d, left key = %d, right key = %d, " %(1, A[1], A[2*1], A[2*1+1]) for i in range(2, int(n/2+1)): print "node %d: key = %d, parent key = %d, left key = %d, right key = %...
File "/tmp/tmp3nhhzesa/tmp6i_rwigg.py", line 8 print "node %d: key = %d, left key = %d, right key = %d, " %(1, A[1], A[2*1], A[2*1+1]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s850927894
p02287
u603356762
1470473459
Python
Python3
py
Runtime Error
0
0
769
n = int(input()) keys = list(map(int, input().split())) #n=5 #heap_keys = [7,8,1,2,3] heap = [] for i,x in enumerate(heap_keys): node = i+1 key = x parent_key = heap_keys[int(node/2)-1] if i > 0 else None left_key = heap_keys[2*node-1] if 2*node-1 <len(heap_keys) else None right_key = heap_keys[2*no...
Traceback (most recent call last): File "/tmp/tmpxz2pj7lz/tmp6rmkh2_o.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s250392539
p02287
u091533407
1500164750
Python
Python3
py
Runtime Error
0
0
1227
def print_heap(): for i in range(n): if (i-1)//2 in range(n): if 2*i+1 in range(n): if 2*1+2 in range(n): print("node {}: key = {}, parent key = {}, left key = {}, right key = {}," .format(i+1, heap[i], heap[(i-1)//2], heap[2*i+1], he...
Traceback (most recent call last): File "/tmp/tmptpf8q86v/tmpk0n_mkvp.py", line 27, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s701368653
p02287
u135421061
1523855589
Python
Python3
py
Runtime Error
0
0
692
import sys import numpy as np def BinaryTree(array): for i in range(1,len(array)): print("node " + str(i) + ": key = " + str(array[i]),end="") if(i != 1): print(", parent key = " + str(array[int(i / 2)]),end="") if(2*i < len(array)): print(", left key = " + str(arra...
Traceback (most recent call last): File "/tmp/tmphu0ja1_t/tmpkrfjiaei.py", line 17, in <module> h = input() ^^^^^^^ EOFError: EOF when reading a line
s286274197
p02287
u135421061
1523855677
Python
Python3
py
Runtime Error
0
0
694
import sys import numpy as np def BinaryTree(array): for i in range(1,len(array)): print("node " + str(i) + ": key = " + str(array[i]),end="") if(i != 1): print(", parent key = " + str(array[int(i / 2)]),end="") if(2*i < len(array)): print(", left key = " + str(arra...
Traceback (most recent call last): File "/tmp/tmpldck1uqr/tmphmv1050h.py", line 17, in <module> h = input() ^^^^^^^ EOFError: EOF when reading a line
s088216588
p02287
u135421061
1523855723
Python
Python3
py
Runtime Error
0
0
694
import sys import numpy as np def BinaryTree(array): for i in range(1,len(array)): print("node " + str(i) + ": key = " + str(array[i]),end="") if(i != 1): print(", parent key = " + str(array[int(i / 2)]),end="") if(2*i < len(array)): print(", left key = " + str(arra...
Traceback (most recent call last): File "/tmp/tmpvnjdybkr/tmp3jaypcny.py", line 17, in <module> h = input() ^^^^^^^ EOFError: EOF when reading a line
s465232623
p02287
u135421061
1523855939
Python
Python3
py
Runtime Error
0
0
682
import sys import numpy as np def BinaryTree(array): for i in range(1,len(array)): print("node " + str(i) + ": key = " + str(array[i]),end="") if(i != 1): print(", parent key = " + str(array[int(i / 2)]),end="") if(2*i < len(array)): print(", left key = " + str(arra...
Traceback (most recent call last): File "/tmp/tmpylbrum27/tmpz5pvmrlo.py", line 17, in <module> h = input() ^^^^^^^ EOFError: EOF when reading a line
s719250334
p02287
u135421061
1523855976
Python
Python3
py
Runtime Error
0
0
682
import sys import numpy as np def BinaryTree(array): for i in range(1,len(array)): print("node " + str(i) + ": key = " + str(array[i]),end="") if(i != 1): print(", parent key = " + str(array[int(i / 2)]),end="") if(2*i < len(array)): print(", left key = " + str(arra...
Traceback (most recent call last): File "/tmp/tmp0rtz6trd/tmp_xvw9cvq.py", line 17, in <module> h = input() ^^^^^^^ EOFError: EOF when reading a line
s199345060
p02287
u135421061
1523855999
Python
Python3
py
Runtime Error
0
0
682
import sys import numpy as np def BinaryTree(array): for i in range(1,len(array)): print("node " + str(i) + ": key = " + str(array[i]),end="") if(i != 1): print(", parent key = " + str(array[int(i / 2)]),end="") if(2*i < len(array)): print(", left key = " + str(arra...
Traceback (most recent call last): File "/tmp/tmp6ryizh6m/tmpbc35fm88.py", line 17, in <module> h = input() ^^^^^^^ EOFError: EOF when reading a line
s905206531
p02287
u724548524
1525409702
Python
Python3
py
Runtime Error
0
0
309
n = int(input()) a = [0] + list(map(int, input().split())) for i in range(1, n + 1): print(f"node {i}: key = {a[i]}," + (f" parent key = {a[int(i / 2)]}," if i != 1: else "") + (f"{ left key = {a[2 * i]}, " if i * 2 <= n: else = "") + (f" right key = {a[2 * i + 1]}," if 2 * i + 1 <= n: else = ""))
File "/tmp/tmp5nzgu17l/tmpgeye0s8r.py", line 5 print(f"node {i}: key = {a[i]}," + (f" parent key = {a[int(i / 2)]}," if i != 1: else "") + (f"{ left key = {a[2 * i]}, " if i * 2 <= n: else = "") + (f" right key = {a[2 * i + 1]}," if 2 * i + 1 <= n: else = "")) ...
s321964193
p02287
u559106458
1529408524
Python
Python3
py
Runtime Error
0
0
705
#coding-utf8 #Complete Binary Tree list=[] list.append("sentinel") def parent(i): return i//2 def left(i): return i*2 def right(i): return i*2+1 def main(): H=int(input()) for i in range(H): i+=1 list.append(int(input())) for i in range(H): i+=1 print("node "...
Traceback (most recent call last): File "/tmp/tmpbrgq1rmo/tmp6gse1ys7.py", line 35, in <module> main() File "/tmp/tmpbrgq1rmo/tmp6gse1ys7.py", line 17, in main H=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s239324120
p02287
u559106458
1529408574
Python
Python3
py
Runtime Error
0
0
705
#coding-utf8 #Complete Binary Tree list=[] list.append("sentinel") def parent(i): return i//2 def left(i): return i*2 def right(i): return i*2+1 def main(): H=int(input()) for i in range(H): i+=1 list.append(int(input())) for i in range(H): i+=1 print("node "...
Traceback (most recent call last): File "/tmp/tmph3y7h6g8/tmpvdmlteth.py", line 35, in <module> main() File "/tmp/tmph3y7h6g8/tmpvdmlteth.py", line 17, in main H=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s568942580
p02287
u559106458
1529408593
Python
Python3
py
Runtime Error
0
0
705
#coding-utf8 #Complete Binary Tree list=[] list.append("sentinel") def parent(i): return i//2 def left(i): return i*2 def right(i): return i*2+1 def main(): H=int(input()) for i in range(H): i+=1 list.append(int(input())) for i in range(H): i+=1 print("node "...
Traceback (most recent call last): File "/tmp/tmpbv03o6t3/tmpnowik_xx.py", line 35, in <module> main() File "/tmp/tmpbv03o6t3/tmpnowik_xx.py", line 17, in main H=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s261014024
p02288
u805716376
1551282300
Python
Python3
py
Runtime Error
0
0
341
H=int(input())+1 A=[0]+list(map(int,input().split())) def h(i): l=2*i;r=l+1 if r<H &&l<H : if A[i]<A[l]: if A[l]<A[r]:A[i],A[r]=A[r],A[i];h(r) else:A[i],A[l]=A[l],A[i];h(l) elif A[i]<A[r]:A[i],A[r]=A[r],A[i];h(r) elif l<H and A[i]<A[l]:A[i],A[l]=A[l],A[i];h(l) for i in range(H//2,0,-1):h(i) print(' '+' '.j...
File "/tmp/tmpjav4lez_/tmpncnst1yb.py", line 5 if r<H &&l<H : ^ SyntaxError: invalid syntax
s648651381
p02288
u805716376
1551282333
Python
Python3
py
Runtime Error
0
0
341
H=int(input())+1 A=[0]+list(map(int,input().split())) def h(i): l=2*i;r=l+1 if r<H && l<H: if A[i]<A[l]: if A[l]<A[r]:A[i],A[r]=A[r],A[i];h(r) else:A[i],A[l]=A[l],A[i];h(l) elif A[i]<A[r]:A[i],A[r]=A[r],A[i];h(r) elif l<H and A[i]<A[l]:A[i],A[l]=A[l],A[i];h(l) for i in range(H//2,0,-1):h(i) print(' '+' '.j...
File "/tmp/tmpjzg3zt2_/tmppbh7iqnd.py", line 5 if r<H && l<H: ^ SyntaxError: invalid syntax
s450718300
p02288
u879226672
1432123846
Python
Python
py
Runtime Error
0
0
546
# coding: utf-8 def maxHeapify(A, i): l = A[2*(i+1)-1] r = A[2*(i+1)] if l <= H and A[l] > A[i]: largest = l else: largest = i if r <= H and A[r] > A[largest]: largest = r if largest != i:???# i ???????????????????????§????????´??? A[i],A[largest] = A[largest],A[i...
File "/tmp/tmp03xe909p/tmpnxpcu8a_.py", line 11 if largest != i:???# i ???????????????????????§????????´??? ^ SyntaxError: invalid syntax
s666534089
p02288
u811733736
1481014527
Python
Python3
py
Runtime Error
0
0
810
def max_heapify(A, i): l = 2 * i r = 2 * i + 1 largest = i if l <= len(A) and A[l] > A[i]: largest = l else: largest = i if r < len(A) and A[r] > A[largest]: largest = r if largest != i: temp = A[i] A[i] = A[largest] A[largest] = temp ...
Traceback (most recent call last): File "/tmp/tmpmhof4uxi/tmpt0dnqo9t.py", line 28, in <module> num_of_data = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s195331766
p02288
u742013327
1481621209
Python
Python3
py
Runtime Error
20
7604
788
#http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_9_B #???????????? 17:55~ def maxHeapify(heap, index): left_index = 2 * index right_index = 2 * index + 1 left = heap[left_index] if left_index < len(heap) else -1 right = heap[right_index] if right_index < len(heap) else -1 largest_ind...
Traceback (most recent call last): File "/tmp/tmpj11tv1k_/tmpef0gsj47.py", line 23, in <module> main() File "/tmp/tmpj11tv1k_/tmpef0gsj47.py", line 16, in main n_node = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s575975270
p02288
u112247126
1487816773
Python
Python3
py
Runtime Error
0
0
569
def maxHeapify(heap, i): while (i + 1) * 2 <= len(heap): left = (i + 1) * 2 - 1 right = (i + 1) * 2 largest = left if heap[left] > heap[i] else i largest = right if heap[right] > heap[largest] if largest != i: heap[i], heap[largest] = heap[largest], heap[i] ...
File "/tmp/tmpuihe2kse/tmpt5fr94ri.py", line 6 largest = right if heap[right] > heap[largest] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: expected 'else' after 'if' expression
s350820194
p02288
u112247126
1487816885
Python
Python3
py
Runtime Error
0
0
620
def maxHeapify(heap, i): while (i + 1) * 2 <= len(heap): left = (i + 1) * 2 - 1 right = (i + 1) * 2 largest = left if heap[left] > heap[i] and left <= len(heap) else i largest = right if heap[right] > heap[largest] and right <= len(heap) if largest != i: heap[i], ...
File "/tmp/tmp41h65q_b/tmpkm1t8ims.py", line 6 largest = right if heap[right] > heap[largest] and right <= len(heap) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: expected 'else' after 'if' expression
s359450692
p02288
u112247126
1487817436
Python
Python3
py
Runtime Error
0
0
591
def maxHeapify(heap, i): left = (i + 1) * 2 - 1 right = (i + 1) * 2 largest = left if heap[left] > heap[i] and left <= len(heap) else i largest = right if heap[right] > heap[largest] and right <= len(heap) else largest if largest != i: heap[i], heap[largest] = heap[largest], heap[i] ...
Traceback (most recent call last): File "/tmp/tmpk3peliln/tmpwzcsosho.py", line 14, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s331273783
p02288
u112247126
1487817506
Python
Python3
py
Runtime Error
0
0
591
def maxHeapify(heap, i): left = (i + 1) * 2 - 1 right = (i + 1) * 2 largest = left if heap[left] > heap[i] and left <= len(heap) else i largest = right if heap[right] > heap[largest] and right <= len(heap) else largest if largest != i: heap[i], heap[largest] = heap[largest], heap[i] ...
Traceback (most recent call last): File "/tmp/tmp98eugfki/tmpqtfx8wt1.py", line 14, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s058814189
p02288
u112247126
1487817598
Python
Python3
py
Runtime Error
0
0
616
def maxHeapify(heap, i): left = (i + 1) * 2 - 1 right = (i + 1) * 2 largest = left if heap[left] > heap[i] and left <= len(heap) else i largest = right if heap[right] > heap[largest] and right <= len(heap) else largest if largest != i: heap[i], heap[largest] = heap[largest], heap[i] ...
Traceback (most recent call last): File "/tmp/tmprp66e7_v/tmpep932krz.py", line 14, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s892248710
p02288
u112247126
1487817724
Python
Python3
py
Runtime Error
0
0
590
def maxHeapify(heap, i): left = (i + 1) * 2 - 1 right = (i + 1) * 2 largest = left if heap[left] > heap[i] and left < len(heap) else i largest = right if heap[right] > heap[largest] and right < len(heap) else largest if largest != i: heap[i], heap[largest] = heap[largest], heap[i] ma...
Traceback (most recent call last): File "/tmp/tmpr3cfbeme/tmp6dkeoyen.py", line 14, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s741862508
p02288
u112247126
1487817779
Python
Python3
py
Runtime Error
0
0
590
def maxHeapify(heap, i): left = (i + 1) * 2 - 1 right = (i + 1) * 2 largest = left if heap[left] > heap[i] and left < len(heap) else i largest = right if heap[right] > heap[largest] and right < len(heap) else largest if largest != i: heap[i], heap[largest] = heap[largest], heap[i] ma...
Traceback (most recent call last): File "/tmp/tmpncu2p8ee/tmp2j12ut_6.py", line 14, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s002164390
p02288
u112247126
1487817803
Python
Python3
py
Runtime Error
0
0
614
def maxHeapify(heap, i): left = (i + 1) * 2 - 1 right = (i + 1) * 2 largest = left if heap[left] > heap[i] and left < len(heap) else i largest = right if heap[right] > heap[largest] and right < len(heap) else largest if largest != i: heap[i], heap[largest] = heap[largest], heap[i] ma...
Traceback (most recent call last): File "/tmp/tmp5zmprfrm/tmp4cwquxec.py", line 14, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s700998177
p02288
u112247126
1487818072
Python
Python3
py
Runtime Error
0
0
655
# ???????????????????????????????????? def maxHeapify(heap, i): left = (i + 1) * 2 - 1 right = (i + 1) * 2 largest = left if heap[left] > heap[i] and left < len(heap) else i largest = right if heap[right] > heap[largest] and right < len(heap) else largest if largest != i: heap[i], heap[larg...
Traceback (most recent call last): File "/tmp/tmp7324hiuw/tmpq6_7s5cm.py", line 16, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s090628955
p02288
u150984829
1519611334
Python
Python3
py
Runtime Error
0
0
229
input() A=[0]+list(map(int,input().split())) H=len(A) def h(i): l=2*i;r,g=l+1,[i,l][A[i]<A[l]and l<H] if A[g]<A[r]and r<H:g=r if g!=i:A[i],A[g]=A[g],A[i];h(g) for i in range(H//2,0,-1):h(i) print(' '+' '.join(map(str,A[1:])))
Traceback (most recent call last): File "/tmp/tmp_0txhu7r/tmpwq8vft66.py", line 1, in <module> input() EOFError: EOF when reading a line
s676329062
p02288
u150984829
1519612793
Python
Python3
py
Runtime Error
0
0
222
H=int(input())+1 A=[0]+list(map(int,input().split())) def h(i): g=A.index(max(A[i],A[i,2*i][2*i<H],A[i,2*i+1][2*i+1<H])) if g>i:A[i],A[g]=A[g],A[i];h(g) for i in range(H//2,0,-1):h(i) print(' '+' '.join(map(str,A[1:])))
Traceback (most recent call last): File "/tmp/tmpyr1xfvrl/tmpj9bjp096.py", line 1, in <module> H=int(input())+1 ^^^^^^^ EOFError: EOF when reading a line
s979642463
p02288
u150984829
1519614191
Python
Python3
py
Runtime Error
0
0
258
H=int(input())+1 A=[0]+list(map(int,input().split())) def h(i): l=2*i;r=l+1 g=i if r<H and A[g]<A[r]:g=l if A[i]<A[l]else r else:if l<H and A[i]<A[l]:g=l if g>i:A[i],A[g]=A[g],A[i];h(g) for i in range(H//2,0,-1):h(i) print(' '+' '.join(map(str,A[1:])))
File "/tmp/tmp70zxcxmh/tmprfucou9c.py", line 7 else:if l<H and A[i]<A[l]:g=l ^^ SyntaxError: invalid syntax
s040704980
p02288
u135421061
1523861063
Python
Python3
py
Runtime Error
0
0
880
import numpy as np import sys def maxHeapify(array,i): l = 2 * i r = 2 * i + 1 largest = i #print("i,array[i] ==: " + str(i) + ", " + str(array[i])) #print(array) if( l < (len(array))): if(array[l] > array[i]): largest = l else: largest = i if( r < ...
Traceback (most recent call last): File "/tmp/tmp1hhhmhq3/tmpnzi85dx0.py", line 31, in <module> h = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s055523782
p02288
u135421061
1523861378
Python
Python3
py
Runtime Error
0
0
884
import numpy as np import sys def maxHeapify(array,i): l = 2 * i r = 2 * i + 1 largest = i #print("i,array[i] ==: " + str(i) + ", " + str(array[i])) #print(array) if( l < (len(array))): if(array[l] > array[i]): largest = l else: largest = i if( r < ...
Traceback (most recent call last): File "/tmp/tmp4ox13882/tmpllzwkdne.py", line 31, in <module> h = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s090252665
p02289
u007270338
1535531301
Python
Python3
py
Runtime Error
0
0
998
#coding: utf-8 A = [] inf = 100000000000 def maxHeapify(A, i): l = 2 * i r = 2 * i + 1 H = len(A) if l <= H and A[l] > A[i]: largest = l else: largest = i if r <= H and A[r] > A[largest]: largest = r if largest != i: A[i], A[largest] = A[largest], A[i] ...
Traceback (most recent call last): File "/tmp/tmpi0kueo7y/tmpl58s6i_y.py", line 40, in <module> data = list(input().split()) ^^^^^^^ EOFError: EOF when reading a line
s205342381
p02289
u800534567
1540306919
Python
Python3
py
Runtime Error
0
0
827
#include <stdio.h> #include <stdlib.h> #define SIZE 2000000 int main() { int A[SIZE]; int H=0; int i, l, largest, tmp; char com[20]; do { fgets(com, 20, stdin); if (com[0] == 'i') { // insert nn A[++H] = atoi(com+7); for (i=H; i>1 && A[i/2]<A[i];i/=2) { tmp = A[i/2]; ...
File "/tmp/tmpk94moxvy/tmpwbgihgzy.py", line 6 int main() { ^^^^ SyntaxError: invalid syntax
s517861371
p02289
u800534567
1540307931
Python
Python3
py
Runtime Error
0
0
1035
#include <stdio.h> #define SIZE 2000000 int myatoi(const char* p) { int n; while (*p!='\n') { n = n*10+*p-'0'; p++; } return n; } void putnum(int n) { int i; char buf[20]; buf[19]='\0'; for (i=18; n>0; n/=10) buf[i--]=(n%10)+'0'; puts(buf+i+1); }javascript:void(0) int main() { int A[SIZE...
File "/tmp/tmpng5k885y/tmprj52xxd3.py", line 5 int myatoi(const char* p) ^^^^^^ SyntaxError: invalid syntax
s494703360
p02289
u800534567
1540307984
Python
Python3
py
Runtime Error
0
0
1041
#include <stdio.h> #define SIZE 2000000 int myatoi(const char* p) { int n; while (*p!='\n') { n = n*10+*p-'0'; p++; } return n; } void putnum(int n) { int i; char buf[20]; buf[19]='\0'; for (i=18; n>0; n/=10) buf[i--]=(n%10)+'0'; puts(buf+i+1); } int main() { int A[SIZE]; int H=0; in...
File "/tmp/tmpn6jjasn4/tmpm1qzo3dq.py", line 5 int myatoi(const char* p) ^^^^^^ SyntaxError: invalid syntax
s600314357
p02289
u800534567
1540308472
Python
Python3
py
Runtime Error
0
0
898
#include <stdio.h> #define SIZE 2000000 int myatoi(const char* p) { int n; while (*p!='\n') { n = n*10+*p-'0'; p++; } return n; } int main() { int A[SIZE]; int H=0; int i, l, largest, tmp; char com[21]; do { fgets(com, 20, stdin); if (com[0] == 'i') { A[++H] = myatoi(com+7); ...
File "/tmp/tmpzqppgcy6/tmp0gfiwbrb.py", line 5 int myatoi(const char* p) ^^^^^^ SyntaxError: invalid syntax
s661590400
p02289
u800534567
1540308486
Python
Python3
py
Runtime Error
0
0
916
#include <stdio.h> #include <stdlib.h> #define SIZE 2000000 int myatoi(const char* p) { int n; while (*p!='\n') { n = n*10+*p-'0'; p++; } return n; } int main() { int A[SIZE]; int H=0; int i, l, largest, tmp; char com[21]; do { fgets(com, 20, stdin); if (com[0] == 'i') { A[++H...
File "/tmp/tmp6yxxlh5i/tmp_7rcqiiq.py", line 6 int myatoi(const char* p) ^^^^^^ SyntaxError: invalid syntax
s984669674
p02289
u800534567
1540308575
Python
Python3
py
Runtime Error
0
0
930
#include <stdio.h> #include <stdlib.h> #define SIZE 2000000 int myatoi(const char* p) { int n; while (*p!='\n' && *p!='\r') { n = n*10+*p-'0'; p++; } return n; } int main() { int A[SIZE]; int H=0; int i, l, largest, tmp; char com[21]; do { fgets(com, 20, stdin); if (com[0] == 'i') {...
File "/tmp/tmp5qeg85wa/tmpgn7yd921.py", line 6 int myatoi(const char* p) ^^^^^^ SyntaxError: invalid syntax
s146479281
p02289
u357267874
1555719685
Python
Python3
py
Runtime Error
20
5608
1739
def get_parent(A, i): if i == 1: return None else: return i // 2 def get_left(A, i): if len(A) > 2 * i: return 2 * i else: return None def get_right(A, i): if len(A) > 2 * i + 1: return 2 * i + 1 else: return None A = [-1] * 10 H = 0 def insert...
Traceback (most recent call last): File "/tmp/tmpp9zsamhg/tmprpcsmxql.py", line 76, in <module> line = input().split() ^^^^^^^ EOFError: EOF when reading a line
s220645185
p02289
u554503378
1556535403
Python
Python3
py
Runtime Error
0
0
1398
#include <bits/stdc++.h> using namespace std; void insert(vector<int> &p_q,int last,int val){ p_q.push_back(val); last++; int last_p = (last-1)/2; while(last >= 0 && p_q[last] > p_q[last_p]){ swap(p_q[last],p_q[last_p]); last = last_p; last_p = ((last-1)/2); } } void make...
File "/tmp/tmpnxgvxfcp/tmpwo8b7su9.py", line 3 using namespace std; ^^^^^^^^^ SyntaxError: invalid syntax
s993890004
p02289
u491071312
1438061581
Python
Python3
py
Runtime Error
0
0
231
import asyncio PQ = asyncio.PriorityQueue() while True: line = input().split() if line[0] == 'insert': PQ.put_nowait( line[1] ) elif line[0] == 'extract': print(PQ.get_nowait()) else: break
Traceback (most recent call last): File "/tmp/tmp6zrosvsg/tmpj24ypewe.py", line 6, in <module> line = input().split() ^^^^^^^ EOFError: EOF when reading a line
s826825394
p02289
u148091382
1440837296
Python
Python
py
Runtime Error
0
0
1185
def insert(array, new_value) array << new_value current = array.size-1 parent = current / 2 while (parent > 0) do if (array[parent] < array[current]) then array[parent], array[current] = array[current], array[parent] current = parent parent = current / 2 else break end end ...
File "/tmp/tmp_siqfhv1/tmp7wv_xpr1.py", line 1 def insert(array, new_value) ^ SyntaxError: expected ':'
s438932690
p02289
u247976584
1455521162
Python
Python3
py
Runtime Error
0
0
1055
from sys import stdin, exit def max_heapify(a, i): heap_size = a[0] L = 2*i R = 2*i + 1 if L <= heap_size and a[L] > a[i]: largest = L else: largest = i if R <= heap_size and a[R] > a[largest]: largest = R if largest != i: a[i], a[largest] = a[largest], ...
s977230915
p02289
u247976584
1455521220
Python
Python3
py
Runtime Error
0
0
1063
from sys import stdin, stdout, exit def max_heapify(a, i): heap_size = a[0] L = 2*i R = 2*i + 1 if L <= heap_size and a[L] > a[i]: largest = L else: largest = i if R <= heap_size and a[R] > a[largest]: largest = R if largest != i: a[i], a[largest] = a[la...
s966999980
p02289
u567281053
1461079555
Python
Python
py
Runtime Error
0
0
1090
import sys def parent(i): return (i + 1) / 2 - 1 def left(i): return 2 * i + 1 def right(i): return 2 * i + 2 def sibling(i): if i % 2 == 0: return i - 1 else: return i + 1 def insert(S, k): S.append(k) now = len(S) - 1 while True: p = parent(now) if ...
File "/tmp/tmphbjajc0f/tmpb5fknb22.py", line 31 print S[0] ^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s151338590
p02289
u567281053
1461249343
Python
Python
py
Runtime Error
0
0
1097
import sys def parent(i): return (i + 1) / 2 - 1 def left(i): return 2 * i + 1 def right(i): return 2 * i + 2 def sibling(i): if i % 2 == 0: return i - 1 else: return i + 1 def insert(S, k): S.append(k) idx = len(S) - 1 while True: p = parent(idx) if ...
File "/tmp/tmpfv2yjc74/tmpw2fqhiu4.py", line 31 print S[0] ^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s012245291
p02289
u567281053
1461250172
Python
Python
py
Runtime Error
0
0
854
import sys def insert(S, k): S.append(k) idx = len(S) - 1 while True: p = (i + 1) / 2 - 1 if p < 0 or S[idx] <= S[p]: break else: S[idx], S[p] = S[p], S[idx] idx = p def maxHeapify(A, i, size): l = 2 * i + 1 r = 2 * i + 2 if l < size...
File "/tmp/tmp4_i6dvnl/tmpfxjkwh39.py", line 31 print S[0] ^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s751697551
p02289
u567281053
1461251562
Python
Python
py
Runtime Error
0
0
936
import sys def insert(k): global S, last S[last] = k idx = last while True: p = (idx + 1) / 2 - 1 if S[idx] <= S[p]: break else: S[idx], S[p] = S[p], S[idx] idx = p last += 1 def maxHeapify(i): global S, last l = 2 * i + 1 r =...
File "/tmp/tmpkdq0rjwf/tmp682eem7r.py", line 35 print S[0] ^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s602235413
p02289
u949338836
1464678548
Python
Python3
py
Runtime Error
0
0
219
#coding:utf-8 #1_9_C s = set() while True: cmd = input().split() if cmd[0] == "end": break elif cmd[0] == "insert": l.add(int(cmd[1])) else: print(max(s)) l.remove(max(s))
Traceback (most recent call last): File "/tmp/tmpc_ak55ep/tmpgrqypg6y.py", line 5, in <module> cmd = input().split() ^^^^^^^ EOFError: EOF when reading a line
s947226950
p02289
u027872723
1476634717
Python
Python3
py
Runtime Error
0
0
1537
# -*- coding: utf_8 -*- level = False def debug(v): if level: print(v) class PriorityQueue: def __init__(self, size): self.queue = [] def insert(self, key): self.queue.append(key) self.heapIncreaseKey() debug(self.queue) def heapIncreaseKey(self): h = ...
Traceback (most recent call last): File "/tmp/tmp9mp2ayo9/tmpoyex6dn2.py", line 60, in <module> command = input().split() ^^^^^^^ EOFError: EOF when reading a line
s518606491
p02289
u027872723
1476634752
Python
Python3
py
Runtime Error
0
0
1537
# -*- coding: utf_8 -*- level = False def debug(v): if level: print(v) class PriorityQueue: def __init__(self, size): self.queue = [] def insert(self, key): self.queue.append(key) self.heapIncreaseKey() debug(self.queue) def heapIncreaseKey(self): h = ...
Traceback (most recent call last): File "/tmp/tmpegapsrcr/tmpte5if73v.py", line 60, in <module> command = input().split() ^^^^^^^ EOFError: EOF when reading a line
s949007172
p02289
u027872723
1476636869
Python
Python3
py
Runtime Error
0
0
1715
# -*- coding: utf_8 -*- import sys level = False def debug(v): if level: print(v) class PriorityQueue: def __init__(self, size): self.queue = [-1] * size self.tail = 0 def insert(self, key): self.queue[tail] = key self.tail += 1 self.heapIncreaseKey() ...
Traceback (most recent call last): File "/tmp/tmp0dq2_9c2/tmppuxo74nn.py", line 66, in <module> command = input().split() ^^^^^^^ EOFError: EOF when reading a line
s166638525
p02289
u027872723
1476637448
Python
Python3
py
Runtime Error
0
0
1740
# -*- coding: utf_8 -*- import sys level = False def debug(v): if level: print(v) class PriorityQueue: def __init__(self, size): self.queue = [-1] * size self.tail = 0 def insert(self, key): self.queue[self.tail] = key self.tail += 1 self.heapIncreaseKey() ...
Traceback (most recent call last): File "/tmp/tmp4cyp8zo5/tmpjxzegubg.py", line 66, in <module> command = input().split() ^^^^^^^ EOFError: EOF when reading a line
s499363262
p02289
u022407960
1479465412
Python
Python3
py
Runtime Error
0
0
2039
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys def max_heapify(index): left, right, largest = 2 * index, 2 * index + 1, None if left <= heap_length and heap_array[left] > heap_array[index]: largest = left else: largest = index if right <= heap_length and heap_array[right] ...
s293292893
p02289
u112247126
1487832763
Python
Python3
py
Runtime Error
0
0
1108
import sys from numpy import inf def insert(heap, key): heap.append(-inf) heapIncreaseKey(heap, key) def parent(i): return (i - 1) // 2 def heapIncreaseKey(heap, key): heap[len(heap) - 1] = key i = len(heap) - 1 while i > 0 and heap[parent(i)] < heap[i]: heap[i], heap[parent(i)] = hea...