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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s634590320 | p02345 | u728992264 | 1490387669 | Python | Python3 | py | Runtime Error | 30 | 7628 | 717 | dat = []
def init(n):
global dat
k = 1
while (k < n):
k = k * 2
dat = [2**31 - 1 for i in range(2 * k - 1)]
def update(k, y):
global dat
k += len(dat) - 1
dat[k] = y;
while (k > 0):
k = int((k - 1) / 2)
dat[k] = min(dat[k * 2 + 1], dat[k * 2 + 2])
def query(a, b, k, l, r):
if (r <= a or... | Traceback (most recent call last):
File "/tmp/tmpf6tbev98/tmpkmvt3yei.py", line 30, in <module>
n, q = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s340858880 | p02345 | u362104929 | 1495377070 | Python | Python3 | py | Runtime Error | 0 | 0 | 407 | def updt(lst, i, x):
lst[i] = x
def fnd(lst, s, t):
return min(lst[s:t])
def rmq():
n, q = map(int, input().split())
A = [x for x in range(n)]
ans = []
for _ in range(q):
cmd, x, y = map(int, input().split())
if cmd == 0:
updt(A, x, y)
else:
an... | Traceback (most recent call last):
File "/tmp/tmpqo1oo8yu/tmphqt0k33o.py", line 23, in <module>
rmq()
File "/tmp/tmpqo1oo8yu/tmphqt0k33o.py", line 10, in rmq
n, q = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s099513772 | p02345 | u362104929 | 1495380883 | Python | Python3 | py | Runtime Error | 0 | 0 | 750 | import sys
def updt(lstv, lstk, i, x):
lstv[i] = x
lstk[i] = i
def fnd(lstv, lstk, s, t):
if max(lstk[s:t+1]) == -1:
return 2**31 -1
else:
m = 2**31 -1
for k in lstk[s:t+1]:
if k >= 0:
if m > lstv[k]:
... | Traceback (most recent call last):
File "/tmp/tmpl0zpepo2/tmpcf47b0wl.py", line 35, in <module>
rmq()
File "/tmp/tmpl0zpepo2/tmpcf47b0wl.py", line 21, in rmq
n, q = map(int, sys.stdin.reakline().split())
^^^^^^^^^^^^^^^^^^
AttributeError: '_io.TextIOWrapper' object has no attribute 'reak... | |
s316939174 | p02345 | u603049633 | 1496735541 | Python | Python3 | py | Runtime Error | 0 | 0 | 260 | import numpy as np
n,q = map(int, input().split())
A = np.array([float("inf")] * n)
for i in range(q):
c,x,y = map(int,input().split())
if c == 0:
A[x] = y
else:
a = np.min(A[x:y+1])
if a == float("inf"): a = "2147483647"
else: a = str(a)
print(a) | Traceback (most recent call last):
File "/tmp/tmpy_c_8trq/tmpq8s27dqr.py", line 2, in <module>
n,q = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s022541281 | p02345 | u603049633 | 1496735607 | Python | Python3 | py | Runtime Error | 0 | 0 | 244 | import numpy as np
n,q = map(int, input().split())
A = np.array([None] * n)
for i in range(q):
c,x,y = map(int,input().split())
if c == 0:
A[x] = y
else:
a = np.min(A[x:y+1])
if a is None: a = "2147483647"
else: a = str(a)
print(a) | Traceback (most recent call last):
File "/tmp/tmpq5br8s7x/tmpbi4w6nog.py", line 2, in <module>
n,q = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s872376478 | p02345 | u603049633 | 1496735656 | Python | Python3 | py | Runtime Error | 20 | 7464 | 212 | n,q = map(int, input().split())
A = [None] * n
for i in range(q):
c,x,y = map(int,input().split())
if c == 0:
A[x] = y
else:
a = min(A[x:y+1])
if a is None: a = "2147483647"
else: a = str(a)
print(a) | Traceback (most recent call last):
File "/tmp/tmp_rdjse93/tmplmd25gu1.py", line 1, in <module>
n,q = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s475968115 | p02345 | u798803522 | 1511615555 | Python | Python3 | py | Runtime Error | 0 | 0 | 1040 | class RMQ:
import math
def __init__(self, length):
self.length = 2 ** math.ceil(math.log(length, 2))
self.segtree = [float("inf")] * (2 ** (self.length + 1) - 1)
def update(self, index, n):
leaf_index = index + self.length - 1
self.segtree[leaf_index] = n
while leaf... | Traceback (most recent call last):
File "/tmp/tmp3yfuj_jv/tmpgss78_jq.py", line 23, in <module>
v_num, query = (int(n) for n in input().split(" "))
^^^^^^^
EOFError: EOF when reading a line
| |
s366208168 | p02345 | u798803522 | 1511618296 | Python | Python3 | py | Runtime Error | 0 | 0 | 1080 | class RMQ:
def __init__(self, length, ini_num = float("inf")):
self.length = 1
while self.length <= n:
self.length <<= 1
self.segtree = [ini_num] * (2 * self.length - 1)
def update(self, index, n):
leaf_index = index + self.length - 1
self.segtree[leaf_index]... | Traceback (most recent call last):
File "/tmp/tmpgs0cjqx1/tmpi9jup6km.py", line 23, in <module>
v_num, query = (int(n) for n in input().split(" "))
^^^^^^^
EOFError: EOF when reading a line
| |
s618663410 | p02345 | u798803522 | 1511618330 | Python | Python3 | py | Runtime Error | 0 | 0 | 1085 | class RMQ:
def __init__(self, length, ini_num = float("inf")):
self.length = 1
while self.length <= n:
self.length <<= 1
self.segtree = [ini_num] * (2 * self.length - 1)
def update(self, index, n):
leaf_index = index + self.length - 1
self.segtree[leaf_index]... | Traceback (most recent call last):
File "/tmp/tmp56or4j7m/tmpvcm6wnez.py", line 23, in <module>
v_num, query = (int(n) for n in input().split(" "))
^^^^^^^
EOFError: EOF when reading a line
| |
s628806714 | p02345 | u798803522 | 1511618437 | Python | Python3 | py | Runtime Error | 0 | 0 | 1085 | class RMQ:
def __init__(self, length, ini_num = float("inf")):
self.length = 1
while self.length <= n:
self.length <<= 1
self.segtree = [ini_num] * (2 * self.length - 1)
def update(self, index, n):
leaf_index = index + self.length - 1
self.segtree[leaf_index]... | Traceback (most recent call last):
File "/tmp/tmp4t9ymier/tmphf2q9j1f.py", line 23, in <module>
v_num, query = (int(n) for n in input().split(" "))
^^^^^^^
EOFError: EOF when reading a line
| |
s887803083 | p02345 | u798087532 | 1511849201 | Python | Python3 | py | Runtime Error | 20 | 5620 | 1769 | class SegmentTree():
def __init__(self,n):
self.dat = [INF for _ in range(n*2-1)]
#index n???????????????????????¢?????????:
#???????????? : (n-1)//2
#???????????? : (2n+1) , (2n+2)
self.n = n
def update (self,node_index,value):
""" index?????????value????????´?????? """
index = node_index + (self.n-1)... | Traceback (most recent call last):
File "/tmp/tmps78h3n4a/tmppg8ih5x0.py", line 43, in <module>
n ,q = map(int,input().split(" "))
^^^^^^^
EOFError: EOF when reading a line
| |
s777505396 | p02345 | u045830275 | 1512172690 | Python | Python3 | py | Runtime Error | 0 | 0 | 667 | import numpy as np
def update(a, i, x) :
a[i] = x
def find(a, s, t) :
return a[s:t+1].min()
def main() :
n, q = [int(i) for i in input().split()]
a = np.ones(n, dtype=int) * (2**31 - 1)
com = np.array([], dtype=int)
x = np.array([], dtype=int)
y= np.array([], dtype=int)
for _ in ran... | Traceback (most recent call last):
File "/tmp/tmpzfycauen/tmpwbvq8g1c.py", line 31, in <module>
main()
File "/tmp/tmpzfycauen/tmpwbvq8g1c.py", line 12, in main
n, q = [int(i) for i in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s265657852 | p02345 | u045830275 | 1512172731 | Python | Python3 | py | Runtime Error | 0 | 0 | 667 | import numpy as np
def update(a, i, x) :
a[i] = x
def find(a, s, t) :
return a[s:t+1].min()
def main() :
n, q = [int(i) for i in input().split()]
a = np.ones(n, dtype=int) * (2**31 - 1)
com = np.array([], dtype=int)
x = np.array([], dtype=int)
y= np.array([], dtype=int)
for _ in ran... | Traceback (most recent call last):
File "/tmp/tmpoyknkz9w/tmpakwaqkpz.py", line 31, in <module>
main()
File "/tmp/tmpoyknkz9w/tmpakwaqkpz.py", line 12, in main
n, q = [int(i) for i in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s688292012 | p02345 | u045830275 | 1512172824 | Python | Python3 | py | Runtime Error | 0 | 0 | 667 | import numpy as np
def update(a, i, x) :
a[i] = x
def find(a, s, t) :
return a[s:t+1].min()
def main() :
n, q = [int(i) for i in input().split()]
a = np.ones(n, dtype=int) * (2**31 - 1)
com = np.array([], dtype=int)
x = np.array([], dtype=int)
y= np.array([], dtype=int)
for _ in ran... | Traceback (most recent call last):
File "/tmp/tmpya_uqkan/tmp08hf6_dy.py", line 31, in <module>
main()
File "/tmp/tmpya_uqkan/tmp08hf6_dy.py", line 12, in main
n, q = [int(i) for i in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s778196395 | p02345 | u045830275 | 1512173230 | Python | Python3 | py | Runtime Error | 0 | 0 | 682 | import numpy
def update(a, i, x) :
a[i] = x
def find(a, s, t) :
return a[s:t+1].min()
def main() :
n, q = [int(i) for i in input().split()]
a = numpy.ones(n, dtype=int) * (2**31 - 1)
com = numpy.array([], dtype=int)
x = numpy.array([], dtype=int)
y= numpy.array([], dtype=int)
for _ ... | Traceback (most recent call last):
File "/tmp/tmpmgt2vhds/tmpybiwonyz.py", line 31, in <module>
main()
File "/tmp/tmpmgt2vhds/tmpybiwonyz.py", line 12, in main
n, q = [int(i) for i in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s426657145 | p02345 | u011621222 | 1513253028 | Python | Python3 | py | Runtime Error | 0 | 0 | 2195 | # -*- coding: utf-8 -*-
# !/bin/python
import math
import itertools
INITER = 2**32-1
class sqrt_deco(object):
"""
>>> data = sqrt_deco(5, min)
>>> data.update(1, 2)
>>> data.raw_data
[INF, 2, INF]
>>> data.query(0, 2)
2
"""
def __init__(self, len_element: int, op=min):
se... | File "/tmp/tmp_eyx_hm3/tmpmzpu9cph.py", line 63
else order == 1:
^^^^^
SyntaxError: expected ':'
| |
s726144582 | p02345 | u167493070 | 1524464346 | Python | Python3 | py | Runtime Error | 0 | 0 | 898 | import sys;
def init(n_):
length = 1;
while(length < n_):
length*=2
element=[0]*(2*length-1)
for i in range(2*length-1):
element[i] = initial
return element
def update(k,a,element):
k+=n
element[k]=a
while(k > 0):
k = (int)((k-1)/2)
element[k] = min(elem... | Traceback (most recent call last):
File "/tmp/tmpossp3g_3/tmpv2saikeo.py", line 32, in <module>
n,q = map(int, input().split());
^^^^^^^
EOFError: EOF when reading a line
| |
s039883523 | p02345 | u408284582 | 1524715844 | Python | Python3 | py | Runtime Error | 20 | 5612 | 909 | import sys
def initRMQ(n, D):
n_ = 1
while n_ < n:
n_ *= 2
for i in range(2*n_ - 1):
D.append(2147483647)
return n_
def update(k, a):
k += n_ - 1
D[k] = a
while k > 0:
k = int((k - 1) / 2)
D[k] = min(D[k*2 + 1], D[k*2 + 2])
def findMin(a, b):
retur... | Traceback (most recent call last):
File "/tmp/tmpa4z5vw0o/tmphj9b20l7.py", line 42, in <module>
n, q = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s910351999 | p02345 | u408284582 | 1524716099 | Python | Python3 | py | Runtime Error | 20 | 5608 | 939 | import sys
sys.setrecursionlimit(10000)
def initRMQ(n, D):
n_ = 1
while n_ < n:
n_ *= 2
for i in range(2*n_ - 1):
D.append(2147483647)
return n_
def update(k, a):
k += n_ - 1
D[k] = a
while k > 0:
k = int((k - 1) / 2)
D[k] = min(D[k*2 + 1], D[k*2 + 2])
... | Traceback (most recent call last):
File "/tmp/tmpxhcb7v63/tmpwuvy4sf1.py", line 44, in <module>
n, q = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s884557689 | p02346 | u209989098 | 1531356990 | Python | Python3 | py | Runtime Error | 0 | 0 | 329 | a = list(map(int,input().split()))
b = []
ss = 1
f = 0
for i in range(a[0]):
k = int(input())
ss*= k
b.append(ss)
if k == 0:
print(a[0])
f = 1
break
k = 0
ss = 0
if f == 0:
for i in range(a[0]):
for j in range(a[0]-i):
k = b[a[0]-1-j] / b[i]
if k <= a[1]:
if a[0]-j-i >= ss:
ss = a[0]-i-j
p... | Traceback (most recent call last):
File "/tmp/tmplj4m13xx/tmpwd28p2_3.py", line 1, in <module>
a = list(map(int,input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s430855593 | p02346 | u209989098 | 1531358629 | Python | Python3 | py | Runtime Error | 0 | 0 | 251 | a = list(map(int,input().split()))
b = [0]*a[0]
for i in range(a[1]):
c = list(map(int,input().split()))
if c[0] == 0:
for j in range(a[0]-c[1]):
b[c[1]+j] += c[2]
else:
if c[1] == 1:
print(b[c[2]])
else:
print(b[c[2]]-b[c[1]-1])
| Traceback (most recent call last):
File "/tmp/tmpd56qs1t1/tmpc1cg_cxe.py", line 1, in <module>
a = list(map(int,input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s512387371 | p02346 | u938878704 | 1531659908 | Python | Python3 | py | Runtime Error | 20 | 5612 | 930 | n, q = map(int, input().split())
answer = []
# create segtree
size = 1
while size < n :
size *= 2
size = size * 2 - 1
segtree = [0 for x in range(size)]
# update query
def update(i, x) :
ind = size // 2 + i
segtree[ind] += x
while ind :
ind = (ind - 1) // 2 # parent
ch1 = se... | Traceback (most recent call last):
File "/tmp/tmpyeqwxj_b/tmppmjtw348.py", line 1, in <module>
n, q = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s029476330 | p02346 | u197615397 | 1545375923 | Python | Python3 | py | Runtime Error | 0 | 0 | 934 | import sys
class BinaryIndexedTree(object):
__slots__ = ["tree"]
def __init__(self, size: int):
self.tree = [0]*(size+1)
def add(self, index: int, value: int) -> None:
tree = self.tree
next_index = index + 1
while next_index < len(tree):
tree[next_index] += v... | Traceback (most recent call last):
File "/tmp/tmps8m0krr1/tmporbdikka.py", line 30, in <module>
n, q = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s572644725 | p02346 | u165578704 | 1556452780 | Python | Python3 | py | Runtime Error | 20 | 5612 | 1144 | # -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10 ** 9)
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
INF=2**31-1
class BIT:
def __init__(self, n):
# 0-indexed
... | Traceback (most recent call last):
File "/tmp/tmpppy2iu_z/tmpg4if9je7.py", line 46, in <module>
N,Q=MAP()
^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s461155780 | p02346 | u284474275 | 1423980547 | Python | Python | py | Runtime Error | 20 | 4428 | 1209 | import sys
import itertools
class RSQ:
def __init__(self, n):
self.sz = 1
self.inf = (1 << 31) - 1
while self.sz < n: self.sz = self.sz << 1
self.dat = [0] * (2 * self.sz - 1)
def update(self, idx, x):
idx += self.sz - 1
self.dat[idx] += x
while idx ... | Traceback (most recent call last):
File "/tmp/tmp2024t3zl/tmp5hxi_z_a.py", line 33, in <module>
n, q = line.split()
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s900774801 | p02346 | u633068244 | 1432618207 | Python | Python | py | Runtime Error | 0 | 0 | 644 | class BIT:
def __init__(self, size):
self.size = size
self.bit = [0] * (size + 1)
# sum [0, i)
def sum(self, i):
s = 0
while (i > 0):
s += self.bit[i]
i -= i & -i
return s
# sum [i, j)
def sum_sec(self, i, j):
return self.sum(... | File "/tmp/tmp405nx7qp/tmp6gl_s4iq.py", line 29
else: print bit.sum(x - 1, y)
^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s253338269 | p02346 | u797673668 | 1455599225 | Python | Python3 | py | Runtime Error | 30 | 7772 | 626 | from math import sqrt, ceil
n, q = map(int, input().split())
unit = ceil(sqrt(n))
l = [(0, [0] * unit) for _ in range(unit)]
while q:
op, s, t = map(int, input().split())
sd, sm = s // unit, s % unit
if op:
td, tm = t // unit, t % unit
if sd == td:
print(sum(l[sd][1][sm:tm + 1... | Traceback (most recent call last):
File "/tmp/tmpmw1g4dmw/tmpf7g1pmvw.py", line 3, in <module>
n, q = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s827206961 | p02346 | u603049633 | 1497056324 | Python | Python3 | py | Runtime Error | 30 | 7796 | 1331 | import math, sys
#??°????????????????????§????¨????????????¨???????????°??????????????????????§????
class SegmentTree():
def __init__(self, n):
self.TreeRange = pow(2, math.ceil(math.log2(n)))
self.List = [0] * (2 * self.TreeRange - 1)
def add(self, i, x):
i += self.TreeRange - 1
... | Traceback (most recent call last):
File "/tmp/tmpvbg_2af6/tmpuv4dg18g.py", line 30, in <module>
n,q = map(int, _input[0].split())
~~~~~~^^^
IndexError: list index out of range
| |
s189068407 | p02346 | u811733736 | 1506786549 | Python | Python3 | py | Runtime Error | 20 | 7804 | 2193 | # -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=DSL_2_B&lang=jp
"""
import sys
from sys import stdin
input = stdin.readline
class RSQ(object):
INT_MAX = 2**31 - 1
def __init__(self, nn, init_val=0):
self.val = [init_val] * (nn+1)
self.n = 1
while ... | Traceback (most recent call last):
File "/tmp/tmph8rwm9wc/tmp5wslp7fa.py", line 72, in <module>
main(sys.argv[1:])
File "/tmp/tmph8rwm9wc/tmp5wslp7fa.py", line 59, in main
n, q = map(int, input().split(' '))
^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s137982959 | p02346 | u798803522 | 1511706858 | Python | Python3 | py | Runtime Error | 30 | 7748 | 1515 | class RSQ:
def __init__(self, length, ini_num = float("inf")):
self.length = 1
self.ini_num = ini_num
while self.length < length:
self.length <<= 1
self.segtree = [ini_num] * (2 * self.length - 1)
def update(self, index, num):
leaf_index = index + self.length... | Traceback (most recent call last):
File "/tmp/tmpf2n869_v/tmpjo1de3mk.py", line 34, in <module>
v_num, query = map(int, input().split(" "))
^^^^^^^
EOFError: EOF when reading a line
| |
s847665316 | p02346 | u798803522 | 1511707049 | Python | Python3 | py | Runtime Error | 20 | 7788 | 1550 | class RSQ:
def __init__(self, length, ini_num = float("inf")):
self.length = 1
self.ini_num = ini_num
if length == 1:
length = 2
while self.length < length:
self.length <<= 1
self.segtree = [ini_num] * (2 * self.length - 1)
def update(self, index,... | Traceback (most recent call last):
File "/tmp/tmp7_5r4zx4/tmp489345ql.py", line 36, in <module>
v_num, query = map(int, input().split(" "))
^^^^^^^
EOFError: EOF when reading a line
| |
s811996675 | p02346 | u798087532 | 1511850895 | Python | Python3 | py | Runtime Error | 20 | 5612 | 1717 | class SegmentTree():
def __init__(self,n):
self.dat = [0 for _ in range(n*2-1)]
#index n???????????????????????¢?????????:
#???????????? : (n-1)//2
#???????????? : (2n+1) , (2n+2)
self.n = n
def update (self,node_index,value):
""" index?????????value????????´?????? """
index = node_index + (self.n-1) #... | Traceback (most recent call last):
File "/tmp/tmp39qo7_v4/tmpaak34fmj.py", line 41, in <module>
n ,q = map(int,input().split(" "))
^^^^^^^
EOFError: EOF when reading a line
| |
s979840201 | p02346 | u167493070 | 1524466002 | Python | Python3 | py | Runtime Error | 20 | 5620 | 866 | import sys;
def init(n_):
length = 1;
while(length < n_):
length*=2
element=[0]*(2*length-1)
for i in range(2*length-1):
element[i] = 0
return element,length
def update(k,a,element):
k+=n-1
element[k]+=a
while(k > 0):
k = (int)((k-1)/2)
element[k] = elem... | Traceback (most recent call last):
File "/tmp/tmpnk2up_87/tmptwg2qczb.py", line 32, in <module>
n,q = map(int, input().split());
^^^^^^^
EOFError: EOF when reading a line
| |
s872125585 | p02346 | u167493070 | 1524466783 | Python | Python3 | py | Runtime Error | 20 | 5620 | 866 | import sys;
def init(n_):
length = 1;
while(length < n_):
length*=2
element=[0]*(2*length-1)
for i in range(2*length-1):
element[i] = 0
return element,length
def update(k,a,element):
k+=n-1
element[k]+=a
while(k > 0):
k = (int)((k-1)/2)
element[k] = elem... | Traceback (most recent call last):
File "/tmp/tmphq00702k/tmpjrjtqlqr.py", line 32, in <module>
n,q = map(int, input().split());
^^^^^^^
EOFError: EOF when reading a line
| |
s806848069 | p02346 | u167493070 | 1524467156 | Python | Python3 | py | Runtime Error | 20 | 5620 | 995 | import sys;
def init(n_):
length = 1;
while(length < n_):
length*=2
length2 = (2*length-2)
if(length2 == 0):
length2 = 1
element=[0]*length2
for i in range(length2):
element[i] = 0
return element,length
def update(k,a,element):
k+=n-1
if(n == 1):
k =... | Traceback (most recent call last):
File "/tmp/tmp_l2370f5/tmpf79um9k6.py", line 37, in <module>
n,q = map(int, input().split());
^^^^^^^
EOFError: EOF when reading a line
| |
s714510095 | p02346 | u167493070 | 1524467187 | Python | Python3 | py | Runtime Error | 20 | 5624 | 995 | import sys;
def init(n_):
length = 1;
while(length < n_):
length*=2
length2 = (2*length-1)
if(length2 == 0):
length2 = 1
element=[0]*length2
for i in range(length2):
element[i] = 0
return element,length
def update(k,a,element):
k+=n-1
if(n == 1):
k =... | Traceback (most recent call last):
File "/tmp/tmpaj2wahfy/tmp_p0ofmdl.py", line 37, in <module>
n,q = map(int, input().split());
^^^^^^^
EOFError: EOF when reading a line
| |
s212959065 | p02346 | u265136581 | 1524566275 | Python | Python3 | py | Runtime Error | 20 | 5612 | 784 |
n, q = map(int, input().split())
n_ = 1 # 実際に確保した配列のサイズ
while n_ < n:
n_ *= 2
seg_tree = [0 for i in range(2*n_-1)]
def add(i, x):
i += n_ - 1
seg_tree[i] += x
while i > 0 :
i = int((i - 1)/2)
#seg_tree[i] = seg_tree[i*2+1] + seg_tree[i*2+2]
seg_tree[i] += x
def getSum(s, t):
return query(s, ... | Traceback (most recent call last):
File "/tmp/tmpphq2gbd2/tmpu5jezs4_.py", line 2, in <module>
n, q = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s517603430 | p02346 | u408284582 | 1524716955 | Python | Python3 | py | Runtime Error | 20 | 5612 | 879 | import sys
sys.setrecursionlimit(10000)
def initRMQ(n):
n_ = 1
while n_ < n:
n_ *= 2
D = [0] * (2*n_ - 1)
return n_, D
def update(k, a):
k += n_ - 1
D[k] += a
while k > 0:
k = int((k - 1) / 2)
D[k] = D[k*2 + 1] + D[k*2 + 2]
def findSum(a, b):
return query... | Traceback (most recent call last):
File "/tmp/tmp9rcgn6ox/tmp7u_3h8z9.py", line 43, in <module>
n, q = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s213975908 | p02346 | u408284582 | 1524717281 | Python | Python3 | py | Runtime Error | 20 | 5608 | 915 | import sys
sys.setrecursionlimit(10000)
def initRMQ(n):
n_ = 1
while n_ < n:
n_ *= 2
D = []
for _ in range(2*n_ - 1):
D.append(0)
return n_, D
def update(k, a):
k += n_ - 1
D[k] += a
while k > 0:
k = int((k - 1) / 2)
D[k] = D[k*2 + 1] + D[k*2 + 2]
... | Traceback (most recent call last):
File "/tmp/tmpa_gv27wv/tmpfe22c5pq.py", line 45, in <module>
n, q = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s782078099 | p02346 | u126478680 | 1528113373 | Python | Python3 | py | Runtime Error | 20 | 5696 | 1277 | import math
class SegmentTree():
def __init__(self, n):
self.n = n
self.height = math.ceil(math.log2(n))
self.nodes = [0 for i in range(pow(2, self.height+1)-1)]
self.leaf_start = pow(2, self.height)-1
def update(self, i, x):
pntr = self.leaf_start + i
self.node... | Traceback (most recent call last):
File "/tmp/tmpsld4pi21/tmp5j747mg2.py", line 36, in <module>
n, q = list(map(int, input().split(' ')))
^^^^^^^
EOFError: EOF when reading a line
| |
s812701358 | p02347 | u567380442 | 1427618547 | Python | Python3 | py | Runtime Error | 0 | 0 | 2370 | #???????????£?????§????????????????±???¨????????¢?????´?????????
def partition(data, l, r, pivotIndex, key):
pivotValue = key(data[pivotIndex])
data[pivotIndex], data[r] = data[r], data[pivotIndex]
storeIndex = l
for i in range(l, r):
if key(data[i]) < pivotValue:
data[storeIndex], ... | Traceback (most recent call last):
File "/tmp/tmppcatjv0b/tmpomjtpulk.py", line 68, in <module>
n = int(readline())
^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s940418566 | p02347 | u797673668 | 1455715739 | Python | Python3 | py | Runtime Error | 0 | 0 | 2890 | n = int(input())
def memoize(f):
global n
memo = [-1] * n
def main(x):
result = memo[x]
if result == -1:
result = memo[x] = f(x)
return result
return main
class Bound:
def __init__(self, sx, tx, sy, ty):
self.sx = sx
self.tx = tx
self... | Traceback (most recent call last):
File "/tmp/tmpo8y9btk3/tmpjy9u8_zi.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s152411244 | p02347 | u669284080 | 1466693547 | Python | Python3 | py | Runtime Error | 0 | 0 | 953 | import sys
import stdin
import math
from operator import itemgetter
from bisect import bisect_left, bisect_right
readline = stdin.readline
# main
n = int(readline())
xy = [tuple(map(int, readline().split())) + (i,) for i in range(n)]
# [..., (x_i, y_i, i), ...]
# sort by x
xy.sort()
root = int(math.sqrt(len(xy)))
lo... | Traceback (most recent call last):
File "/tmp/tmpjt1_55j4/tmpcuspzlby.py", line 2, in <module>
import stdin
ModuleNotFoundError: No module named 'stdin'
| |
s308356622 | p02347 | u072053884 | 1468811852 | Python | Python3 | py | Runtime Error | 0 | 0 | 1427 | import sys
i_f = sys.stdin
n = int(i_f.readline())
T = [[i, *map(int, i_f.readline().split()), None, None] for i in range(n)]
def make2DTree(l, r, depth):
if l >= r:
return None
mid = (l + r) // 2
if depth % 2 == 0:
T[l:r] = sorted(T[l:r], key=lambda n: n[1])
else:
T[l:r] =... | Traceback (most recent call last):
File "/tmp/tmp4ecilqze/tmppfygj6cv.py", line 5, in <module>
n = int(i_f.readline())
^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s272670205 | p02347 | u072053884 | 1468811894 | Python | Python3 | py | Runtime Error | 0 | 0 | 1427 | import sys
i_f = sys.stdin
n = int(i_f.readline())
T = [[i, *map(int, i_f.readline().split()), None, None] for i in range(n)]
def make2DTree(l, r, depth):
if l >= r:
return None
mid = (l + r) // 2
if depth % 2 == 0:
T[l:r] = sorted(T[l:r], key=lambda n: n[1])
else:
T[l:r] =... | Traceback (most recent call last):
File "/tmp/tmpifrwdy_w/tmp5m3sfbks.py", line 5, in <module>
n = int(i_f.readline())
^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s454826044 | p02347 | u072053884 | 1468812982 | Python | Python3 | py | Runtime Error | 0 | 0 | 1427 | import sys
i_f = sys.stdin
n = int(i_f.readline())
T = [[i, *map(int, i_f.readline().split()), None, None] for i in range(n)]
def make2DTree(l, r, depth):
if l >= r:
return None
mid = (l + r) // 2
if depth % 2 == 0:
T[l:r] = sorted(T[l:r], key=lambda n: n[1])
else:
T[l:r] =... | Traceback (most recent call last):
File "/tmp/tmp4vvu8svd/tmpc0sina3t.py", line 5, in <module>
n = int(i_f.readline())
^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s453928793 | p02347 | u072053884 | 1468813452 | Python | Python3 | py | Runtime Error | 0 | 0 | 1426 | import sys
i_f = sys.stdin
n = int(i_f.readline())
T = [[i, map(int, i_f.readline().split()), None, None] for i in range(n)]
def make2DTree(l, r, depth):
if l >= r:
return None
mid = (l + r) // 2
if depth % 2 == 0:
T[l:r] = sorted(T[l:r], key=lambda n: n[1])
else:
T[l:r] = ... | Traceback (most recent call last):
File "/tmp/tmpo5oz4iaq/tmpjxi_41su.py", line 5, in <module>
n = int(i_f.readline())
^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s483124363 | p02347 | u072053884 | 1469002305 | Python | Python3 | py | Runtime Error | 4330 | 93472 | 1734 | import sys
i_f = sys.stdin
n = int(i_f.readline())
T = []
for i in range(n):
x, y = map(int, i_f.readline().split())
# [0] is input number.
# [3] is left node, and [4] is right node.
T.append([i, x, y, None, None])
def partition(A, l, r, key):
x = A[r][key]
i = l - 1
for j in range(l, r)... | Traceback (most recent call last):
File "/tmp/tmpmfovqccj/tmpdaazf2d7.py", line 5, in <module>
n = int(i_f.readline())
^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s693126703 | p02347 | u022407960 | 1480097982 | Python | Python3 | py | Runtime Error | 30 | 8076 | 2312 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from sys import stdin
from operator import attrgetter
from collections import namedtuple
class Node(object):
__slots__ = ('location', 'left', 'right')
def __init__(self):
self.location = -1
self.left, self.right = None, None
def make2DTree(left... | Traceback (most recent call last):
File "/tmp/tmp19pofv6j/tmpehskn4cz.py", line 72, in <module>
points_num = int(_input[0])
~~~~~~^^^
IndexError: list index out of range
| |
s454903032 | p02347 | u848688448 | 1488113691 | Python | Python3 | py | Runtime Error | 0 | 0 | 1625 | import sys
readline = sys.stdin.readline
from bisect import bisect, bisect_right
from itertools import chain
n = input()
n0 = 2**n.bit_length()
data = [None]*(n0*2)
# ?????°???????????¨????§????
def init(k, l, r):
if r - l == 1:
data[k] = [ys[l]]
else:
le = 2*k+1; ri = 2*k+2
init(le, l, ... | File "/tmp/tmppgizj0qa/tmpf78yzggg.py", line 54
print e
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s633520713 | p02347 | u796784914 | 1509168203 | Python | Python | py | Runtime Error | 10 | 6444 | 849 | from operator import itemgetter
from bisect import bisect_left, bisect_right
import sys
def main():
n = int(sys.stdin.readline())
keys = map(lambda i:map(int,sys.stdin.readline().split())+[i],xrange(n))
keys.sort()
q = int(sys.stdin.readline())
for i in xrange(q):
x0,x1,y0,y1 = map(int,sys... | Traceback (most recent call last):
File "/tmp/tmpubpvm0o1/tmppo2id3kh.py", line 25, in <module>
main()
File "/tmp/tmpubpvm0o1/tmppo2id3kh.py", line 6, in main
n = int(sys.stdin.readline())
^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s572414264 | p02347 | u526040679 | 1518504678 | Python | Python3 | py | Runtime Error | 0 | 0 | 1693 | import numpy as np
n = int(input())
xy = []
for i in range(n):
x,y = [int(i) for i in input().split()]
xy.append([x,y,i])
xy = np.array(sorted(xy))
q = int(input())
for i in range(q):
sx,tx,sy,ty = [int(i) for i in input().split()]
ans = kdtree(xy,sx,tx,sy,ty)
for i in ans:
print(... | Traceback (most recent call last):
File "/tmp/tmprx3g7i8g/tmpi8_xpxs1.py", line 3, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s116214593 | p02347 | u526040679 | 1518505560 | Python | Python3 | py | Runtime Error | 0 | 0 | 1696 | import numpy as np
def kdtree(xy,sx,tx,sy,ty):
x_i = np.array(binary_search(xy[0:,0],sx,0))
x_i = min(x_i)
print(x_i)
x_j = np.array(binary_search(xy[x_i:,0],tx,1))
x_j += x_i
x_j = max(x_j)
print(x_j)
ans = []
for k in range(x_i,x_j+1):
if sy <= xy[k,1] <= ty:
a... | Traceback (most recent call last):
File "/tmp/tmpgc6hz05b/tmpep8xhp14.py", line 61, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s933389403 | p02347 | u662418022 | 1518936903 | Python | Python3 | py | Runtime Error | 0 | 0 | 1821 | # -*- coding: utf-8 -*-
from IPython import embed
class Node():
def __init__(self, loc=None, left=None, right=None):
self.loc = loc
self.l = left
self.r = right
class Point():
def __init__(self, id, xy):
self.id = int(id)
self.x = int(xy[0])
self.y = int(xy[1])
... | Traceback (most recent call last):
File "/tmp/tmp9zkutn02/tmp8y624r_z.py", line 18, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s495367618 | p02347 | u662418022 | 1518938878 | Python | Python3 | py | Runtime Error | 0 | 0 | 1850 | # -*- coding: utf-8 -*-
class Node():
def __init__(self, loc=None, left=None, right=None):
self.loc = loc
self.l = left
self.r = right
class Point():
def __init__(self, id, xy):
self.id = int(id)
self.x = int(xy[0])
self.y = int(xy[1])
if __name__ == '__main__... | Traceback (most recent call last):
File "/tmp/tmpdw4v5cws/tmp6sgu13ko.py", line 18, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s533935115 | p02348 | u241923784 | 1556441436 | Python | Python3 | py | Runtime Error | 20 | 5680 | 801 | import math
INT_MAX = 2147483647
MAX = 100003
n,q=(int(x) for x in input().split())
b= math.sqrt(n)
def update(x):
for i in range(int(x*b),min(n-1,(x+1)*b)):a[i]=lazy[x]
l[x]=-1;
return;
if __name__=='__main__':
a = [INT_MAX for i in range(n)]
l = [-1 for i in range(n)]
for i in ... | Traceback (most recent call last):
File "/tmp/tmp2l0huhvk/tmp1uo45m1a.py", line 5, in <module>
n,q=(int(x) for x in input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s049172387 | p02348 | u241923784 | 1556441499 | Python | Python3 | py | Runtime Error | 20 | 5684 | 806 | import math
INT_MAX = 2147483647
MAX = 100003
n,q=(int(x) for x in input().split())
b= math.sqrt(n)
def update(x):
for i in range(int(x*b),min(n-1,(x+1)*b)):a[i]=lazy[x]
l[x]=-1;
return;
if __name__=='__main__':
a = [INT_MAX for i in range(n)]
l = [-1 for i in range(n)]
for i in ... | Traceback (most recent call last):
File "/tmp/tmpo286m8a2/tmpdnzsdoq0.py", line 5, in <module>
n,q=(int(x) for x in input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s873325607 | p02348 | u241923784 | 1556441551 | Python | Python3 | py | Runtime Error | 20 | 5684 | 808 | import math
INT_MAX = 2147483647
MAX = 100003
n,q=(int(x) for x in input().split())
b= math.sqrt(n)
def update(x):
for i in range(int(x*b),int(min(n-1,(x+1)*b))):a[i]=l[x]
l[x]=-1;
return;
if __name__=='__main__':
a = [INT_MAX for i in range(n)]
l = [-1 for i in range(n)]
for i i... | Traceback (most recent call last):
File "/tmp/tmpdgonj2wx/tmpo45tc7w4.py", line 5, in <module>
n,q=(int(x) for x in input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s230834586 | p02348 | u241923784 | 1556441580 | Python | Python3 | py | Runtime Error | 0 | 0 | 804 | import math
INT_MAX = 2147483647
MAX = 100003
n,q=(int(x) for x in input().split())
b= math.sqrt(n)
def update(x):
for i in range(int(x*b),(min(n-1,(x+1)*b)):a[i]=l[x]
l[x]=-1;
return;
if __name__=='__main__':
a = [INT_MAX for i in range(n)]
l = [-1 for i in range(n)]
for i in ra... | File "/tmp/tmpu2hlsvkw/tmpvqhlhp5z.py", line 10
for i in range(int(x*b),(min(n-1,(x+1)*b)):a[i]=l[x]
^
SyntaxError: invalid syntax
| |
s566397696 | p02348 | u241923784 | 1556441610 | Python | Python3 | py | Runtime Error | 20 | 5684 | 803 | import math
INT_MAX = 2147483647
MAX = 100003
n,q=(int(x) for x in input().split())
b= math.sqrt(n)
def update(x):
for i in range(int(x*b),min(n-1,(x+1)*b)):a[i]=l[x]
l[x]=-1;
return;
if __name__=='__main__':
a = [INT_MAX for i in range(n)]
l = [-1 for i in range(n)]
for i in ran... | Traceback (most recent call last):
File "/tmp/tmp46fd9l2t/tmp2kndw1lp.py", line 5, in <module>
n,q=(int(x) for x in input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s696016686 | p02348 | u241923784 | 1556441648 | Python | Python3 | py | Runtime Error | 20 | 5684 | 808 | import math
INT_MAX = 2147483647
MAX = 100003
n,q=(int(x) for x in input().split())
b= math.sqrt(n)
def update(x):
for i in range(int(x*b),min(n-1,(x+1)*b)):a[int(i)]=l[x]
l[x]=-1;
return;
if __name__=='__main__':
a = [INT_MAX for i in range(n)]
l = [-1 for i in range(n)]
for i i... | Traceback (most recent call last):
File "/tmp/tmp6gd9z7xc/tmphbvqi4yy.py", line 5, in <module>
n,q=(int(x) for x in input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s886145806 | p02348 | u241923784 | 1556441690 | Python | Python3 | py | Runtime Error | 20 | 5688 | 808 | import math
INT_MAX = 2147483647
MAX = 100003
n,q=(int(x) for x in input().split())
b= math.sqrt(n)
def update(x):
for i in range(int(x*b),min(n-1,(x+1)*b)):a[i]=l[int(x)]
l[x]=-1;
return;
if __name__=='__main__':
a = [INT_MAX for i in range(n)]
l = [-1 for i in range(n)]
for i i... | Traceback (most recent call last):
File "/tmp/tmpxkrr15oo/tmpjasi3jmh.py", line 5, in <module>
n,q=(int(x) for x in input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s597574674 | p02348 | u241923784 | 1556441723 | Python | Python3 | py | Runtime Error | 20 | 5688 | 813 | import math
INT_MAX = 2147483647
MAX = 100003
n,q=(int(x) for x in input().split())
b= math.sqrt(n)
def update(x):
for i in range(int(x*b),min(n-1,(x+1)*b)):a[i]=l[int(x)]
l[int(x)]=-1;
return;
if __name__=='__main__':
a = [INT_MAX for i in range(n)]
l = [-1 for i in range(n)]
fo... | Traceback (most recent call last):
File "/tmp/tmptyw9rej_/tmpge9ithaf.py", line 5, in <module>
n,q=(int(x) for x in input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s125126883 | p02348 | u241923784 | 1556442123 | Python | Python3 | py | Runtime Error | 0 | 0 | 969 | import math
INT_MAX = 2147483647
MAX = 100003
n,q=(int(x) for x in input().split())
b= math.sqrt(n)
def judge_max(x,y):
if x > y :return x
else:return y
def judge_min(x,y):
if x > y :return y
else return x
def update(x):
for i in range(int(x*b),int(judge_min(n-1,(x+1)*b))):a[i]=l[int(... | File "/tmp/tmpp0w78g49/tmp2n81dyy9.py", line 16
else return x
^^^^^^
SyntaxError: expected ':'
| |
s547663254 | p02348 | u241923784 | 1556442371 | Python | Python3 | py | Runtime Error | 0 | 0 | 967 | import math
INT_MAX = 2147483647
MAX = 100003
n,q=(int(x) for x in input().split())
b= math.sqrt(n)
def judge_max(x,y):
if x > y :return x
else:return y
def judge_min(x,y):
if x > y :return y
else :return x
def update(x):
for i in range(int(x*b),int(judge_min(n-1,(x+1)*b))):a[i]=l[int... | Traceback (most recent call last):
File "/tmp/tmp4ynoevb3/tmpjk55ygxo.py", line 5, in <module>
n,q=(int(x) for x in input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s133771397 | p02348 | u241923784 | 1556448467 | Python | Python | py | Runtime Error | 0 | 0 | 833 | import math
INT_MAX = 2147483647
n,q=(int(x) for x in input().split())
b= int(math.sqrt(n))
def update(x_f):
x = int(x_f)
for i in range(int(x*b),min(n-1,int((x+1)*b-1))+1):a[i]=l[x]
l[x]=-1
return
if __name__=='__main__':
a = [INT_MAX for i in range(n)]
l = [-1 for i in range... | Traceback (most recent call last):
File "/tmp/tmp4o6hf16w/tmp_jntrm6b.py", line 4, in <module>
n,q=(int(x) for x in input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s532132769 | p02350 | u464454066 | 1556165338 | Python | Python | py | Runtime Error | 0 | 0 | 2000 | import sys
import math
import time
sys.setrecursionlimit(20000)
INT_MAX = 2**31 - 1
def lazy_tree_merge(lazy,tree,i,N):
if(lazy[i] is not None):
tree[i] = lazy[i]
if(i < N-1):
lazy[i*2+1] = lazy[i]
lazy[i*2+2] = lazy[i]
lazy[i] = None
def update(tree,lazy,x,y,k,l,r,i... | Traceback (most recent call last):
File "/tmp/tmpnch875iq/tmp9f785dym.py", line 46, in <module>
_N,query_num = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s095827480 | p02350 | u197615397 | 1499912203 | Python | Python3 | py | Runtime Error | 30 | 7964 | 3953 | import math
class SegmentTree:
__slots__ = ["elem_size", "tree_size", "tree", "lazy"]
def __init__(self, a: list, default: int):
real_size = len(a)
self.elem_size = 1 << math.ceil(math.log2(real_size))
self.tree_size = 2 * self.elem_size
self.tree = [default]*self.elem_size + ... | Traceback (most recent call last):
File "/tmp/tmpnv8v09lj/tmp3xwd8_z0.py", line 114, in <module>
n, q = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s898550138 | p02354 | u176732165 | 1476548586 | Python | Python | py | Runtime Error | 0 | 0 | 453 | import sys
INF = (sys.maxint)/3
def SmallestWindow(S, a_list):
i = 0
j = 0
tmpS = 0
res = INF
while 1 :
while tmpS < S and i <len(a_list):
i +=1
tmpS += a_list[i]
if (tmpS <S):
break
res = min (res, i-j)
j += 1
tmpS -=a_list[j]
if res == INF:
res = 0
return res
def main():
N, S = map(i... | File "/tmp/tmpgsn45nh5/tmp7nh2_3o_.py", line 26
print SmallestWindow(S, a_list)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s663983628 | p02354 | u728137020 | 1525817079 | Python | Python3 | py | Runtime Error | 0 | 0 | 277 | A=map(int,raw_input().split())
list=[]
sum=0
S=1e6+1
for i in map(int,raw_input().split()):
list.append(i)
sum+=i
if sum>A[1]:
while sum>=A[1]:
sum-=list.popleft()
S=min(S,len(list)+1)
if S==1e6+1:
print("0")
else:
print(S)
| Traceback (most recent call last):
File "/tmp/tmpzs0kho_p/tmpavbluawy.py", line 1, in <module>
A=map(int,raw_input().split())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s011332754 | p02354 | u728137020 | 1525817115 | Python | Python3 | py | Runtime Error | 0 | 0 | 273 | A=map(int,raw_input().split())
list=[]
sum=0
S=1e6
for i in map(int,raw_input().split()):
list.append(i)
sum+=i
if sum>A[1]:
while sum>=A[1]:
sum-=list.popleft()
S=min(S,len(list)+1)
if S==1e6:
print("0")
else:
print(S)
| Traceback (most recent call last):
File "/tmp/tmpkkwjgy78/tmp7gg7owpr.py", line 1, in <module>
A=map(int,raw_input().split())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s555550112 | p02354 | u011621222 | 1530151373 | Python | Python3 | py | Runtime Error | 0 | 0 | 421 | N,S = map(int, input().split())
As = list(map(int, input().split()))
i = 0
j = 0
sum = 0
m_l = float('inf')
"""
while True:
while j < N and sum < S:
sum += As[j]
j += 1
if sum < S:
break
m_l = min(j-i, m_l)
sum -= As[i]
i += 1
"""
while j < N:
sum += As[j]
j += 1
if sum < s:
continue
while i <= j a... | Traceback (most recent call last):
File "/tmp/tmpmhzutsaf/tmpe4u99mld.py", line 1, in <module>
N,S = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s071502308 | p02356 | u136916346 | 1532062729 | Python | Python3 | py | Runtime Error | 0 | 0 | 372 | N,Q=map(int,input().split())
A=map(int,input().split())
X=map(int,input().split())
for x in X:
r=0
s=0
cnt=0
for l in range(N):
while r<N and s<=x:
s+=A[r]
r+=1
if s>x:
cnt+=r-1-l
else:
cnt+=r-l
if r==l:
r+=1
... | Traceback (most recent call last):
File "/tmp/tmp_eupoj0h/tmp_plz4r8h.py", line 1, in <module>
N,Q=map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s929880285 | p02356 | u938878704 | 1530599399 | Python | Python3 | py | Runtime Error | 0 | 0 | 335 | for plc in x:
cursum = 0
cnt = 0
right = 0
left = 0
for left in range(N) :
while right < N and cursum + a[right] <= plc :
cursum += a[right]
right += 1
cnt += right - left
cursum -= a[left]
# print("DBG : ", left, right)
... | Traceback (most recent call last):
File "/tmp/tmpyc3zil7a/tmp2ps_6ity.py", line 1, in <module>
for plc in x:
^
NameError: name 'x' is not defined
| |
s184353939 | p02357 | u890713354 | 1559551884 | Python | Python3 | py | Runtime Error | 0 | 0 | 903 | answer=[]
element=[]
D=[]
def initRMQ(nn):
global n
n = 1
while n < nn:
n*=2
for i in range(2*n-1):
D.append(2147483647)
def update(k,a):
k += n-1
D[k] = a
while k>0:
k = (k-1)//2
D[k] = min(D[k*2+1] , D[k*2+2])
def findMin(a,b):
return query(a,b... | Traceback (most recent call last):
File "/tmp/tmp0s4pajhi/tmpglq4zghy.py", line 33, in <module>
N,L = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s959875369 | p02357 | u279605379 | 1504601331 | Python | Python3 | py | Runtime Error | 0 | 0 | 861 | def binaryinsertion(A,x):
left=0;right=len(A)-1;centre = len(A)//2
while(True):
if(left == right):
if(x[0]<A[left][0]):
A.insert(left,x)
break
else :
A.insert(left+1,x)
break
else:
if(x[0] < A[cen... | Traceback (most recent call last):
File "/tmp/tmpxn8ux0aj/tmp1oix4bet.py", line 21, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s510416904 | p02357 | u279605379 | 1504601354 | Python | Python3 | py | Runtime Error | 0 | 0 | 859 | def binaryinsertion(A,x):
left=0;right=len(A)-1;centre = len(A)//2
while(True):
if(left == right):
if(x[0]<A[left][0]):
A.insert(left,x)
break
else :
A.insert(left+1,x)
break
else:
if(x[0] < A[cen... | Traceback (most recent call last):
File "/tmp/tmp6ct6f80y/tmp1sre24w9.py", line 21, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s266446889 | p02357 | u279605379 | 1504601545 | Python | Python3 | py | Runtime Error | 0 | 0 | 993 | def binaryinsertion(A,x):
left=0;right=len(A)-1;centre = len(A)//2
while(True):
if(right - left < 2):
if(x[0]<A[left][0]):
A.insert(left,x)
break
else :
A.insert(left+1,x)
break
else:
if(x[0] < A[... | Traceback (most recent call last):
File "/tmp/tmpv6bfj5sl/tmp0jiw377m.py", line 21, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s505780071 | p02357 | u279605379 | 1504601720 | Python | Python3 | py | Runtime Error | 0 | 0 | 878 | def binaryinsertion(A,x):
left=0;right=len(A)-1;centre = len(A)//2
while(True):
if(right - left < 2):
if(x[0]<A[left][0]):A.insert(left,x)
else :
if(x[0]<A[right[0]]):A.insert(right,x)
else:A.insert(right+1,x)
break
else:
... | Traceback (most recent call last):
File "/tmp/tmpvoread5b/tmp0cdzc9l4.py", line 20, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s076310433 | p02357 | u279605379 | 1504601754 | Python | Python3 | py | Runtime Error | 20 | 7760 | 878 | def binaryinsertion(A,x):
left=0;right=len(A)-1;centre = len(A)//2
while(True):
if(right - left < 2):
if(x[0]<A[left][0]):A.insert(left,x)
else :
if(x[0]<A[right][0]):A.insert(right,x)
else:A.insert(right+1,x)
break
else:
... | Traceback (most recent call last):
File "/tmp/tmp80hnoe3e/tmp8divanrv.py", line 20, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s162011426 | p02357 | u279605379 | 1504659989 | Python | Python3 | py | Runtime Error | 0 | 0 | 1756 | def binaryinsertion(A,x):
left=0;right=len(A)-1;centre = len(A)//2
while(True):
if(right - left < 2):
if(x[0]<A[left][0]):A.insert(left,x)
else :
if(x[0]<A[right][0]):A.insert(right,x)
else:A.insert(right+1,x)
break
else:
... | File "/tmp/tmpe830ck5f/tmpxkifq3ml.py", line 29
print(" ".join(ans))def binaryinsertion(A,x):
^^^
SyntaxError: invalid syntax
| |
s145102057 | p02357 | u279605379 | 1504660010 | Python | Python3 | py | Runtime Error | 0 | 0 | 1758 | def binaryinsertion(A,x):
left=0;right=len(A)-1;centre = len(A)//2
while(True):
if(right - left < 2):
if(x[0]<A[left][0]):A.insert(left,x)
else :
if(x[0]<A[right][0]):A.insert(right,x)
else:A.insert(right+1,x)
break
else:
... | File "/tmp/tmpy6zugaw9/tmpthlsc7wm.py", line 29
print(" ".join(ans))def binaryinsertion(A,x):
^^^
SyntaxError: invalid syntax
| |
s692797241 | p02357 | u279605379 | 1504660027 | Python | Python3 | py | Runtime Error | 30 | 7852 | 878 | def binaryinsertion(A,x):
left=0;right=len(A)-1;centre = len(A)//2
while(True):
if(right - left < 2):
if(x[0]<A[left][0]):A.insert(left,x)
else :
if(x[0]<A[right][0]):A.insert(right,x)
else:A.insert(right+1,x)
break
else:
... | Traceback (most recent call last):
File "/tmp/tmpg8px8ssx/tmpcbm9il4n.py", line 20, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s850609153 | p02357 | u279605379 | 1504660200 | Python | Python3 | py | Runtime Error | 20 | 7852 | 882 | def binaryinsertion(A,x):
left=0;right=len(A)-1;centre = 1 + len(A)//2
while(True):
if(right - left < 2):
if(x[0]<A[left][0]):A.insert(left,x)
else :
if(x[0]<A[right][0]):A.insert(right,x)
else:A.insert(right+1,x)
break
else:
... | Traceback (most recent call last):
File "/tmp/tmp5y7lbeyp/tmpo7fr5s7v.py", line 20, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s700796866 | p02357 | u279605379 | 1504660389 | Python | Python3 | py | Runtime Error | 30 | 7768 | 886 | def binaryinsertion(A,x):
left=0;right=len(A)-1;centre = 1 + len(A)//2
while(True):
if(right - left < 2):
if(x[0]<A[left][0]):A.insert(left,x)
else :
if(x[0]<A[right][0]):A.insert(right,x)
else:A.insert(right+1,x)
break
else:
... | Traceback (most recent call last):
File "/tmp/tmpjmat814b/tmphse1twu3.py", line 20, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s039162423 | p02357 | u279605379 | 1504660400 | Python | Python3 | py | Runtime Error | 20 | 7832 | 886 | def binaryinsertion(A,x):
left=0;right=len(A)-1;centre = 1 + len(A)//2
while(True):
if(right - left < 2):
if(x[0]<A[left][0]):A.insert(left,x)
else :
if(x[0]<A[right][0]):A.insert(right,x)
else:A.insert(right+1,x)
break
else:
... | Traceback (most recent call last):
File "/tmp/tmp53va6kn_/tmp4cd_b98b.py", line 20, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s663803669 | p02357 | u279605379 | 1504660658 | Python | Python3 | py | Runtime Error | 60 | 7764 | 880 | def binaryinsertion(A,x):
left=0;right=len(A)-1;centre = len(A)//2
while(True):
if(right - left < 2):
if(x[0]<A[left][0]):A.insert(left,x)
else :
if(x[0]<A[right][0]):A.insert(right,x)
else:A.insert(right+1,x)
break
else:
... | Traceback (most recent call last):
File "/tmp/tmpoij9ouul/tmp4v2_mth4.py", line 20, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s036547518 | p02357 | u279605379 | 1504660832 | Python | Python3 | py | Runtime Error | 50 | 7836 | 872 | def binaryinsertion(A,x):
left=0;right=len(A)-1;centre = len(A)//2
while(True):
if(right - left < 2):
if(x[0]<A[left][0]):A.insert(left,x)
else :
if(x[0]<A[right][0]):A.insert(right,x)
else:A.insert(right+1,x)
break
else:
... | Traceback (most recent call last):
File "/tmp/tmpv59lu679/tmpc867vzid.py", line 20, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s382653998 | p02357 | u279605379 | 1504662017 | Python | Python3 | py | Runtime Error | 0 | 0 | 842 | def binaryinsertion(A,x):
left=0;right=len(A)-1
while(True):
center = math.floor((low + high) / 2)
if(right == left):
if(x[0]<A[left][0]):
A.insert(left,x)
break
else :
A.insert(left + 1,x)
break
else... | Traceback (most recent call last):
File "/tmp/tmpqdd2kv5j/tmpg9mx6xh2.py", line 21, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s007611275 | p02357 | u279605379 | 1504662037 | Python | Python3 | py | Runtime Error | 0 | 0 | 855 | import math
def binaryinsertion(A,x):
left=0;right=len(A)-1
while(True):
center = math.floor((low + high) / 2)
if(right == left):
if(x[0]<A[left][0]):
A.insert(left,x)
break
else :
A.insert(left + 1,x)
break... | Traceback (most recent call last):
File "/tmp/tmpt18ouh7l/tmpa2imt1s9.py", line 23, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s646405522 | p02357 | u279605379 | 1504662077 | Python | Python3 | py | Runtime Error | 0 | 0 | 857 | import math
def binaryinsertion(A,x):
left=0;right=len(A)-1
while(True):
center = math.floor((left + right) / 2)
if(right == left):
if(x[0]<A[left][0]):
A.insert(left,x)
break
else :
A.insert(left + 1,x)
bre... | Traceback (most recent call last):
File "/tmp/tmpintc5wwt/tmpd4lovmi6.py", line 23, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s546679635 | p02357 | u279605379 | 1504662292 | Python | Python3 | py | Runtime Error | 30 | 7752 | 886 | def binaryinsertion(A,x):
left=0;right=len(A)-1;centre = 1 + len(A)//2
while(True):
if(right - left < 2):
if(x[0]<A[left][0]):A.insert(left,x)
else :
if(x[0]<A[right][0]):A.insert(right,x)
else:A.insert(right+1,x)
break
else:
... | Traceback (most recent call last):
File "/tmp/tmprpus2be0/tmpchr8l8y5.py", line 20, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s273802423 | p02357 | u279605379 | 1504662301 | Python | Python3 | py | Runtime Error | 30 | 7708 | 890 | def binaryinsertion(A,x):
left=0;right=len(A)-1;centre = 1 + len(A)//2
while(True):
if(right - left < 2):
if(x[0]<A[left][0]):A.insert(left,x)
else :
if(x[0]<A[right][0]):A.insert(right,x)
else:A.insert(right+1,x)
break
else:
... | Traceback (most recent call last):
File "/tmp/tmpxz9_4pgs/tmp0g77orde.py", line 20, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s529702238 | p02357 | u279605379 | 1504662317 | Python | Python3 | py | Runtime Error | 20 | 7832 | 886 | def binaryinsertion(A,x):
left=0;right=len(A)-1;centre = len(A)//2
while(True):
if(right - left < 2):
if(x[0]<A[left][0]):A.insert(left,x)
else :
if(x[0]<A[right][0]):A.insert(right,x)
else:A.insert(right+1,x)
break
else:
... | Traceback (most recent call last):
File "/tmp/tmpb274kk49/tmpiai59l4o.py", line 20, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s980761244 | p02357 | u279605379 | 1504662328 | Python | Python3 | py | Runtime Error | 50 | 7768 | 882 | def binaryinsertion(A,x):
left=0;right=len(A)-1;centre = len(A)//2
while(True):
if(right - left < 2):
if(x[0]<A[left][0]):A.insert(left,x)
else :
if(x[0]<A[right][0]):A.insert(right,x)
else:A.insert(right+1,x)
break
else:
... | Traceback (most recent call last):
File "/tmp/tmpxnlw5ypa/tmpp3lzzj68.py", line 20, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s531543662 | p02357 | u279605379 | 1504662424 | Python | Python3 | py | Runtime Error | 20 | 7832 | 855 | def binaryinsertion(A,x):
left=0;right=len(A)-1
while(True):
centre = left + (right-left)//2
if(right - left < 2):
if(x[0]<A[left][0]):A.insert(left,x)
else :
if(x[0]<A[right][0]):A.insert(right,x)
else:A.insert(right+1,x)
break... | Traceback (most recent call last):
File "/tmp/tmp2humqlqh/tmp7xby3log.py", line 20, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s173136135 | p02357 | u279605379 | 1504662511 | Python | Python3 | py | Runtime Error | 20 | 7764 | 859 | def binaryinsertion(A,x):
left=0;right=len(A)-1
while(True):
centre = left + (right-left)//2 - 1
if(right - left < 2):
if(x[0]<A[left][0]):A.insert(left,x)
else :
if(x[0]<A[right][0]):A.insert(right,x)
else:A.insert(right+1,x)
b... | Traceback (most recent call last):
File "/tmp/tmpdu0a_fdm/tmp51xgirmh.py", line 20, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s837250445 | p02357 | u279605379 | 1504662517 | Python | Python3 | py | Runtime Error | 30 | 7792 | 859 | def binaryinsertion(A,x):
left=0;right=len(A)-1
while(True):
centre = left + (right-left)//2 + 1
if(right - left < 2):
if(x[0]<A[left][0]):A.insert(left,x)
else :
if(x[0]<A[right][0]):A.insert(right,x)
else:A.insert(right+1,x)
b... | Traceback (most recent call last):
File "/tmp/tmpalyrkzk9/tmpon9fo4vg.py", line 20, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s330529757 | p02357 | u279605379 | 1504684057 | Python | Python3 | py | Runtime Error | 0 | 0 | 6902 | class Node:
def __init__(self, x):
self.data = x
self.left = None
self.right = None
self.balance = 0 # ?????????
# ????????¢
def rotate_right(node):
lnode = node.left
node.left = lnode.right
lnode.right = node
return lnode
# ????????¢
def rotate_left(node):
r... | Traceback (most recent call last):
File "/tmp/tmpbfk1rw36/tmp1j8fvcn0.py", line 232, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s268357681 | p02357 | u279605379 | 1504684172 | Python | Python3 | py | Runtime Error | 0 | 0 | 5677 | class Node:
def __init__(self, x):
self.data = x
self.left = None
self.right = None
self.balance = 0
def rotate_right(node):
lnode = node.left
node.left = lnode.right
lnode.right = node
return lnode
def rotate_left(node):
rnode = node.right
node.right = rnod... | Traceback (most recent call last):
File "/tmp/tmp2tcx2588/tmpg3rogzi4.py", line 208, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.