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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s822774265 | p01554 | u922450532 | 1529210998 | Python | Python3 | py | Runtime Error | 0 | 0 | 627 | while True:
a = input()
# if a == "0 0 0 0 0":
# break
a = a.split(" ")
b = []
sum = 0
for i in a:
b.append(int(i))
sum += int(i)
if sum == 0:
break
c = input()
c = c.split(" ")
d = []
for i in c:
d.append(int(i))
if b[4] == d[0]:
... | Traceback (most recent call last):
File "/tmp/tmp9fe2b0v4/tmpt6yz2dgn.py", line 3, in <module>
a = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s525095709 | p01558 | u352394527 | 1546325674 | Python | Python3 | py | Runtime Error | 1940 | 404800 | 346 | def main():
n, m = map(int, input().split())
s = input()
left = right = 0
mem = set()
for _ in range(m):
com = input()
if com == "L++":
left += 1
elif com == "L--":
left -= 1
elif com == "R++":
right += 1
elif com == "R--":
right -= 1
mem.add(s[left:right + 1])
... | Traceback (most recent call last):
File "/tmp/tmpstojmntq/tmphmi_9c09.py", line 19, in <module>
main()
File "/tmp/tmpstojmntq/tmphmi_9c09.py", line 2, in main
n, m = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s251949316 | p01564 | u116766943 | 1422522709 | Python | Python3 | py | Runtime Error | 0 | 0 | 13788 | /*
まだ途中セーヴ
ci is ignored for output queries.
このインプットは無視しろってこと?kamo
*/
#include<bits/stdc++.h>
#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
using namespace std;
typedef long long ll;
// -- segment tree with lazy propagation ---
const int IINF = INT_MAX;
const char EMPTY = 'X';
st... | File "/tmp/tmpch0a81de/tmpy4i_x5ef.py", line 6
このインプットは無視しろってこと?kamo
^
SyntaxError: invalid character '?' (U+FF1F)
| |
s721728822 | p01581 | u104911888 | 1375191200 | Python | Python | py | Runtime Error | 20 | 4204 | 100 | N,M=map(int,raw_input().split())
L=[input() for i in range(N)]
for i in range(M):
print L[N-i-1] | File "/tmp/tmpc52w0rbv/tmpxouh9o9u.py", line 4
print L[N-i-1]
^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s456169827 | p01581 | u834962510 | 1378950558 | Python | Python | py | Runtime Error | 0 | 0 | 199 | from collections import deque
N, M = map(int, input().split(' '))
q = deque()
for _ in range(N):
c = int(input())
if len(q) == M:
q.popleft()
q.append(c)
for _ in reversed(q):
print(_) | Traceback (most recent call last):
File "/tmp/tmpjtiwsmio/tmps9s6utua.py", line 3, in <module>
N, M = map(int, input().split(' '))
^^^^^^^
EOFError: EOF when reading a line
| |
s531081024 | p01581 | u834962510 | 1378951460 | Python | Python | py | Runtime Error | 0 | 0 | 212 | N, M = map(int, input().split(' '))
q = []
for _ in range(N):
c = int(input())
if c in q:
q.remove(c)
q.append(c)
else:
if len(q) == M:
q.pop(0)
q.append(c)
for _ in reversed(q):
print(_) | Traceback (most recent call last):
File "/tmp/tmp6ky75eoo/tmpjug4yj6h.py", line 1, in <module>
N, M = map(int, input().split(' '))
^^^^^^^
EOFError: EOF when reading a line
| |
s636999308 | p01581 | u834962510 | 1378951474 | Python | Python | py | Runtime Error | 20000 | 7556 | 216 | N, M = map(int, raw_input().split(' '))
q = []
for _ in range(N):
c = int(input())
if c in q:
q.remove(c)
q.append(c)
else:
if len(q) == M:
q.pop(0)
q.append(c)
for _ in reversed(q):
print(_) | Traceback (most recent call last):
File "/tmp/tmpqruxhm_5/tmpxu_5psj_.py", line 1, in <module>
N, M = map(int, raw_input().split(' '))
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s454729609 | p01581 | u834962510 | 1378952145 | Python | Python | py | Runtime Error | 0 | 0 | 217 | N, M = map(int, input().split(' '))
q = [ int(input()) for _ in range(N) ]
poll = []
cnt = 0
for _ in reversed(q):
if not _ in poll:
print(_)
cnt = cnt + 1
if cnt == M:
break
poll.append(_)
| Traceback (most recent call last):
File "/tmp/tmpc6be1a_6/tmp30hkl9w7.py", line 1, in <module>
N, M = map(int, input().split(' '))
^^^^^^^
EOFError: EOF when reading a line
| |
s092562864 | p01581 | u834962510 | 1378952163 | Python | Python | py | Runtime Error | 20000 | 9340 | 221 | N, M = map(int, raw_input().split(' '))
q = [ int(input()) for _ in range(N) ]
poll = []
cnt = 0
for _ in reversed(q):
if not _ in poll:
print(_)
cnt = cnt + 1
if cnt == M:
break
poll.append(_)
| Traceback (most recent call last):
File "/tmp/tmpw420yqht/tmp8smnm5ew.py", line 1, in <module>
N, M = map(int, raw_input().split(' '))
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s353151467 | p01581 | u834962510 | 1378952322 | Python | Python | py | Runtime Error | 0 | 0 | 224 | N, M = map(int, raw_input().split(' '))
q = [ int(input()) for _ in range(N) ]
poll = set()
cnt = 0
for _ in reversed(q):
if not _ in poll:
print(_)
cnt = cnt + 1
if cnt == M:
break
poll.append(_)
| Traceback (most recent call last):
File "/tmp/tmpy0i7qvq0/tmpt_ifu2th.py", line 1, in <module>
N, M = map(int, raw_input().split(' '))
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s406350447 | p01601 | u633068244 | 1398502860 | Python | Python | py | Runtime Error | 20 | 4204 | 155 | n = input()
mind = n
for i in range(max(0,n-20),min(10001,n+20)):
if i == int(str(i)[::-1]) and abs(n - i) < mind:
mind = abs(n - i)
ans = i
print ans | File "/tmp/tmp8ywqyrhs/tmpo4to75jh.py", line 7
print ans
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s595540550 | p01602 | u104911888 | 1373197872 | Python | Python | py | Runtime Error | 0 | 0 | 317 | s=""
for i in range(input()):
p,x=raw_input().split()
s+=p*int(x)
st=[]
for i in range(len(s)):
if s[i]=="(":
st.append(s[i])
else:
if st==[] or st[-1]!="(":
print "NO"
break
st.pop()
else:
if st==[]:
print "YES"
else:
print "NO" | File "/tmp/tmp4_m0xplu/tmp5ndxtd_u.py", line 11
print "NO"
^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s396501438 | p01605 | u104911888 | 1367457068 | Python | Python | py | Runtime Error | 0 | 0 | 178 | S=raw_input()
Q,A,B=map(int,raw_input().split())
for i in range(Q):
c,p=raw_input().split()
p="" if p=="." else p
S=S.replace(c,p)
print S[A-1:B] if len(S)<B else "." | File "/tmp/tmp1hoas1gg/tmp0g3ejw0k.py", line 7
print S[A-1:B] if len(S)<B else "."
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s212982905 | p01605 | u104911888 | 1367457542 | Python | Python | py | Runtime Error | 0 | 0 | 181 | S=raw_input()
Q,A,B=map(int,raw_input().split())
for i in range(Q):
c,p=raw_input().split()
p="" if p=="." else p
S=S.replace(c,p)
print "." if len(S)<=B-A else S[A-1:B] | File "/tmp/tmpjeijkex6/tmps84laypy.py", line 7
print "." if len(S)<=B-A else S[A-1:B]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s357949757 | p01605 | u104911888 | 1367458782 | Python | Python | py | Runtime Error | 0 | 0 | 155 | S=raw_input()
Q,A,B=map(int,raw_input().split())
for i in range(Q):
c,p=raw_input().split()
p="" if p=="." else p
S=S.replace(c,p)
print S[A:B] | File "/tmp/tmpvmi0glpk/tmp62662qaf.py", line 7
print S[A:B]
^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s846855087 | p01605 | u104911888 | 1367459109 | Python | Python | py | Runtime Error | 0 | 0 | 182 | S=raw_input()
Q,A,B=map(int,raw_input().split())
for i in range(Q):
c,p=raw_input().split()
# p="" if p=="." else p
S=S.replace(c,p)
print "." if len(S)<=B-A else S[A-1:B] | File "/tmp/tmpd7aavovh/tmp82rpwvnj.py", line 7
print "." if len(S)<=B-A else S[A-1:B]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s621042363 | p01609 | u506537276 | 1558936129 | Python | Python | py | Runtime Error | 0 | 0 | 483 | import math
deltax = 0.0000001
w, h, n = map(int, input().split())
high = [0 for i in range(int(w / deltax))]
for i in range(n):
a, p, q = map(int, input().split())
for i in range(int(w / deltax)):
j = i * deltax
f = a * (j - p)**2 + q
if(f <= h):
high[i] = max(high[i], f)
# print(*high) ... | Traceback (most recent call last):
File "/tmp/tmp18dp8op1/tmpghnyv9wk.py", line 4, in <module>
w, h, n = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s107249603 | p01612 | u797673668 | 1470116469 | Python | Python3 | py | Runtime Error | 700 | 40216 | 1120 | def memoize(f):
cache = {}
def helper(arg):
if arg not in cache:
cache[arg] = f(arg)
return cache[arg]
return helper
def solve(edges):
@memoize
def tree_height(node):
en = edges[node]
if not en:
return 0, set()
max_depth = -1
... | Traceback (most recent call last):
File "/tmp/tmppab3x1ef/tmpsut84r9c.py", line 34, in <module>
n, m = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s849862987 | p01614 | u134812425 | 1541126661 | Python | Python3 | py | Runtime Error | 0 | 0 | 1276 | import bisect
import collections
import heapq
import itertools
import math
import string
import sys
from itertools import chain, takewhile
def read(
f, *shape, it=chain.from_iterable(sys.stdin), whitespaces=set(string.whitespace)
):
def read_word():
return f("".join(takewhile(lambda c: c not in whites... | Traceback (most recent call last):
File "/tmp/tmpive_a34d/tmpwxchrqen.py", line 51, in <module>
main()
File "/tmp/tmpive_a34d/tmpwxchrqen.py", line 32, in main
n = read(int)
^^^^^^^^^
File "/tmp/tmpive_a34d/tmpwxchrqen.py", line 18, in read
return read_word()
^^^^^^^^^^^
File "/tm... | |
s489163022 | p01615 | u633068244 | 1399654398 | Python | Python | py | Runtime Error | 10 | 4252 | 322 | inf = 1e10
n,m = map(int,raw_input().split())
edge = [map(int,raw_input().split()) for i in range(m)]
d = [[inf]*n for i in range(n)]
for i in range(m):
d[0] = 0
while 1:
update = False
a,b,c = edge[i]
if d[a] != inf and d[b] > d[a] - c:
d[b] = d[a] - c
update = True
if not update: break
print abs(d[n-1... | File "/tmp/tmp00p2htbs/tmp_oil02q7.py", line 14
print abs(d[n-1])
^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s677055051 | p01620 | u617183767 | 1421566643 | Python | Python | py | Runtime Error | 0 | 0 | 923 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import itertools
import math
from collections import Counter, defaultdict
class Main(object):
def __init__(self):
self.chars = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', ... | File "/tmp/tmp__7pdi5i/tmp0ks62c0d.py", line 28
print ans
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s412340822 | p01620 | u233891002 | 1430541254 | Python | Python | py | Runtime Error | 0 | 0 | 803 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
station = ""... | File "/tmp/tmp1f37lg9o/tmpgdob32ma.py", line 26
print res
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s875213413 | p01620 | u233891002 | 1430541473 | Python | Python | py | Runtime Error | 0 | 0 | 922 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
def main():
... | File "/tmp/tmp6dypm2lu/tmpi9nutdif.py", line 27
print res
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s488141573 | p01620 | u233891002 | 1430541569 | Python | Python | py | Runtime Error | 0 | 0 | 923 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
def main():
... | File "/tmp/tmpfmfys2z_/tmpq16j2y7g.py", line 27
print res
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s824926121 | p01620 | u233891002 | 1430548737 | Python | Python | py | Runtime Error | 0 | 0 | 925 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
def main():
... | File "/tmp/tmp92grn32x/tmpfza9zhzw.py", line 27
print res
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s643491132 | p01620 | u766926358 | 1526633367 | Python | Python3 | py | Runtime Error | 0 | 0 | 316 | while 1:
n = int(input())
k_line = list(map(int, input().split()))
s = input()
if (n == 0):
break;
alpha = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
k_line *= (-(-len(s)//len(k_line)))
for num, c in enumerate(s):
index = alpha.index(c) - k_line[num]
print(alpha[index], end='')
print('')
| File "/tmp/tmp4y2msxp0/tmprmfqhpqa.py", line 1
while 1:
IndentationError: unexpected indent
| |
s593132280 | p01620 | u929568713 | 1526642837 | Python | Python3 | py | Runtime Error | 0 | 0 | 342 | while 1:
n = int(input())
k_line = list(map(int, input().split()))
s = input()
if (n == 0):
break;
alpha = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
k_line *= (-(-len(s) // len(k_line)))
s = [alpha[(alpha.index(c) + 52*10 - k_line[num])%52] for num, c in enumerate(s)]
... | Traceback (most recent call last):
File "/tmp/tmpbuc23pz9/tmpe84ewnx3.py", line 2, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s599505675 | p01620 | u260980560 | 1403673746 | Python | Python | py | Runtime Error | 0 | 0 | 580 | ef suber(c, k):
if ord('a')<=ord(c):
w = ord(c) - ord('a')
if w < k:
return chr(ord('Z') - (k - w - 1)) if k<=26 else chr(ord('z') - (k - w - 27))
return chr(ord('a') + (w - k))
else:
w = ord(c) - ord('A')
if w < k:
return chr(ord('z') - (k - w - 1... | File "/tmp/tmpvif1n7sz/tmpt1ok5nx7.py", line 1
ef suber(c, k):
^^^^^
SyntaxError: invalid syntax
| |
s841971067 | p01620 | u260980560 | 1403674150 | Python | Python | py | Runtime Error | 0 | 0 | 255 | station = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQESTUVWXYZ"
while True:
n = input()
if n==0:
break
k = map(int, raw_input().split())
s = raw_input()
print "".join(station[station.find(s[i])-k[i%n]] for i in xrange(len(s))) | File "/tmp/tmp0p2vj586/tmpkljwktx1.py", line 8
print "".join(station[station.find(s[i])-k[i%n]] for i in xrange(len(s)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s707458074 | p01623 | u072053884 | 1523123672 | Python | Python3 | py | Runtime Error | 0 | 0 | 1934 | class UnionFind:
def __init__(self, size):
self.table = [-1] * size
def find(self, x):
while self.table[x] >= 0:
x = self.table[x]
return x
def union(self, x, y):
x_root = self.find(x)
y_root = self.find(y)
if x_root != y_root:
... | Traceback (most recent call last):
File "/tmp/tmpyw4owjur/tmpqee72cgq.py", line 70, in <module>
solve()
File "/tmp/tmpyw4owjur/tmpqee72cgq.py", line 30, in solve
N, M = map(int, input_lines[0].split())
~~~~~~~~~~~^^^
IndexError: list index out of range
| |
s229685119 | p01623 | u072053884 | 1523154932 | Python | Python3 | py | Runtime Error | 0 | 0 | 1934 | class UnionFind:
def __init__(self, size):
self.table = [-1] * size
def find(self, x):
while self.table[x] >= 0:
x = self.table[x]
return x
def union(self, x, y):
x_root = self.find(x)
y_root = self.find(y)
if x_root != y_root:
... | Traceback (most recent call last):
File "/tmp/tmp7m4rionn/tmpsiv6tfzy.py", line 70, in <module>
solve()
File "/tmp/tmp7m4rionn/tmpsiv6tfzy.py", line 30, in solve
N, M = map(int, input_lines[0].split())
~~~~~~~~~~~^^^
IndexError: list index out of range
| |
s663262004 | p01623 | u072053884 | 1523155968 | Python | Python3 | py | Runtime Error | 0 | 0 | 1930 | class UnionFind:
def __init__(self, size):
self.table = [-1] * size
def find(self, x):
while self.table[x] >= 0:
x = self.table[x]
return x
def union(self, x, y):
x_root = self.find(x)
y_root = self.find(y)
if x_root != y_root:
... | Traceback (most recent call last):
File "/tmp/tmpswgr0_2y/tmpi0k2utnv.py", line 70, in <module>
solve()
File "/tmp/tmpswgr0_2y/tmpi0k2utnv.py", line 31, in solve
N, M = map(int, input_lines[0].split())
~~~~~~~~~~~^^^
IndexError: list index out of range
| |
s398468464 | p01624 | u118766929 | 1530824127 | Python | Python3 | py | Runtime Error | 0 | 0 | 1969 | # undo が出来るゲームは全て2手だけ見ればよい
ops = ["+", "*", "-", "&", "^", "|"]
numbers = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"]
def check(x):
# +*
op = 0
for c in x:
if c in ops:
op += 1
if op >= 2:
return False
else:
op = 0
# +...
f... | Traceback (most recent call last):
File "/tmp/tmpk7xw8kvw/tmp1di710uj.py", line 60, in <module>
n, x = input().split(" ")
^^^^^^^
EOFError: EOF when reading a line
| |
s647909936 | p01634 | u633068244 | 1396608486 | Python | Python | py | Runtime Error | 0 | 0 | 106 | p=raw_input()
if len(p)<6 or islower(p) or isupper(p) or isdigit(p):
print "INVARID"
else:
print "VARID" | File "/tmp/tmpry0238nh/tmpcfmisngw.py", line 3
print "INVARID"
^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s085781689 | p01646 | u352394527 | 1529469105 | Python | Python3 | py | Runtime Error | 0 | 0 | 1233 | def add_edge(node, adj_lst, adj_rev, s1, s2):
ind = 0
max_len = min(len(s1), len(s2))
while ind < max_len and s1[ind] == s2[ind]:
ind += 1
if ind == max_len:
if max_len < len(s1):
return True
return False
c1 = ord(s1[ind]) - ord("a")
c2 = ord(s2[ind]) - ord("a")
adj_lst[c1].add(c2)
adj... | Traceback (most recent call last):
File "/tmp/tmpnmcvjvv0/tmpgtnbd9wk.py", line 56, in <module>
main()
File "/tmp/tmpnmcvjvv0/tmpgtnbd9wk.py", line 19, in main
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s369005925 | p01646 | u647766105 | 1392007367 | Python | Python | py | Runtime Error | 39860 | 88204 | 1229 | graph = []
def init():
global graph
graph = [[False] * 26 + [True] for _ in xrange(27)]
graph[26][26] = False
def atoi(c):#index
if c == "#":
return 26
return ord(c) - ord("a")
def make_graph(L):
global graph
tmp = []
while "" in L:
L.remove("")
for s1, s2 in zip(L... | File "/tmp/tmp1v3rggf3/tmpunofss8z.py", line 52
print "no"
^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s439086253 | p01646 | u647766105 | 1392008164 | Python | Python | py | Runtime Error | 39870 | 88192 | 1171 | graph = []
def init():
global graph
graph = [[False] * 26 + [True] for _ in xrange(27)]
graph[26][26] = False
def atoi(c):#index
if c == "#":
return 26
return ord(c) - ord("a")
def make_graph(L):
global graph
tmp = []
while "" in L:
L.remove("")
for s1, s2 in zip(L... | File "/tmp/tmp5un4353l/tmpu0rg4tgm.py", line 51
print "no"
^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s284283068 | p01656 | u633068244 | 1393702019 | Python | Python | py | Runtime Error | 0 | 0 | 201 | data = [[1, "kogaku10gokan"]
n, q = map(int, raw_input().split())
for i in range(n):
a, b = map(int, raw_input().split())
data.append([a,b])
for i in data:
if i[0] > q:
print i[1] | File "/tmp/tmpi0xd1yao/tmp9wyxy3pw.py", line 1
data = [[1, "kogaku10gokan"]
^
SyntaxError: '[' was never closed
| |
s379166016 | p01656 | u772196646 | 1400302739 | Python | Python | py | Runtime Error | 10 | 4212 | 218 | nq = map(int, raw_input().split())
n = nq[0]
q = nq[1]
yn = [[1, 'kogakubu10gokan']]
for i in range(n):
yn.append(raw_input().split())
y = 1
k = 0
while y <= q:
k += 1
y = int(yn[k][0])
print yn[k-1][1] | File "/tmp/tmpqbyszx7p/tmp0mglz351.py", line 16
print yn[k-1][1]
^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s670346902 | p01672 | u248404432 | 1520404865 | Python | Python3 | py | Runtime Error | 0 | 0 | 860 | import numpy as np
from scipy.signal import correlate
n = int( input() ) # Get grid width
c = []
for i in range(n):
c.append( input().split() ) # Get line info
c = np.array(c, dtype=np.double)
R = np.int32(np.round(correlate(c,c, method='fft'))) # Autocorrelation w/ FFT
center = np.array([1, 1]) * (n-1)
histogram =... | Traceback (most recent call last):
File "/tmp/tmpl1rro8ef/tmpjsk8m4_d.py", line 4, in <module>
n = int( input() ) # Get grid width
^^^^^^^
EOFError: EOF when reading a line
| |
s281879693 | p01682 | u144532944 | 1530522437 | Python | Python3 | py | Runtime Error | 0 | 0 | 217 | import re
S = lambda x: x*x%int(1e9+7)
s = input()
while s != '#':
s = s.replace(' ', '')
s = re.sub(r'>>(\d+)', r'XX\1', s)
s = s.translate(str.maketrans('<>X', '()>'))
print(eval(s))
s = input()
| Traceback (most recent call last):
File "/tmp/tmpp0uwv2g6/tmpxl_s__xh.py", line 3, in <module>
s = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s626415562 | p01682 | u260980560 | 1400182196 | Python | Python | py | Runtime Error | 0 | 0 | 994 | MOD = 10**9 + 7
s = ""; l = 0; pos = 0;
def number():
global pos
x = pos
while pos<l and s[pos].isdigit():
pos += 1
return int(s[x:pos]) if x!=pos else -1
def sp():
global pos
while pos<l and s[pos]==' ':
pos += 1
return 0
def term():
global pos
if pos>=l:
... | File "/tmp/tmp5jd8y5mm/tmp309s5a43.py", line 57
print expr()
^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s702370876 | p01682 | u260980560 | 1400182421 | Python | Python | py | Runtime Error | 0 | 0 | 1026 | MOD = 10**9 + 7
s = ""; l = 0; pos = 0;
def number():
global pos
x = pos
while pos<l and s[pos].isdigit():
pos += 1
return int(s[x:pos]) if x!=pos else -1
def sp():
global pos
while pos<l and s[pos]==' ':
pos += 1
return 0
def term():
global pos
if pos>=l:
... | File "/tmp/tmpvohzw6se/tmpnilpfcrs.py", line 58
print expr()
^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s076011468 | p01682 | u260980560 | 1400182897 | Python | Python | py | Runtime Error | 0 | 0 | 1063 | MOD = 10**9 + 7
s = ""; l = 0; pos = 0;
def number():
global pos
ret = 0
x = pos
while pos<l and s[pos].isdigit():
ret = 10*ret + int(s[pos])
pos += 1
return ret if x!=pos else -1
def sp():
global pos
while pos<l and s[pos]==' ':
pos += 1
return 0
def term():
... | File "/tmp/tmp2_smyq0_/tmpgfhrgwi3.py", line 60
print expr()
^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s813566108 | p01694 | u609255173 | 1416727659 | Python | Python | py | Runtime Error | 0 | 0 | 575 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
def main():
while True:
n = input()
if not n: break
w = 0
a = [0, 0]
ans = 0
for s in raw_input().split():
f = 0 if s[0] == "l" else 1
u = 0 if s[1] == "d" else 1
a[f] = u
if w == 0 and a[0] == 1 and a[1] == 1:
w ... | File "/tmp/tmpdrzza5zz/tmphu208977.py", line 23
print ans
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s026394802 | p01694 | u966364923 | 1436627431 | Python | Python3 | py | Runtime Error | 0 | 0 | 311 | def main():
while True:
n = int(input())
if n == 0:
exit()
f = [s for input().split()]
pm = 'd'
cnt = 0
for m in f:
if m[1] == pm:
cnt += 1
pm = m[1]
print(cnt)
if __name__ == '__main__':
main() | File "/tmp/tmpprl1efi_/tmpkmty1brz.py", line 6
f = [s for input().split()]
^^^^^^^^^^^^^^^
SyntaxError: cannot assign to function call
| |
s597515499 | p01694 | u052632641 | 1528468832 | Python | Python | py | Runtime Error | 0 | 0 | 489 | import sys,os
k = int(raw_input())
al = raw_input().split()
up = 0
sup = 0
cnt = 0
lu = False
ru = False
for a in al:
if a == "lu":
lu = True
elif a == "ld":
lu = False
elif a == "ru":
ru = True
elif a == "rd":
ru = False
if lu and ru:
up = 2
elif ... | File "/tmp/tmpryw4br2k/tmppafkeqmy.py", line 29
if sup <> up and sup <> 1 and up <> 1:
^^
SyntaxError: invalid syntax
| |
s994442310 | p01695 | u467175809 | 1530976766 | Python | Python | py | Runtime Error | 0 | 0 | 629 | while True:
N = input()
if N == 0:
break
lst = []
for i in range(N):
lst.append(list(raw_input()))
for i in range(N):
for j in range(len(lst[i]) - 1):
if lst[i][j] == '.' and lst[i][j + 1] != '.':
pos = j
for k in range(i, 0, -1):
... | File "/tmp/tmpj3llq0c1/tmpjmog3zac.py", line 20
print ''.join(lst[i]).replace('.', ' ')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s536841100 | p01695 | u467175809 | 1530979233 | Python | Python | py | Runtime Error | 0 | 0 | 629 | while True:
N = input()
if N == 0:
break
lst = []
for i in range(N):
lst.append(list(raw_input()))
for i in range(N):
for j in range(len(lst[i]) - 1):
if lst[i][j] == '.' and lst[i][j + 1] != '.':
pos = j
for k in range(i, 0, -1):
... | File "/tmp/tmpmseqftou/tmpco7f7ubd.py", line 20
print ''.join(lst[i]).replace('.', ' ')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s662264863 | p01695 | u467175809 | 1530979631 | Python | Python | py | Runtime Error | 0 | 0 | 794 | #!/usr/bin/env python
import sys
import math
import itertools as it
from collections import deque
sys.setrecursionlimit(10000000)
while True:
N = input()
if N == 0:
break
lst = []
for i in range(N):
lst.append(list(raw_input()))
for i in range(N):
for j in range(len(lst[i]... | File "/tmp/tmp6cgnc38m/tmpcs337dkm.py", line 30
print ''.join(lst[i]).replace('.', ' ')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s183256857 | p01695 | u591052358 | 1529630483 | Python | Python3 | py | Runtime Error | 0 | 0 | 758 | def count_dot(lis):
c=0
for i in lis:
if not(i=='.'):
return c
c+=1
def solve(N):
a=[]
dot =[]
for i in range(N):
a.append([char for char in input()])
dot.append(count_dot(a[i]))
for i in range(N):
for j in range(len(a[i])):
if a[... | Traceback (most recent call last):
File "/tmp/tmp_rrgud2b/tmpwnds3f5h.py", line 35, in <module>
N=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s649358189 | p01695 | u591052358 | 1529630570 | Python | Python3 | py | Runtime Error | 0 | 0 | 758 | def count_dot(lis):
c=0
for i in lis:
if not(i=='.'):
return c
c+=1
def solve(N):
a=[]
dot =[]
for i in range(N):
a.append([char for char in input()])
dot.append(count_dot(a[i]))
for i in range(N):
for j in range(len(a[i])):
if a[... | Traceback (most recent call last):
File "/tmp/tmp_04byv64/tmp6lofslba.py", line 35, in <module>
N=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s984387166 | p01696 | u731941832 | 1530590379 | Python | Python3 | py | Runtime Error | 0 | 0 | 752 | while True:
s = input()
if s == '.':break
while True:
index = min(max(0, s.find('+')), max(0, s.find('-')))
if index == 0 and s[0] != '+' and s[0] != '-':
index = s.rfind('[')
if index == -1:
break
e = s[index:].find(']')
s = s[... | File "/tmp/tmpl3d2nr0a/tmpl9pi6h4u.py", line 23
r = chr(ord(r) += f)
^^
SyntaxError: invalid syntax
| |
s950168623 | p01696 | u731941832 | 1530590531 | Python | Python3 | py | Runtime Error | 0 | 0 | 749 | while True:
s = input()
if s == '.':break
while True:
index = min(max(0, s.find('+')), max(0, s.find('-')))
if index == 0 and s[0] != '+' and s[0] != '-':
index = s.rfind('[')
if index == -1:
break
e = s[index:].find(']')
s = s[... | File "/tmp/tmp170k1yuu/tmp3bnvl6mz.py", line 23
r = chr(ord(r) += f)
^^
SyntaxError: invalid syntax
| |
s453400008 | p01696 | u731941832 | 1530590552 | Python | Python3 | py | Runtime Error | 0 | 0 | 748 | while True:
s = input()
if s == '.':break
while True:
index = min(max(0, s.find('+')), max(0, s.find('-')))
if index == 0 and s[0] != '+' and s[0] != '-':
index = s.rfind('[')
if index == -1:
break
e = s[index:].find(']')
s = s[... | Traceback (most recent call last):
File "/tmp/tmplk9h_8ws/tmp9_vtr6_t.py", line 2, in <module>
s = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s371003155 | p01696 | u731941832 | 1530590662 | Python | Python3 | py | Runtime Error | 0 | 0 | 764 | while True:
s = input()
if s == '.':break
while True:
index = min(max(0, s.find('+')), max(0, s.find('-')))
if index == 0 and s[0] != '+' and s[0] != '-':
index = s.rfind('[')
if index == -1:
break
e = s[index:].find(']')
s = s[... | Traceback (most recent call last):
File "/tmp/tmpn031e_a1/tmphxz_g92a.py", line 2, in <module>
s = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s047912802 | p01696 | u731941832 | 1530591096 | Python | Python3 | py | Runtime Error | 0 | 0 | 765 | while True:
s = input()
if s == '.':break
while True:
index = min(max(0, s.find('+')), max(0, s.find('-')))
if index == 0 and s[0] != '+' and s[0] != '-':
index = s.rfind('[')
if index == -1:
break
e = s[index:].find(']')
s = s[... | Traceback (most recent call last):
File "/tmp/tmp0j9ewemp/tmpc04t2ljp.py", line 2, in <module>
s = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s304635391 | p01696 | u731941832 | 1530612084 | Python | Python3 | py | Runtime Error | 0 | 0 | 806 | while True:
s = input()
if s == '.':break
while True:
if s.find('+') == -1 and s.find('-') == -1:
index = s.rfind('[')
if index == -1:break
e = s.find(']', index)
s = s[:index] + s[index + 1:e][::-1] + s[e + 1:]
else:
index = s.find... | File "/tmp/tmp3w3kfjom/tmptci_pdft.py", line 14
if s.find('-') != -1
^
SyntaxError: expected ':'
| |
s594176656 | p01696 | u731941832 | 1530612234 | Python | Python3 | py | Runtime Error | 0 | 0 | 814 | while True:
s = input()
if s == '.':break
while True:
if s.find('+') == -1 and s.find('-') == -1:
index = s.rfind('[')
if index == -1:break
e = s.find(']', index, len(s))
s = s[:index] + s[index + 1:e][::-1] + s[e + 1:]
else:
index ... | File "/tmp/tmpr7ot9q8k/tmpf9l85xom.py", line 14
if s.find('-') != -1
^
SyntaxError: expected ':'
| |
s367691272 | p01702 | u827448139 | 1418360848 | Python | Python3 | py | Runtime Error | 19930 | 7516 | 600 | while 1:
n,m,q=map(int,input().split())
if (n|m|q)==0: break
p=[]
res=[[_ for _ in range(n)] for _ in range(m)]
for i in range(q):
s,b=[[int(c) for c in s] for s in input().split()]
if i>0:
for j in range(n):
s[j]^=p[j]
for j in range(n):
for k in range(m):
if s[j]!=... | Traceback (most recent call last):
File "/tmp/tmp4naheacs/tmpznr91dzl.py", line 2, in <module>
n,m,q=map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s267091660 | p01702 | u633068244 | 1423509183 | Python | Python | py | Runtime Error | 0 | 0 | 622 | ref = "0123456789ACDEFGHIJKLMNOPQRSTUVWXYZ"
while 1:
N,M,Q = map(int,raw_input().split())
if N == 0: break
corr = [set(range(N)) for _ in range(M)]
s = ["0"]*N
for loop in xrange(Q):
S,B = raw_input().split()
for i in range(N):
if S[i] == "1": s[i] = {"0":"1","1":"0"}[s[... | File "/tmp/tmpb8yh4_5r/tmp_dssm33_.py", line 18
print "".join(ans)
^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s173141626 | p01702 | u633068244 | 1423509878 | Python | Python | py | Runtime Error | 0 | 0 | 556 | ref = "0123456789ACDEFGHIJKLMNOPQRSTUVWXYZ"
while 1:
N,M,Q = map(int,raw_input().split())
if N == 0: break
sn = set(range(N))
corr = [set(range(N)) for _ in range(M)]
s = [0]*N
for loop in xrange(Q):
S,B = raw_input().split()
s = [1-s[i] if S[i] == "1" else s[i] for i in range(N)... | File "/tmp/tmpu3ufbig6/tmpcops8uwx.py", line 16
print "".join(ans)
^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s771507084 | p01702 | u509278866 | 1529231463 | Python | Python3 | py | Runtime Error | 0 | 0 | 1923 | import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 998244353
dd = [(0,-1),(1,0),(0,1),(-1,0)]
ddn = [(0,-1),(1,-1),(1,0),(1,1),(0,1),(-1,-1),(-1,0),(-1,1)]
def LI(): return [int(x) for x in sys.stdi... | Traceback (most recent call last):
File "/tmp/tmp5st0yc_p/tmp8m5dc4ae.py", line 73, in <module>
print(main())
^^^^^^
File "/tmp/tmp5st0yc_p/tmp8m5dc4ae.py", line 26, in main
n,m,q = LI()
^^^^^
ValueError: not enough values to unpack (expected 3, got 0)
| |
s467787917 | p01712 | u273756488 | 1559290225 | Python | Python3 | py | Runtime Error | 20 | 5612 | 554 | n, W, H = [int(i) for i in input().split()]
X = [[int(i) for i in input().split()] for j in range(n)]
imos_h = [0] * (H + 2)
imos_w = [0] * (W + 2)
for x, y, w in X:
imos_h[max(0, y - w)] += 1
imos_h[min(W + 1, y + w + 1)] -= 1
imos_w[max(0, x - w)] += 1
imos_w[min(H + 1, x + w + 1)] -= 1
for h in range(H)... | Traceback (most recent call last):
File "/tmp/tmp8fixjy__/tmp7w2oyt5_.py", line 1, in <module>
n, W, H = [int(i) for i in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s937756726 | p01712 | u273756488 | 1559290300 | Python | Python3 | py | Runtime Error | 20 | 5616 | 554 | n, W, H = [int(i) for i in input().split()]
X = [[int(i) for i in input().split()] for j in range(n)]
imos_h = [0] * (H + 2)
imos_w = [0] * (W + 2)
for x, y, w in X:
imos_h[max(0, y - w)] += 1
imos_h[min(W + 1, y + w + 1)] -= 1
imos_w[max(0, x - w)] += 1
imos_w[min(H + 1, x + w + 1)] -= 1
for h in range(H)... | Traceback (most recent call last):
File "/tmp/tmpfzhl_3t1/tmp0mibmwko.py", line 1, in <module>
n, W, H = [int(i) for i in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s335970129 | p01712 | u296492699 | 1422625489 | Python | Python | py | Runtime Error | 0 | 0 | 502 | input_lines = raw_input()
n,w,h = map(int, input_lines.split())
wifi_list=[]
x_list = [False for i in range(w+1)]
y_list = [False for i in range(h+1)]
for i in range(n):
input_lines = raw_input()
xi,yi,wi = map(int, input_lines.split()))
xs=xi-wi if xi-wi>=0 else 0
xe=xi+wi if xi+wi<=w else w
ys=y... | File "/tmp/tmprcbthqu3/tmp_yx89j9k.py", line 10
xi,yi,wi = map(int, input_lines.split()))
^
SyntaxError: unmatched ')'
| |
s391045986 | p01712 | u296492699 | 1422626407 | Python | Python | py | Runtime Error | 0 | 0 | 491 | import sys
in_txt=sys.stdin.read().splitlines()
n,w,h = map(int, in_txt[0].split())
wifi_list=[]
x_list = [False for i in range(w+1)]
y_list = [False for i in range(h+1)]
for i in in_txt[1:]:
xi,yi,wi = map(int, i.split())
xs=xi-wi if xi-wi>=0 else 0
xe=xi+wi if xi+wi<=w else w
ys=yi-wi if yi-... | File "/tmp/tmpkg8h7k2q/tmp5vqi3p_z.py", line 23
print 'No'
^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s507979866 | p01712 | u296492699 | 1422635350 | Python | Python | py | Runtime Error | 0 | 0 | 578 | mport sys
in_txt=sys.stdin.read().splitlines()
n,w,h = map(int, in_txt[0].split())
wifi_list=[]
area = [[False for i in range(w+1)] for j in range(h+1)]
for i in in_txt[1:]:
xi,yi,wi = map(int, i.split())
xs=xi-wi if xi-wi>=0 else 0
xe=xi+wi if xi+wi<=w else w
ys=yi-wi if yi-wi>=0 else 0
ye=yi... | File "/tmp/tmp_xfscgap/tmpvrco1gmq.py", line 1
mport sys
^^^
SyntaxError: invalid syntax
| |
s396647562 | p01712 | u753085696 | 1425897669 | Python | Python | py | Runtime Error | 0 | 0 | 374 | # your code goes here
import numpy as np
buf = raw_input()
buf = buf.split(" ")
n = int(buf[0])
w = int(buf[1])
h = int(buf[2])
array = np.zeros((h, w))
for i in xrange(n):
buf = raw_input()
buf = buf.split(" ")
x = int(buf[0])
y = int(buf[1])
w = int(buf[2])
array[(y-w):(y+w),:]=True
array[:,(x-w):(x+w)]=T... | File "/tmp/tmp5k4oom33/tmpytlci6g_.py", line 24
print "Yes"
^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s390973156 | p01712 | u474983612 | 1463255984 | Python | Python3 | py | Runtime Error | 0 | 0 | 936 | test_file = open('C:\\Users\\nanashi\Downloads\\2600-in21.txt')
input = lambda: test_file.readline().rstrip()
N, W, H = [int(x) for x in input().split()]
map_x = [False] * W
count_x = 0
map_y = [False] * H
count_y = 0
wifi_x = []
wifi_y = []
for _ in range(N):
x, y, w = [int(x) for x in input().split()]
wi... | Traceback (most recent call last):
File "/tmp/tmp2zhgvfw5/tmpk2kzncxj.py", line 1, in <module>
test_file = open('C:\\Users\\nanashi\Downloads\\2600-in21.txt')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\nanashi\\Downloads\... | |
s825141223 | p01713 | u352394527 | 1530436469 | Python | Python3 | py | Runtime Error | 0 | 0 | 781 | def search_left(ind):
doors = []
for j in range(ind - 1, -1, -1):
if alst[j] < 0:
doors.append((j, -alst[j]))
if alst[j] == 0:
ret = alst[ind]
for pos, lim in doors:
ret = min(ret, lim - (ind - pos))
ret = max(0, ret)
return ret
return 0
def search_right(ind):
doors... | Traceback (most recent call last):
File "/tmp/tmp8teaf2cy/tmpfv992bub.py", line 35, in <module>
main()
^^^^^^
File "/tmp/tmp8teaf2cy/tmpfv992bub.py", line 28, in main
w = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s962645052 | p01714 | u567380442 | 1426078153 | Python | Python3 | py | Runtime Error | 19930 | 6988 | 2910 | from itertools import combinations
from itertools import groupby
def solve(xyuv):
if len(xyuv) <= 2 or is_all_same(xyuv) or is_all_same_attime(xyuv):
return len(xyuv)
max_ij = 0
for i, j in combinations(range(len(xyuv)), 2):
if xyuv[i] == xyuv[j]:
continue
xyi,uvi = xyuv[... | Traceback (most recent call last):
File "/tmp/tmp9gzgxhje/tmptdrd3g8v.py", line 114, in <module>
main(f)
File "/tmp/tmp9gzgxhje/tmptdrd3g8v.py", line 78, in main
_ = int(f.readline())
^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s353683596 | p01714 | u567380442 | 1426144397 | Python | Python3 | py | Runtime Error | 30 | 6920 | 2732 | def take2(i):
while True:
yield next(i),next(i)
def main(f):
_ = int(f.readline())
xyuv = [[x+y*1j for x,y in take2(map(int, line.split()))] for line in f]
print(solve(xyuv))
def is_all_same_attime(xyuv):
xy0, uv0 = xyuv[0]
for i in range(len(xyuv)):
if xyuv[0] == xyuv[i]:
... | Traceback (most recent call last):
File "/tmp/tmpgejishzm/tmpnd8g6esi.py", line 100, in <module>
main(f)
File "/tmp/tmpgejishzm/tmpnd8g6esi.py", line 5, in main
_ = int(f.readline())
^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s126505987 | p01714 | u083285064 | 1426956447 | Python | Python3 | py | Runtime Error | 19930 | 6768 | 849 | import itertools
N = int(input())
km = []
for i in range(N):
km.append(input().split(' '))
nmax = 0
try:
for i in range(1000):
ks = []
for j in range(N):
x, y, u, v = list(map(int, list(km[j])))
ks.append((x + u * i, y + v * i))
for k in list(itertools.combinat... | Traceback (most recent call last):
File "/tmp/tmpqjneb1_w/tmpidy4zwzf.py", line 3, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s878641653 | p01715 | u567380442 | 1426301410 | Python | Python3 | py | Runtime Error | 150 | 12856 | 948 | from operator import itemgetter
#@profile
def calc(w,pdp,pl,pr,dp,l,r):
if l >= r:
return
m = (l + r) // 2
dp[m], i = min([(pdp[i] + w[i+1][m],i) for i in range(pl,min(pr,m))], key=itemgetter(0))
calc(w,pdp,pl,i,dp,l,m-1)
calc(w,pdp,i,pr,dp,m+1,r)
return dp
import sys
f = sys.stdin
s,n... | Traceback (most recent call last):
File "/tmp/tmpbtrusc3_/tmpoy0t2cfr.py", line 15, in <module>
s,n,m = map(int, f.readline().split())
^^^^^
ValueError: not enough values to unpack (expected 3, got 0)
| |
s987405682 | p01716 | u567380442 | 1426381406 | Python | Python3 | py | Runtime Error | 19930 | 6876 | 1829 | def dfs(p,s,c,cmin,cmax):
if len(p) == 0:
return solve(s,c,cmin,cmax)
lower, u = p[0]
c += lower
if u <= 9:
cmin[lower] = 0
cmax[lower] = u
return dfs(p[1:],s,c,cmin,cmax)
cmin[lower] = 0
cmax[lower] = 9
ret = dfs(p[1:],s,c,cmin,cmax)
upper = lower.u... | Traceback (most recent call last):
File "/tmp/tmpttp3i7r9/tmpqbclxuq7.py", line 68, in <module>
_, _ = map(int, f.readline().split())
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s456113901 | p01722 | u939118618 | 1429524150 | Python | Python | py | Runtime Error | 20 | 4384 | 425 | import math
def sieve (n):
prime = [0,0]
prime += [1 for i in range(n-1)]
ub = math.sqrt(n) + 1
d = 2
while d <= ub:
if prime[d] == 0:
d += 1
continue
prod = 2
while d * prod <= n:
prime[d*prod] = 0
prod += 1
d += 1
return prime
n = int(raw_input())
pn = 1
for i in range(n):
pn *= 2
prime = s... | File "/tmp/tmpnd5p13z2/tmp48a4wflt.py", line 27
print int(format(2**(pn-1)-1, "b")) % pn
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s416302687 | p01722 | u939118618 | 1429524241 | Python | Python | py | Runtime Error | 20 | 4380 | 425 | import math
def sieve (n):
prime = [0,0]
prime += [1 for i in range(n-1)]
ub = math.sqrt(n) + 1
d = 2
while d <= ub:
if prime[d] == 0:
d += 1
continue
prod = 2
while d * prod <= n:
prime[d*prod] = 0
prod += 1
d += 1
return prime
n = int(raw_input())
pn = 1
for i in range(n):
pn *= 2
prime = s... | File "/tmp/tmpz259ozrj/tmpfj4vuo2y.py", line 27
print int(format(2**(pn-1)-1, "b")) % pn
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s562740857 | p01722 | u939118618 | 1429524373 | Python | Python | py | Runtime Error | 10 | 4392 | 427 | import math
def sieve (n):
prime = [0,0]
prime += [1 for i in range(n-1)]
ub = math.sqrt(n) + 1
d = 2
while d <= ub:
if prime[d] == 0:
d += 1
continue
prod = 2
while d * prod <= n:
prime[d*prod] = 0
prod += 1
d += 1
return prime
n = int(raw_input())
pn = 1
for i in range(n):
pn *= 2
prime = s... | File "/tmp/tmpo2py8ffx/tmpdy5d3o96.py", line 27
print int(format(2**(pn-1)-1, "b")) % pn
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s400623501 | p01722 | u939118618 | 1429524451 | Python | Python | py | Runtime Error | 10 | 4384 | 426 | import math
def sieve (n):
prime = [0,0]
prime += [1 for i in range(n-1)]
ub = math.sqrt(n) + 1
d = 2
while d <= ub:
if prime[d] == 0:
d += 1
continue
prod = 2
while d * prod <= n:
prime[d*prod] = 0
prod += 1
d += 1
return prime
n = int(raw_input())
pn = 1
for i in range(n):
pn *= 2
prime = s... | File "/tmp/tmpbo_5s3qk/tmpmpop8x_f.py", line 27
print int(format(2**(pn-1)-1, "b")) % pn
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s572779317 | p01722 | u823513038 | 1448250506 | Python | Python3 | py | Runtime Error | 0 | 0 | 35 | n=int(input())
print(n?n>3?0:3-n:1) | File "/tmp/tmp9muewrmj/tmpeow_c1c9.py", line 2
print(n?n>3?0:3-n:1)
^
SyntaxError: invalid syntax
| |
s397176132 | p01731 | u633068244 | 1433095836 | Python | Python | py | Runtime Error | 20 | 4356 | 297 | def dfs(i, z):
print "." * z + name[i]
for j in child[i]:
dfs(j, z + 1)
n = int(raw_input())
name = []
child = [[] for i in xrange(n)]
for i in xrange(n):
k = int(raw_input())
m = raw_input()
name.append(m)
if k == 0: continue
child[k - 1].append(i)
dfs(0, 0) | File "/tmp/tmpwnaa5nwk/tmpj_0s3ryu.py", line 2
print "." * z + name[i]
^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s952328585 | p01731 | u633068244 | 1433095879 | Python | Python | py | Runtime Error | 0 | 0 | 335 | import sys
sys.setrecursionlimi(9999)
def dfs(i, z):
print "." * z + name[i]
for j in child[i]:
dfs(j, z + 1)
n = int(raw_input())
name = []
child = [[] for i in xrange(n)]
for i in xrange(n):
k = int(raw_input())
m = raw_input()
name.append(m)
if k == 0: continue
child[k - 1].appen... | File "/tmp/tmpolpzxn2i/tmpt7cao2qt.py", line 4
print "." * z + name[i]
^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s291640217 | p01731 | u506554532 | 1514360375 | Python | Python3 | py | Runtime Error | 40 | 5856 | 266 | N = int(input())
src = []
for i in range(N):
k = int(input())
s = input()
src.append((s,[]))
if i == 0: continue
src[k-1][1].append(i)
def dfs(i,depth):
s,ch = src[i]
print('.'*depth + s)
for c in ch:
dfs(c,depth+1)
dfs(0,0) | Traceback (most recent call last):
File "/tmp/tmp5nsyum8_/tmpaxv15hk4.py", line 1, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s238629497 | p01741 | u633068244 | 1433319737 | Python | Python | py | Runtime Error | 0 | 0 | 169 | import math
d = float(raw_input())
res = math.sqrt(2) * d
for x in xrange(1, 11):
if x * x <= d * d <= x * 2 + 1:
ans = max(ans, d + 1.0)
print "%.10f" % ans | File "/tmp/tmp03z0phtb/tmppi_fss7c.py", line 7
print "%.10f" % ans
^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s927772015 | p01751 | u979136186 | 1478763489 | Python | Python | py | Runtime Error | 0 | 0 | 393 | while True:
a, b, c = map(int, raw_input().split())
if(a | b | c == 0):break
i = 0
canArrive = False
now = 0
while True:
if now <= c and c <= now + b:
canArrive = True
break
now += (a + b)
now %= 60
if now == 0 : break
i +=... | File "/tmp/tmpln_baqbl/tmppy8_ztzs.py", line 22
print c + 60 * i
^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s045262134 | p01751 | u136916346 | 1530512185 | Python | Python3 | py | Runtime Error | 0 | 0 | 412 | from itertools import count
a,b,c=map(int,raw_input().split())
g=set()
for n in count(0):
p=(c+60*n)//(a+b)
print (a+b)*p,c+60*n,(a+b)*p+a
if ((a+b)*p-(c+60*n),(c+60*n)-((a+b)*p+a)) in g:
n=-1
break
if (a+b)*p<=c+60*n<=(a+b)*p+a:
break
else:
d=(a+b)*p-(c+60*n)
... | Traceback (most recent call last):
File "/tmp/tmp0wyylirb/tmph54x22fx.py", line 2, in <module>
a,b,c=map(int,raw_input().split())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s118525931 | p01755 | u352394527 | 1546560053 | Python | Python3 | py | Runtime Error | 30 | 5792 | 3711 | def parse_prog(prog, pointer, level, code):
while True:
pointer, code = parse_sent(prog, pointer, level, code)
if pointer == len(prog):break
if prog[pointer] in ("]", "}"):break
return pointer + 1, code
def parse_sent(prog, pointer, level, code):
head = prog[pointer]
if head == "[":
pointer, co... | Traceback (most recent call last):
File "/tmp/tmpah1xepag/tmp8kzl7f32.py", line 102, in <module>
h, w = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s018493194 | p01772 | u359169485 | 1434762671 | Python | Python | py | Runtime Error | 0 | 0 | 120 | while True:
d = filter(lambda x:x in "AZ", raw_input())
if len(d)<1:
print "-1"
elif d[-1] == "Z":
print d | File "/tmp/tmp0grwgy5w/tmpudh77sda.py", line 4
print "-1"
^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s955177492 | p01803 | u898097781 | 1467377837 | Python | Python | py | Runtime Error | 0 | 0 | 496 |
def a2c(name):
c = name[0]
boin=['a','i','u','e','o']
for b in name:
if i, b in enumerate(boin[:-1]):
c += name[i+1]
return c
while True:
n = int(raw_input())
if n == 0:
break
names = []
length = -1
for i in xrange(n):
tmp = a2c(raw_input())
names.append(tmp)
length = max(length, len(tmp))... | File "/tmp/tmpcjoobulc/tmpz3umf7w9.py", line 6
if i, b in enumerate(boin[:-1]):
^
SyntaxError: invalid syntax
| |
s582083298 | p01803 | u260980560 | 1501602422 | Python | Python3 | py | Runtime Error | 0 | 0 | 559 | while 1:
n = int(input())
S = []
for i in range(n):
s = input()
b = []
for j in range(len(s)):
if j < 1 or s[j-1] in "aiueo":
b.append(s[j])
S.append(b)
ans = 0
S.sort()
for i in range(n-1):
A = S[i]; B = S[i+1]
if A == ... | Traceback (most recent call last):
File "/tmp/tmpp32t71a3/tmp998unw7l.py", line 2, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s122934191 | p01809 | u606573458 | 1499748826 | Python | Python3 | py | Runtime Error | 0 | 0 | 212 | # -*- coding: utf-8 -*-
import math
p, q = map(int, input().split())
g = math.gcd(p, q)
p, q = p // g, q // g;
ret = q
for b in range(1, 40000):
if b ** 1000 * p % q == 0:
ret = min(ret, b)
print(ret) | Traceback (most recent call last):
File "/tmp/tmp7drlvxfi/tmpgihmdn6x.py", line 3, in <module>
p, q = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s782897080 | p01809 | u606573458 | 1499748847 | Python | Python3 | py | Runtime Error | 0 | 0 | 212 | # -*- coding: utf-8 -*-
import math
p, q = map(int, input().split())
g = math.gcd(p, q)
p, q = p // g, q // g;
ret = q
for b in range(1, 40000):
if b ** 1000 * p % q == 0:
ret = min(ret, b)
print(ret) | Traceback (most recent call last):
File "/tmp/tmp5wiecrzf/tmpu27cgdr1.py", line 3, in <module>
p, q = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s901410179 | p01809 | u606573458 | 1499748906 | Python | Python3 | py | Runtime Error | 0 | 0 | 212 | # -*- coding: utf-8 -*-
import math
p, q = map(int, input().split())
g = math.gcd(p, q)
p, q = p // g, q // g;
ret = q
for b in range(1, 40000):
if b ** 1000 * p % q == 0:
ret = min(ret, b)
print(ret) | Traceback (most recent call last):
File "/tmp/tmpy3lo_gjg/tmpysfaq6z7.py", line 3, in <module>
p, q = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s874413830 | p01809 | u606573458 | 1499748918 | Python | Python | py | Runtime Error | 0 | 0 | 212 | # -*- coding: utf-8 -*-
import math
p, q = map(int, input().split())
g = math.gcd(p, q)
p, q = p // g, q // g;
ret = q
for b in range(1, 40000):
if b ** 1000 * p % q == 0:
ret = min(ret, b)
print(ret) | Traceback (most recent call last):
File "/tmp/tmp65bt4p6s/tmp7hy3tq3b.py", line 3, in <module>
p, q = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s307616922 | p01809 | u606573458 | 1499748991 | Python | Python3 | py | Runtime Error | 0 | 0 | 212 | # -*- coding: utf-8 -*-
import math
p, q = map(int, input().split())
g = math.gcd(p, q)
p, q = p // g, q // g;
ret = q
for b in range(1, 40000):
if b ** 1000 * p % q == 0:
ret = min(ret, b)
print(ret) | Traceback (most recent call last):
File "/tmp/tmpvsllj4t0/tmp_3ar7_1c.py", line 3, in <module>
p, q = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s966096455 | p01809 | u606573458 | 1499749073 | Python | Python3 | py | Runtime Error | 0 | 0 | 181 | import math
p, q = map(int, input().split())
g = math.gcd(p, q)
p //= g
q //= g
ret = q
for b in range(1, 40000):
if b ** 1000 * p % q == 0:
ret = min(ret, b)
print(ret) | Traceback (most recent call last):
File "/tmp/tmpl9xq2yhy/tmpltqhntmo.py", line 2, in <module>
p, q = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s932566079 | p01809 | u314932236 | 1529464707 | Python | Python3 | py | Runtime Error | 0 | 0 | 73 | import math
p = int(input())
q = int(input())
print(b/(math.gcd(p,q)))
| Traceback (most recent call last):
File "/tmp/tmphhibj3sa/tmpcnowwtca.py", line 3, in <module>
p = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s655992491 | p01809 | u314932236 | 1529464757 | Python | Python3 | py | Runtime Error | 0 | 0 | 73 | import math
p = int(input())
q = int(input())
print(q/(math.gcd(p,q)))
| Traceback (most recent call last):
File "/tmp/tmpscktlwmv/tmpst4i7fiu.py", line 3, in <module>
p = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s902350403 | p01809 | u314932236 | 1529465008 | Python | Python3 | py | Runtime Error | 0 | 0 | 78 | import math
p = int(input())
q = int(input())
print(int(q/(math.gcd(p,q))))
| Traceback (most recent call last):
File "/tmp/tmp_frrfv0h/tmpmhdih1pd.py", line 3, in <module>
p = int(input())
^^^^^^^
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.