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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s110089845 | p01274 | u509278866 | 1535515958 | Python | Python3 | py | Runtime Error | 0 | 0 | 2325 | 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**13
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]
def LI(): return [int(x) for x in sys.stdin.... | Traceback (most recent call last):
File "/tmp/tmpabr30rgp/tmp7o4t88iq.py", line 86, in <module>
print(main())
^^^^^^
File "/tmp/tmpabr30rgp/tmp7o4t88iq.py", line 78, in main
n = I()
^^^
File "/tmp/tmpabr30rgp/tmp7o4t88iq.py", line 14, in I
def I(): return int(sys.stdin.readline())
... | |
s015821806 | p01283 | u633068244 | 1423406128 | Python | Python | py | Runtime Error | 19930 | 4448 | 627 | import math
def calcH(O):
n = len(O)
return sum(-O.count(x)*1.0/n*math.log(O.count(x)*1.0/n) for x in set(O))
M = 256
while 1:
n = int(raw_input())
if n == 0: break
I = map(int,raw_input().split())
H = 10**10
for S in range(16):
for A in range(16):
for C in range(16)... | File "/tmp/tmpb9pxlfsv/tmpx7shegkm.py", line 24
print " ".join(map(str,ans))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s947855374 | p01283 | u633068244 | 1423406354 | Python | Python | py | Runtime Error | 19930 | 4448 | 623 | import math
def calcH(O):
n = len(O)
return sum(-O.count(x)*1.0/n*math.log(O.count(x)*1.0/n) for x in set(O))
M = 256
while 1:
n = int(raw_input())
if n == 0: break
I = map(int,raw_input().split())
H = 10**10
for S in range(16):
for A in range(16):
for C in range(16):
... | File "/tmp/tmpbjr97q5s/tmpcgoaaxli.py", line 24
print " ".join(map(str,ans))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s899995885 | p01283 | u633068244 | 1423582029 | Python | Python | py | Runtime Error | 19930 | 4452 | 623 | import math
def calcH(O):
n = len(O)
return sum(-O.count(x)*1.0/n*math.log(O.count(x)*1.0/n) for x in set(O))
M = 256
while 1:
n = int(raw_input())
if n == 0: break
I = map(int,raw_input().split())
H = 10**10
for S in range(16):
for A in range(16):
for C in range(16):
... | File "/tmp/tmpspr1t9_w/tmpd4jhnxwg.py", line 24
print " ".join(map(str,ans))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s956835244 | p01283 | u633068244 | 1423683665 | Python | Python | py | Runtime Error | 19930 | 4444 | 576 | import math
M = 256
while 1:
N = int(raw_input())
if N == 0: break
H = 10**10
l = map(int,raw_input().split())
for S in range(16):
for A in range(16):
for C in range(16):
R = S
O = [0]*N
for i in range(N):
R = (A... | File "/tmp/tmppxkd71qj/tmpq35ufc1d.py", line 20
print " ".join(map(str,ans))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s917761598 | p01283 | u633068244 | 1423684110 | Python | Python | py | Runtime Error | 0 | 0 | 598 | import math
M = 256
while 1:
N = int(raw_input())
if N == 0: break
H = 1
l = map(int,raw_input().split())
for S in range(16):
for A in range(16):
for C in range(16):
R = S
O = [0]*N
for i in range(N):
R = (A*R+C)... | File "/tmp/tmp0o8c1fme/tmpimxad4d2.py", line 21
print " ".join(map(str,ans))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s698212365 | p01283 | u633068244 | 1423684194 | Python | Python | py | Runtime Error | 0 | 0 | 603 | import math
M = 256
while 1:
N = int(raw_input())
if N == 0: break
H = 1
l = map(int,raw_input().split())
for S in range(16):
for A in range(16):
for C in range(16):
R = S
O = [0]*N
for i in range(N):
R = (A*R+C)... | File "/tmp/tmpm5g58uxq/tmpiqntd5em.py", line 21
print " ".join(map(str,ans))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s329585870 | p01283 | u633068244 | 1423684234 | Python | Python | py | Runtime Error | 19930 | 4452 | 606 | import math
M = 256
while 1:
N = int(raw_input())
if N == 0: break
H = 1e32
l = map(int,raw_input().split())
for S in range(16):
for A in range(16):
for C in range(16):
R = S
O = [0]*N
for i in range(N):
R = (A*R... | File "/tmp/tmp1imwwgj1/tmpaku479v4.py", line 21
print " ".join(map(str,ans))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s460160136 | p01283 | u633068244 | 1423684399 | Python | Python | py | Runtime Error | 19930 | 4456 | 608 | import math
M = 256
while 1:
N = int(raw_input())
if N == 0: break
H = 1e10
l = map(int,raw_input().split())
for S in range(16):
for A in range(16):
for C in range(16):
R = S
O = [0]*N
for i in range(N):
R = (A*R... | File "/tmp/tmpeoynxhdx/tmpnnmb7u0a.py", line 21
print " ".join(map(str,ans))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s663478804 | p01283 | u506554532 | 1514525929 | Python | Python3 | py | Runtime Error | 0 | 0 | 753 | import math
from collections import Counter
M = 256
def entropy(ctr):
ret = 0
for v in ctr.values():
ret -= (v / N) * math.log2(v / N)
return ret
while True:
N = int(input())
if N == 0: break
src = list(map(int,input().split()))
ans_h = float('inf')
ans_sac = None
for s in ... | Traceback (most recent call last):
File "/tmp/tmpfofvju5w/tmpcphgm008.py", line 12, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s207398163 | p01283 | u506554532 | 1514526354 | Python | Python3 | py | Runtime Error | 0 | 0 | 850 | import math
from collections import Counter
M = 256
def entropy(ctr):
ret = 0
for v in ctr.values():
ret -= (v / N) * math.log2(v / N)
return ret
def solve(src):
ans_h = float('inf')
ans = None
for s in range(16):
for a in range(16):
for c in range(16):
... | Traceback (most recent call last):
File "/tmp/tmp4pgtw7rf/tmp5ty8szvp.py", line 32, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s884760562 | p01283 | u506554532 | 1514527275 | Python | Python3 | py | Runtime Error | 0 | 0 | 939 | import math
from collections import Counter
M = 256
def entropy_if_smallest(ctr,bound):
ret = 0
for v in ctr.values():
ret -= (v / N) * math.log2(v / N)
if ret >= bound:
return None
return ret
def solve(src):
ans_h = float('inf')
ans = None
for s in range(16):
... | Traceback (most recent call last):
File "/tmp/tmpy1ctur68/tmpb8e6kov7.py", line 34, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s768989767 | p01283 | u109084363 | 1364107899 | Python | Python | py | Runtime Error | 20000 | 5376 | 796 | import sys
import collections
import math
while True:
N = int(raw_input())
if N == 0:
break
I = map(int, raw_input().split())
M = 256
result = []
for S in xrange(16):
for A in xrange(16):
for C in xrange(16):
R = [S]
for i in xran... | File "/tmp/tmpvvrixf3n/tmpf2yrrdyf.py", line 29
print ' '.join(map(str, result[0][1:]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s097259227 | p01283 | u109084363 | 1364108098 | Python | Python | py | Runtime Error | 20000 | 5372 | 734 | import sys
import collections
import math
while True:
N = int(raw_input())
if N == 0:
break
I = map(int, raw_input().split())
M = 256
result = []
for S in xrange(16):
for A in xrange(16):
for C in xrange(16):
R = [S]
for i in xran... | Traceback (most recent call last):
File "/tmp/tmpats8vnjx/tmpg9pa3acx.py", line 6, in <module>
N = int(raw_input())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s306908574 | p01283 | u109084363 | 1364108172 | Python | Python | py | Runtime Error | 20000 | 5376 | 595 | import sys
import collections
import math
while True:
N = int(raw_input())
if N == 0:
break
I = map(int, raw_input().split())
M = 256
result = []
for S in xrange(16):
for A in xrange(16):
for C in xrange(16):
R = [S]
for i in xrange(N):
R.append((A * R[i] + C) % M)
O = []
for i in x... | File "/tmp/tmpw3low1or/tmpnou6cy49.py", line 29
print ' '.join(map(str, result[0][1:]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s464343296 | p01283 | u109084363 | 1364108425 | Python | Python | py | Runtime Error | 20000 | 5360 | 770 | import sys
import collections
import math
while True:
N = int(raw_input())
if N == 0:
break
I = map(int, raw_input().split())
M = 256
result = []
for S in xrange(16):
for A in xrange(16):
for C in xrange(16):
R = [S]
for i in xran... | File "/tmp/tmpng9psnv9/tmpgkq3wima.py", line 28
print ' '.join(map(str, result[0][1:]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s289214529 | p01283 | u104911888 | 1372862233 | Python | Python | py | Runtime Error | 0 | 0 | 705 | import math
def prodR(s,a,c,N):
R=[s]
for i in range(1,N+1):
R.append((a*R[i-1]+c)%256)
return R[1:]
def entropy(R,I,N):
O=[(I[i]+R[i])%256 for i in range(N)]
L=[0]*256
for i in O:
L[i]+=1
H=-sum(float(L[i])/N*math.log(float(L[i])/N,2) for i in range(256) if L[i]!\
=0)
r... | File "/tmp/tmps48not6g/tmp0r2cm_yg.py", line 13
H=-sum(float(L[i])/N*math.log(float(L[i])/N,2) for i in range(256) if L[i]!\
^
SyntaxError: invalid syntax
| |
s522259215 | p01288 | u408260374 | 1519050377 | Python | Python3 | py | Runtime Error | 0 | 0 | 1727 | class UnionFindTree:
"""Disjoint-Set Data Structure
Union-Find Tree
complexity:
init: O(n)
find, unite, same: O(alpha(n))
used in SRM505 div.2 900, ATC001 A, DSL1A(AOJ)
"""
def __init__(self, n):
self.par = list(range(n)) # parent
self.rank = [0] * n... | Traceback (most recent call last):
File "/tmp/tmp3dcsu3wn/tmpla518qnv.py", line 36, in <module>
N, Q = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s062456607 | p01288 | u072053884 | 1519139511 | Python | Python3 | py | Runtime Error | 0 | 0 | 763 | def solve():
import sys
file_input = sys.stdin
def marked_ancestor(v):
if v == ancestor[v]:
return v
else:
ancestor[v] = marked_ancestor(parent[v])
return ancestor[v]
def line_ans(line):
v = int(line[2:])
if line[0] == 'M':
... | Traceback (most recent call last):
File "/tmp/tmp_212j1vf/tmp6or123dj.py", line 30, in <module>
solve()
File "/tmp/tmp_212j1vf/tmp6or123dj.py", line 21, in solve
N, Q = map(int, file_input.readline().split())
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s227298360 | p01295 | u615353970 | 1420714231 | Python | Python | py | Runtime Error | 0 | 0 | 351 | # -*- coding: utf-8 -*-
import sys
import math
while True:
# a,b = map(int,raw_input().split(' '))
a = int(raw_input())
b = int(raw_input())
if (a == 0 and b == 0):
sys.exit()
res = ""
for i in range(a,a+b):
res += str(i);
ans = ""
for i in range(a,a+b):
ans+=res[... | File "/tmp/tmp57uu459j/tmpo598e66f.py", line 17
print ans
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s740879705 | p01295 | u615353970 | 1420767582 | Python | Python | py | Runtime Error | 0 | 0 | 321 | # -*- coding: utf-8 -*-
import sys
import math
while True:
a,b = map(int,raw_input().split(' '))
if (a == 0 and b == 0):
sys.exit()
res = ""
for i in range(a,min(a+b,100/len(str(a)))):
res += str(i);
ans = ""
for i in range(a,a+b):
ans+=res[i-a]
print ans
... | File "/tmp/tmp7ivdzzma/tmp2sv6f1fm.py", line 15
print ans
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s663511304 | p01296 | u509278866 | 1531051555 | Python | Python3 | py | Runtime Error | 0 | 0 | 2862 | 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 = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]
def LI(): return [int(x) for x in sys.stdin.... | Traceback (most recent call last):
File "/tmp/tmpxawj1ssz/tmpqx6tonci.py", line 104, in <module>
print(main())
^^^^^^
File "/tmp/tmpxawj1ssz/tmpqx6tonci.py", line 24, in main
n = I()
^^^
File "/tmp/tmpxawj1ssz/tmpqx6tonci.py", line 14, in I
def I(): return int(sys.stdin.readline())
... | |
s343941255 | p01296 | u509278866 | 1531280586 | Python | Python3 | py | Runtime Error | 0 | 0 | 2832 | 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 = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]
def LI(): return [int(x) for x in sys.stdin.... | Traceback (most recent call last):
File "/tmp/tmpp8b6vktw/tmpq58bkrxo.py", line 107, in <module>
print(main())
^^^^^^
File "/tmp/tmpp8b6vktw/tmpq58bkrxo.py", line 24, in main
n = I()
^^^
File "/tmp/tmpp8b6vktw/tmpq58bkrxo.py", line 14, in I
def I(): return int(sys.stdin.readline())
... | |
s640568490 | p01298 | u947762778 | 1509275494 | Python | Python3 | py | Runtime Error | 0 | 0 | 956 | import
def check(h, slist, l):
last = l
t = 0
for s in slist:
last += (s[0] - t) * h
last = min(last, l)
last -= (s[1] - s[0]) * (s[2]-h)
t = s[1]
if last < 0:
return False
last = min(last, l)
d1last = last
t -= 86400
for s in slist:... | File "/tmp/tmpde815m5o/tmpbrbag35k.py", line 1
import
^
SyntaxError: invalid syntax
| |
s627931259 | p01300 | u798803522 | 1471594019 | Python | Python3 | py | Runtime Error | 40000 | 8744 | 565 | targ = input()
while True:
ans = 0
length = len(targ)
for o in range(length-1):
disp = [0 for n in range(length)]
for i in range(o+1,length):
if targ[o] == '0':
disp[i] = ans
elif i == length - 1:
disp[i] = int((int(targ[o] + targ[o+1:... | Traceback (most recent call last):
File "/tmp/tmpw8gyv9qv/tmptay8i0ty.py", line 1, in <module>
targ = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s302135327 | p01300 | u467175809 | 1529581102 | Python | Python | py | Runtime Error | 0 | 0 | 447 | #!/usr/bin/env python
from collections import deque
import itertools as it
import sys
sys.setrecursionlimit(1000000)
while True:
S = reversed(raw_input())
if S == '0':
break
m = [1] + [0 for i in range(10)]
diff = ans = 0
even = 1
for c in S:
num = int(c)
diff += num *... | File "/tmp/tmpfrptnd80/tmp1sdvuk64.py", line 24
print ans
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s618666116 | p01300 | u467175809 | 1529582315 | Python | Python | py | Runtime Error | 0 | 0 | 218 | #!/usr/bin/env python
from collections import deque
import itertools as it
import sys
sys.setrecursionlimit(1000000)
def fact(num):
if num <= 1:
return 1
return fact(num - 1) + 1
print fact(200000)
| File "/tmp/tmp7vxjcrmr/tmp5i5h4uw7.py", line 14
print fact(200000)
^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s731195987 | p01300 | u633068244 | 1398661062 | Python | Python | py | Runtime Error | 39860 | 9376 | 188 | while 1:
n = raw_input()
if n == "0": break
c = 0
for i in range(2,len(n) + 1):
for sp in range(len(n) - i + 1):
if n[sp] != "0" and int(n[sp:sp + i])%11 == 0:
c += 1
print c | File "/tmp/tmpqw0jwnfi/tmpdo_wdo4w.py", line 9
print c
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s891105972 | p01300 | u633068244 | 1398661625 | Python | Python | py | Runtime Error | 39860 | 9356 | 295 | def isEle(n):
s = 0
for i in range(len(n)):
s += (-1)**i * int(n[i])
return True if s%11 == 0 else False
while 1:
n = raw_input()
if n == "0": break
c = 0
for i in range(2,len(n) + 1):
for sp in range(len(n) - i + 1):
if n[sp] != "0" and isEle(n[sp:sp + i]):
c += 1
print c | File "/tmp/tmp6l4zekjd/tmp3ci1ze5n.py", line 15
print c
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s182667109 | p01300 | u633068244 | 1398662613 | Python | Python | py | Runtime Error | 39860 | 10604 | 325 | while 1:
n = raw_input()
if n == "0": break
size = len(n)
s = 0
diff = [0]*(size + 1)
for i in range(size):
s += (-1)**i * int(n[i])
diff[i + 1] = s
c = 0
for sp in range(size - 1):
if n[sp] == "0":
continue
for l in range(2,size - sp + 1):
if abs((diff[sp + l] - diff[sp])%11) == 0:
c += 1
pr... | File "/tmp/tmpubmuwtf0/tmp3mzuyd2t.py", line 17
print c
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s685935034 | p01300 | u633068244 | 1398662696 | Python | Python | py | Runtime Error | 39860 | 10620 | 363 | while 1:
try:
n = raw_input()
if n == "0": break
size = len(n)
s = 0
diff = [0]*(size + 1)
for i in range(size):
s += (-1)**i * int(n[i])
diff[i + 1] = s
c = 0
for sp in range(size - 1):
if n[sp] == "0":
continue
for l in range(2,size - sp + 1):
if abs((diff[sp + l] - diff[sp])%11) ... | File "/tmp/tmp588z351_/tmp8qa0a416.py", line 18
print c
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s865217099 | p01304 | u798803522 | 1470328641 | Python | Python3 | py | Runtime Error | 0 | 0 | 1495 | trial = int(input())
for t in range(trial):
targ = [int(n) for n in f.readline().split(' ')]
root = [[0 for n in range(targ[0] + 1)] for m in range(targ[1] + 1)]
matanum = int(f.readline())
for m in range(matanum):
matax,matay,secx,secy = (int(n) for n in f.readline().split(' '))
if mat... | Traceback (most recent call last):
File "/tmp/tmplfqflmxn/tmpyzxirkbf.py", line 1, in <module>
trial = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s097846838 | p01305 | u724548524 | 1528800621 | Python | Python3 | py | Runtime Error | 0 | 0 | 494 | import itertools
from decimal import Decimal, ROUND_HALF_UP
for _ in range(int(input())):
a, b = tuple(map(int, input().split())), tuple(map(int, input().split()))
c = 0
for i in itertools.permutations(b):
s = 0
for j in range(9):s += (a[j] + i[j]) * (a[j] > i[j])
if s > 85:c += 1
... | Traceback (most recent call last):
File "/tmp/tmpxnc_so0a/tmpgc44uwiv.py", line 3, in <module>
for _ in range(int(input())):
^^^^^^^
EOFError: EOF when reading a line
| |
s509432950 | p01306 | u724548524 | 1528858866 | Python | Python3 | py | Runtime Error | 0 | 0 | 836 | m = {"yotta":24, "zetta":21, "exa":18, "peta":15, "tera":12, "giga":9, "mega":6, "kilo":3, "hecto":2, "deca":1, "deci":-1, "centi":-2, "milli":-3, "micro":-6, "nano":-9, "pico":-12, "femto":-15, "ato":-18, "zepto":-21, "yocto":-24}
for _ in range(int(input())):
v, *b = input().split()
if len(b) == 2:
k,... | Traceback (most recent call last):
File "/tmp/tmp12t8dgs5/tmpdsr905d8.py", line 2, in <module>
for _ in range(int(input())):
^^^^^^^
EOFError: EOF when reading a line
| |
s738681870 | p01308 | u352394527 | 1545418277 | Python | Python3 | py | Runtime Error | 0 | 0 | 790 | dic = {"C":0, "C#":1, "D":2, "D#":3,
"E":4, "F":5, "F#":6, "G":7,
"G#":8, "A":9, "A#":10, "B":11}
t = int(input())
for _ in range(t):
n, m = map(int, input().split())
t_lst = [-100] + list(map(lambda x:dic[x],input().split()))
s_lst = list(map(lambda x:dic[x],input().split()))
s_lst.reverse()
... | Traceback (most recent call last):
File "/tmp/tmp5fo8p3h3/tmpmo2ksx0w.py", line 4, in <module>
t = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s274283675 | p01308 | u266872031 | 1435980102 | Python | Python | py | Runtime Error | 19920 | 8248 | 1295 |
def notetonum(notestr):
numlist=[]
nn=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"]
for c in notestr:
numlist.append(nn.index(c))
return numlist
Q=int(raw_input())
for q in range(Q):
[n,m]=[int(x) for x in raw_input().split()]
stairlist=notetonum(raw_input().split())
song... | File "/tmp/tmposgqoj85/tmprpr9a9_t.py", line 41
print "YES"
^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s578138117 | p01314 | u352394527 | 1531252104 | Python | Python3 | py | Runtime Error | 0 | 0 | 401 | #include <cstdio>
int main(void){
int n, i, j, cnt, tmp;
while(scanf("%d", &n)){
if(n == 0){
break;
}
cnt = 0;
for(i=1; i<n/2+1; i++){
for(j=i; j<n; j++){
tmp = (i + j) * (j - i + 1) / 2;
if(tmp == n){
cnt++;
break;
}
if(tmp > n){
... | File "/tmp/tmp3vgnmeu8/tmpxhjg8ed0.py", line 3
int main(void){
^^^^
SyntaxError: invalid syntax
| |
s666490564 | p01314 | u509775126 | 1529400222 | Python | Python3 | py | Runtime Error | 0 | 0 | 210 | while True:
n = int(input())
if n == 0:
break
c = 0
for i in range(2, 1001):
for a in range(1, 1001):
if i*a+(0.5*(i-1)*i) == n:
c += 1
print(c)
| Traceback (most recent call last):
File "/tmp/tmperec888o/tmp60sya8hz.py", line 2, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s449139744 | p01314 | u509775126 | 1529400832 | Python | Python3 | py | Runtime Error | 0 | 0 | 249 | while True:
try:
n = int(input())
except:
break
if n == 0:
break
c = 0
for i in range(2, 1001):
for a in range(1, 1001):
if i*a+(0.5*(i-1)*i) == n:
c += 1
print(c)
| ||
s914879601 | p01314 | u509775126 | 1529401353 | Python | Python3 | py | Runtime Error | 0 | 0 | 260 | while True:
try:
n = int(input())
except ValueError:
break
if n == 0:
break
c = 0
for i in range(2, 1001):
for a in range(1, 1001):
if i*a+(0.5*(i-1)*i) == n:
c += 1
print(c)
| Traceback (most recent call last):
File "/tmp/tmplh14o_i4/tmpu_xy85en.py", line 3, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s731952836 | p01314 | u136916346 | 1529981572 | Python | Python3 | py | Runtime Error | 0 | 0 | 219 | while 1:
n=int(input())
if not n:break
t=0
cnt=0
for i in range(2,n+1):
o=n//i
t+=(i-1)
p=n-(i*o-t)
if o+p//i+1-i<1:break
if p%i==0:cnt+=1
print cnt
| File "/tmp/tmp07h6aq5m/tmp6ecxd2ts.py", line 12
print cnt
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s965537061 | p01315 | u824193546 | 1503320935 | Python | Python3 | py | Runtime Error | 0 | 0 | 1024 | import numpy as np
import sys
def firster(former, latter):
com = [str(former), str(latter)]
com.sort()
#print(former)
#print(latter)
#print(com)
if com[0] == former:
return 1
return 0
def one_turn(N):
effs = [] #name
effs_val = {} #value
for i in range(N):
data = input().split()
period = 0
name = da... | Traceback (most recent call last):
File "/tmp/tmpdviiibvc/tmpt26ynwyn.py", line 46, in <module>
N = int(sys.stdin.readline())
^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s898835776 | p01316 | u731235119 | 1423240200 | Python | Python | py | Runtime Error | 19930 | 5088 | 498 | while 1:
N, M = map(int,raw_input().split(" "))
if M == N == 0 :
break
y0 = 128
C = [int(raw_input()) for _ in range(M)]
x = [int(raw_input()) for _ in range(N)]
dp = {y0:0}
for i in range(N):
tmpdp = dict()
for k,v in dp.iteritems():
for c in C:
if k + c > 255:
y = 255
elif k + c < 0:
... | File "/tmp/tmpbt6ed1vc/tmpvsomxzqj.py", line 23
print sorted(dp.values())[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s138518044 | p01316 | u731235119 | 1423289494 | Python | Python | py | Runtime Error | 19920 | 95072 | 554 | INF = float("inf")
while 1:
N, M = map(int,raw_input().split(" "))
if M == N == 0 :
break
y0 = 128
C = [int(raw_input()) for _ in range(M)]
x = [int(raw_input()) for _ in range(N)]
dp = [[INF for _ in range(256)] for _ in range(N+1)]
dp[0][128] = 0
for i in range(N):
for k in range(256):
v = dp[i][k]
... | File "/tmp/tmp0yjhr1sb/tmp0nm_xx5k.py", line 22
print sorted(dp[N])[0]
^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s455659395 | p01316 | u509278866 | 1528443190 | Python | Python3 | py | Runtime Error | 0 | 0 | 1207 | 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
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF... | Traceback (most recent call last):
File "/tmp/tmpri8cr7re/tmpmef44bd_.py", line 45, in <module>
print(main())
^^^^^^
File "/tmp/tmpri8cr7re/tmpmef44bd_.py", line 22, in main
n,m = LI()
^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s294437711 | p01316 | u855199458 | 1530192706 | Python | Python3 | py | Runtime Error | 0 | 0 | 698 | # -*- coding: utf-8 -*-
def inpl(): return list(map(int, input().split()))
def main():
N, M = inpl()
INF = 10**9
while N:
C = [int(input()) for _ in range(M)]
X = [int(input()) for _ in range(N)]
Y = [[INF]*256 for i in range(N+1)]
for i in range(256):
Y[0][... | Traceback (most recent call last):
File "/tmp/tmpeprp94ye/tmpswae176b.py", line 27, in <module>
main()
File "/tmp/tmpeprp94ye/tmpswae176b.py", line 5, in main
N, M = inpl()
^^^^^^
File "/tmp/tmpeprp94ye/tmpswae176b.py", line 2, in inpl
def inpl(): return list(map(int, input().split()))
... | |
s358240800 | p01316 | u779627195 | 1354704947 | Python | Python | py | Runtime Error | 19930 | 73220 | 1066 | import sys
R = lambda:map(int,raw_input().split())
yNum = 256
MAX_VAL = 10**6
while 1:
n,m = R()
if not (n or m): break
c = []
x = [128]
for i in xrange(m):
c.append(int(raw_input()))
for i in xrange(n):
x.append(int(raw_input()))
## sub = [[0 for j in xrange(yNum)] for i in x... | File "/tmp/tmp9dtsmltq/tmpaci0mrnk.py", line 30
print min(values[n])
^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s603762297 | p01317 | u266872031 | 1428164242 | Python | Python | py | Runtime Error | 19920 | 6720 | 2374 | while(1):
[N,M]=[int(x) for x in raw_input().split()]
if N==0:
break
else:
landr=[[99999999 for x in range(N+1)] for y in range(N+1)]
sear=[[99999999 for x in range(N+1)] for y in range(N+1)]
islandname1=[i for i in range(N+1)] #ex.[0,0,2,3,3]
islandname2=[[i] for i i... | File "/tmp/tmpm8b1a53j/tmpi0pb95kg.py", line 61
print ans[0][1]
^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s262743167 | p01317 | u266872031 | 1428168679 | Python | Python | py | Runtime Error | 19920 | 6732 | 2473 | while(1):
[N,M]=[int(x) for x in raw_input().split()]
if N==0:
break
else:
landr=[[99999999 for x in range(N+1)] for y in range(N+1)]
sear=[[99999999 for x in range(N+1)] for y in range(N+1)]
islandname1=[i for i in range(N+1)] #ex.[0,0,2,3,3]
islandname2=[[i] for i i... | File "/tmp/tmp3u2n1du0/tmpqgcjv1f5.py", line 63
print ans[0][1]
^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s080762166 | p01317 | u469154576 | 1501691224 | Python | Python3 | py | Runtime Error | 40000 | 10776 | 1717 | from queue import PriorityQueue
inf = 10**9
while True:
n, m = map(int, input().split())
if n == 0:
break
edgel = [[] for i in range(n)]
edges = [[] for i in range(n)]
for i in range(m):
x, y, t, sl = input().split()
x = int(x) - 1
y = int(y) - 1
t = int(t)
... | Traceback (most recent call last):
File "/tmp/tmp1q_fky4c/tmphnji9la4.py", line 4, in <module>
n, m = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s893255020 | p01317 | u469154576 | 1502476883 | Python | Python3 | py | Runtime Error | 0 | 0 | 2088 | inf = 10**9
dp = [[inf] * 200 for i in range(200)]
ldist = [[inf] * 200 for i in range(200)]
sdist = [[inf] * 200 for i in range(200)]
while True:
n, m = map(int, input().split())
if n == 0:
break
for i in range(n):
for j in range(n):
if i == j:
ldist[i][j] = sdis... | Traceback (most recent call last):
File "/tmp/tmp4n2safks/tmpw5l3vqdq.py", line 6, in <module>
n, m = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s542728166 | p01317 | u469154576 | 1502477069 | Python | Python3 | py | Runtime Error | 0 | 0 | 2052 | inf = 10**9
dp = [[inf] * 200 for i in range(200)]
ldist = [[inf] * 200 for i in range(200)]
sdist = [[inf] * 200 for i in range(200)]
while True:
n, m = map(int, input().split())
if n == 0:
break
for i in range(n):
for j in range(n):
if i == j:
ldist[i][j] = sdis... | Traceback (most recent call last):
File "/tmp/tmpgq3t2tiu/tmpaw272kva.py", line 6, in <module>
n, m = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s892620062 | p01317 | u469154576 | 1502477226 | Python | Python3 | py | Runtime Error | 0 | 0 | 2088 | inf = 10**9
dp = [[inf] * 210 for i in range(210)]
ldist = [[inf] * 210 for i in range(210)]
sdist = [[inf] * 210 for i in range(210)]
while True:
n, m = map(int, input().split())
if n == 0:
break
for i in range(n):
for j in range(n):
if i == j:
ldist[i][j] = sdis... | Traceback (most recent call last):
File "/tmp/tmpokfou0ne/tmpckis8mpy.py", line 6, in <module>
n, m = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s937344939 | p01317 | u469154576 | 1502502653 | Python | Python3 | py | Runtime Error | 40000 | 10720 | 2088 | inf = 10**9
dp = [[inf] * 210 for i in range(210)]
ldist = [[inf] * 210 for i in range(210)]
sdist = [[inf] * 210 for i in range(210)]
while True:
n, m = map(int, input().split())
if n == 0:
break
for i in range(n):
for j in range(n):
if i == j:
ldist[i][j] = sdis... | Traceback (most recent call last):
File "/tmp/tmpmk1g0fp0/tmpitn30bdf.py", line 6, in <module>
n, m = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s738947288 | p01317 | u469154576 | 1502506490 | Python | Python3 | py | Runtime Error | 40000 | 10780 | 1641 | inf = 10**9
dp = [[inf] * 210 for i in range(210)]
ldist = [[inf] * 210 for i in range(210)]
sdist = [[inf] * 210 for i in range(210)]
while True:
n, m = map(int, input().split())
if n == 0:
break
for i in range(n):
for j in range(n):
if i == j:
ldist[i][j] = sdist[i][j] = 0
else:
ldist[i][j] = sdi... | Traceback (most recent call last):
File "/tmp/tmpcmccigmr/tmp6uzcnurt.py", line 6, in <module>
n, m = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s245785168 | p01317 | u266872031 | 1530190602 | Python | Python3 | py | Runtime Error | 0 | 0 | 1318 | # -*- coding: utf-8 -*-
def wf(A,N):
for k in range(1,N+1):
for i in range(1,N+1):
for j in range(1,N+1):
if A[i][j] > A[i][k]+A[k][j]:
A[i][j] = A[i][k]+A[k][j]
if __name__=="__main__":
while(1):
N,M=map(int, input().split())
... | Traceback (most recent call last):
File "/tmp/tmpz0kumafk/tmpqf95b646.py", line 11, in <module>
N,M=map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s956023974 | p01321 | u647766105 | 1389864672 | Python | Python | py | Runtime Error | 0 | 0 | 1728 | def toBinary(block):
return [sum(1 << i for i,bb in enumerate(b) if bb == "#") for b in block]
def toStr(bfield):
return ["".join("." if f & (1<<i) == 0 else "#" for i in xrange(W)) for f in bfield]
def rotated(block):
return map(lambda x:"".join(x),zip(*[b[:] for b in block]))[::-1]
def striped(block):
... | File "/tmp/tmpc41copfr/tmp7npsiqhu.py", line 58
print ans if FLAG else -1
^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s917393934 | p01322 | u078042885 | 1486866335 | Python | Python3 | py | Runtime Error | 0 | 0 | 169 | while 1:
n,a,b=map(int,input().split())
if n==a==b==0:break
c=0;d=[1]*(n+1)
for x in range(a):
for i in range(x*b,n+1,a):d[i]=0
print(sum(d)) | Traceback (most recent call last):
File "/tmp/tmpfx2849x0/tmpjcvirbpa.py", line 2, in <module>
n,a,b=map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s328825772 | p01325 | u724548524 | 1528854456 | Python | Python3 | py | Runtime Error | 0 | 0 | 750 | while 1:
n = int(input())
if n == 0:break
an, bn = n, n
a, b = list(map(int, input().split())), list(map(int, input().split()))
while 1:
ad = []
for i in range(an):
if a[i] == bn:
ad.append(i)
for j in range(bn):b[j] -= 1
elif a... | Traceback (most recent call last):
File "/tmp/tmp18l7luhy/tmpnjaa2m8z.py", line 2, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s911288431 | p01325 | u724548524 | 1528856554 | Python | Python3 | py | Runtime Error | 0 | 0 | 789 | import bisect
while 1:
n = int(input())
if n == 0:break
a0, b0 = 0, 0
an, bn = n, n
p = (0, n, 0, n)
f = 1
a, b = list(sorted(map(int, input().split()))), list(sorted(map(int, input().split())))
if sum(a) != sum(b):print("No")
else:
while 1:
a0 = bisect.bisect_rig... | Traceback (most recent call last):
File "/tmp/tmptnpyragu/tmp_h1dbqm2.py", line 3, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s680164507 | p01329 | u352394527 | 1546025214 | Python | Python3 | py | Runtime Error | 0 | 0 | 2255 | from heapq import heappush, heappop
from collections import deque
def main():
while True:
n, m = map(int, input().split())
if n == 0:break
mp = ["#" * (m + 2)] + ["#" + input() + "#" for _ in range(n)] + ["#" * (m + 2)]
for y in range(1, n + 1):
for x in range(1, m + 1):
if mp[y][x] == ... | Traceback (most recent call last):
File "/tmp/tmp35lte71_/tmpkyb5nghj.py", line 69, in <module>
main()
File "/tmp/tmp35lte71_/tmpkyb5nghj.py", line 6, in main
n, m = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s010445846 | p01333 | u099826363 | 1529581211 | Python | Python3 | py | Runtime Error | 0 | 0 | 322 | A,B = input().split()
A = int(A)
B = int(B)
if A == 0:
return
oturi = B - A
B1 = 0
C5 = 0
C1 = 0
if oturi/1000 >= 1:
B1+= int(oturi/1000)
oturi = oturi-(B1*1000)
if oturi % 500 == 0:
oturi = int(oturi)
while oturi >= 500:
oturi-=500
C5+=1
while oturi > 0:
oturi-=100
C1+=1
print(C1,C5,B1... | File "/tmp/tmpk896d9dg/tmped8a_4tz.py", line 5
return
^^^^^^
SyntaxError: 'return' outside function
| |
s448210387 | p01333 | u099826363 | 1529581231 | Python | Python3 | py | Runtime Error | 0 | 0 | 322 | A,B = input().split()
A = int(A)
B = int(B)
if A == 0:
return
oturi = B - A
B1 = 0
C5 = 0
C1 = 0
if oturi/1000 >= 1:
B1+= int(oturi/1000)
oturi = oturi-(B1*1000)
if oturi % 500 == 0:
oturi = int(oturi)
while oturi >= 500:
oturi-=500
C5+=1
while oturi > 0:
oturi-=100
C1+=1
print(C1,C5,B1... | File "/tmp/tmpr0md4xdx/tmpdxdwsran.py", line 5
return
^^^^^^
SyntaxError: 'return' outside function
| |
s585293474 | p01333 | u099826363 | 1529581244 | Python | Python3 | py | Runtime Error | 0 | 0 | 324 | A,B = input().split()
A = int(A)
B = int(B)
if A == 0:
return 0
oturi = B - A
B1 = 0
C5 = 0
C1 = 0
if oturi/1000 >= 1:
B1+= int(oturi/1000)
oturi = oturi-(B1*1000)
if oturi % 500 == 0:
oturi = int(oturi)
while oturi >= 500:
oturi-=500
C5+=1
while oturi > 0:
oturi-=100
C1+=1
print(C1,C5,... | File "/tmp/tmpygkg31zn/tmp4fmou2sx.py", line 5
return 0
^^^^^^^^
SyntaxError: 'return' outside function
| |
s946735865 | p01336 | u266872031 | 1528596738 | Python | Python | py | Runtime Error | 0 | 0 | 991 | while(1):
try:
N,M=map( int,raw_input().split())
W=[[] for i in range(3)]
for i in range(N):
name=raw_input()
inp=map( int,raw_input().split())
c=inp[0]
for i in range(3):
W[i].append([c, inp[1+i]])
ans=0
for i ... | File "/tmp/tmp6lxr3_7p/tmptfr8q65y.py", line 33
print ans
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s867736311 | p01336 | u266872031 | 1528597405 | Python | Python | py | Runtime Error | 0 | 0 | 1061 | while(1):
try:
N,M=map( int,raw_input().split())
W=[[] for i in range(3)]
for i in range(N):
name=raw_input()
inp=map( int,raw_input().split())
c=inp[0]
for i in range(3):
W[i].append([c, inp[1+i]])
for i in range(3):
... | File "/tmp/tmplblt3alh/tmpiy9hoel3.py", line 33
print ans
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s306346574 | p01337 | u506537276 | 1559541255 | Python | Python3 | py | Runtime Error | 0 | 0 | 815 | import math
w1 = 1
w2 = 1/2 * (-1 + math.sqrt(3)*1j)
w3 = 1/2 * (-1 - math.sqrt(3)*1j)
n = int(input())
for i in range(n):
aa, bb, cc, dd = map(int, input().split())
a = bb / aa
b = cc / aa
c = dd / aa
p = -1/54 * (27 * c + 2 * (a ** 3) - 9 * a * b)
q = 1/9 * (3 * b - a ** 2)
r = 1/3 * a
x1 = w1 * ... | Traceback (most recent call last):
File "/tmp/tmpa67klxrz/tmp_xqcvctf.py", line 7, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s028153929 | p01337 | u506537276 | 1559541446 | Python | Python3 | py | Runtime Error | 0 | 0 | 815 | import math
w1 = 1
w2 = 1/2 * (-1 + math.sqrt(3)*1j)
w3 = 1/2 * (-1 - math.sqrt(3)*1j)
n = int(input())
for i in range(n):
aa, bb, cc, dd = map(int, input().split())
a = bb / aa
b = cc / aa
c = dd / aa
p = -1/54 * (27 * c + 2 * (a ** 3) - 9 * a * b)
q = 1/9 * (3 * b - a ** 2)
r = 1/3 * a
x1 = w1 * ... | Traceback (most recent call last):
File "/tmp/tmph8xs_d6_/tmpsaz43dnd.py", line 7, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s025118805 | p01339 | u572790226 | 1466496141 | Python | Python3 | py | Runtime Error | 0 | 0 | 433 | def combi(n):
if n == 1:
return [[1],[0]]
else:
s = combi(n-1)
ret = [[t] + x for x in s for t in [1, 0]]
return ret
N, M = map(int, input().split())
whole = combi(N)
for i in range(M):
select = []
s, d = map(int, input().split())
for c in whole:
if c[s-1] ... | Traceback (most recent call last):
File "/tmp/tmp58yttcwk/tmprec4ldgb.py", line 9, in <module>
N, M = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s246584653 | p01359 | u010611609 | 1558954675 | Python | Python3 | py | Runtime Error | 0 | 0 | 488 | from bisect import bisect_left
while True:
N, Q = map(int, input().split(' '))
if N == 0:
break
era = {} # Like {1877: ('Meiji', 10)}
years = [] # 西暦
for _ in range(N):
name, j, w = input().split(' ')
j, w = int(j), int(w)
era[w] = (name, j)
years.append(w)
years.sort()
for _ in range(Q):
q = in... | Traceback (most recent call last):
File "/tmp/tmpeodazm23/tmpez171vvw.py", line 5, in <module>
N, Q = map(int, input().split(' '))
^^^^^^^
EOFError: EOF when reading a line
| |
s002735211 | p01359 | u010611609 | 1558954686 | Python | Python3 | py | Runtime Error | 0 | 0 | 488 | from bisect import bisect_left
while True:
N, Q = map(int, input().split(' '))
if N == 0:
break
era = {} # Like {1877: ('Meiji', 10)}
years = [] # 西暦
for _ in range(N):
name, j, w = input().split(' ')
j, w = int(j), int(w)
era[w] = (name, j)
years.append(w)
years.sort()
for _ in range(Q):
q = in... | Traceback (most recent call last):
File "/tmp/tmpkh_rzf51/tmpb9b4kxnk.py", line 5, in <module>
N, Q = map(int, input().split(' '))
^^^^^^^
EOFError: EOF when reading a line
| |
s160327754 | p01359 | u010611609 | 1558954717 | Python | Python3 | py | Runtime Error | 0 | 0 | 488 | from bisect import bisect_left
while True:
N, Q = map(int, input().split(' '))
if N == 0:
break
era = {} # Like {1877: ('Meiji', 10)}
years = [] # 西暦
for _ in range(N):
name, j, w = input().split(' ')
j, w = int(j), int(w)
era[w] = (name, j)
years.append(w)
years.sort()
for _ in range(Q):
q = in... | Traceback (most recent call last):
File "/tmp/tmphr2yatu7/tmpqd0mb1lg.py", line 5, in <module>
N, Q = map(int, input().split(' '))
^^^^^^^
EOFError: EOF when reading a line
| |
s548488560 | p01359 | u633068244 | 1398929316 | Python | Python | py | Runtime Error | 0 | 0 | 365 | while 1:
n,m = map(int,raw_input().split())
if n == 0: break
E,B,Y = [],[],[]
for i in range(n):
era,base,year = raw_input().split()
E.append(era)
B.append(int(base))
Y.append(int(year))
for i in range(m):
year = int(raw_input())
for j in range(n):
if Y[j]-B[j] < year <= Y[j]:
print E[i], year-Y... | File "/tmp/tmpn578useb/tmpns05bmsh.py", line 14
print E[i], year-Y[j]+B[i]
^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s095476133 | p01359 | u633068244 | 1398929360 | Python | Python | py | Runtime Error | 0 | 0 | 365 | while 1:
n,m = map(int,raw_input().split())
if n == 0: break
E,B,Y = [],[],[]
for i in range(n):
era,base,year = raw_input().split()
E.append(era)
B.append(int(base))
Y.append(int(year))
for i in range(m):
year = int(raw_input())
for j in range(n):
if Y[j]-B[j] < year <= Y[j]:
print E[i], year-Y... | File "/tmp/tmpm2drev9f/tmpfeu_yqsa.py", line 14
print E[i], year-Y[j]+B[j]
^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s494068016 | p01360 | u509278866 | 1528687171 | Python | Python3 | py | Runtime Error | 0 | 0 | 1695 | 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/tmpww_pk20g/tmpgh21bade.py", line 70, in <module>
print(main())
^^^^^^
File "/tmp/tmpww_pk20g/tmpgh21bade.py", line 24, in main
s = S()
^^^
File "/tmp/tmpww_pk20g/tmpgh21bade.py", line 16, in S
def S(): return input()
... | |
s229146165 | p01369 | u352394527 | 1531260054 | Python | Python3 | py | Runtime Error | 0 | 0 | 545 | #include <iostream>
using namespace std;
int main(void){
string s, left;
int pos, tmp, cnt, i;
left = "qwertasdfgzxcvb";
while(1){
cin >> s;
if(s == "#"){
break;
}
if(left.find(s[0]) != std::string::npos){
pos = 0;
}else{
pos = 1;
}
cnt = 0;
for(i=1;i<s.length(... | File "/tmp/tmp7um0lwh5/tmpu9eurmh9.py", line 2
using namespace std;
^^^^^^^^^
SyntaxError: invalid syntax
| |
s427617304 | p01369 | u910106747 | 1497695535 | Python | Python | py | Runtime Error | 0 | 0 | 459 |
def solve(s):
dic = {}
ll = 'qwertasdfgzxcvb'
rr = 'yuiophjklnm'
for l_i in list(ll):
dic[l_i] = -1
for r_i in list(rr):
dic[r_i] = 1
ans = 0
prev = 0
for s_i in s:
current = dic[s_i]
if current != prev:
if abs(current - prev) == 2:
... | Traceback (most recent call last):
File "/tmp/tmpmzdgdvoq/tmp8e08jf7x.py", line 30, in <module>
s = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s112054116 | p01369 | u412356196 | 1505819596 | Python | Python | py | Runtime Error | 0 | 0 | 869 | using System;
using System.Collections.Generic;
class Program
{
static void Main(string[] args)
{
HashSet<char> s = new HashSet<char> { };
string yukio = "yuiophjklnm";
for (int i = 0; i < yukio.Length; i++)
{
s.Add(yukio[i]);
}
while (true)
{
... | File "/tmp/tmpj71_c6iv/tmp4yi14qti.py", line 1
using System;
^^^^^^
SyntaxError: invalid syntax
| |
s108190563 | p01370 | u633068244 | 1422281817 | Python | Python | py | Runtime Error | 19920 | 4604 | 599 | while 1:
t,n = map(int,raw_input().split())
if t == n == 0: break
block = [map(int,raw_input().split()) for _ in range(n)]
sx,sy = map(int,raw_input().split())
visited = []
visited.append([sx,sy])
que = [[sx,sy,t]]
ans = 1
while que:
x,y,tt = que.pop(0)
if tt == 0: co... | File "/tmp/tmptdnd4vng/tmpl10re4fk.py", line 19
print ans
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s839353510 | p01370 | u617183767 | 1424151118 | Python | Python | py | Runtime Error | 19930 | 75532 | 1174 | #! /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):
pass
def solve(self):
'''
insert your code
'''
while True:
t, n = map(... | File "/tmp/tmplht7sifu/tmpuuj4982f.py", line 40
print len(visited)
^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s726726705 | p01370 | u316268279 | 1426010217 | Python | Python3 | py | Runtime Error | 0 | 0 | 920 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import heapq as hq
def bfs(x,y,t,Map,depth):
queue = [(depth,(x,y))]
while len(queue) != 0:
p = hq.heappop(queue)
x,y = p[1]
if p[0] < t and Map[y][x] == 0:
Map[y][x] = 1
dxdy = [(1,0),(-1,0),(0,1),(0,-1),(1,1... | Traceback (most recent call last):
File "/tmp/tmpwgvagnyq/tmpqhj50al3.py", line 18, in <module>
t,n = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s590621074 | p01370 | u316268279 | 1426010327 | Python | Python3 | py | Runtime Error | 0 | 0 | 894 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import heapq as hq
def bfs(x,y,t,Map,depth):
queue = [(depth,(x,y))]
while len(queue) != 0:
p = hq.heappop(queue)
x,y = p[1]
if p[0] < t and Map[y][x] == 0:
Map[y][x] = 1
dxdy = [(1,0),(-1,0),(0,1),(0,-1),(1,1),(-1,-1... | Traceback (most recent call last):
File "/tmp/tmps42sren9/tmpoxv34knv.py", line 18, in <module>
t,n = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s771206258 | p01370 | u120360464 | 1434962263 | Python | Python | py | Runtime Error | 0 | 0 | 829 | #! /usr/bin/python
# -*- coding: utf-8 -*-
(t, n) = map(int, raw_input().split())
while t != 0 or n != 0:
M = [[False]*100 for i in range(100)]
for i in range(n):
(obx, oby) = map(int, raw_input().split())
M[oby+50][obx+50] = True
(sx, sy) = map(int, raw_input().split())
ST = [] #0:y 1:... | File "/tmp/tmpzpsgphcj/tmpuez92sbx.py", line 28
print cnt
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s286229144 | p01370 | u120360464 | 1434962300 | Python | Python | py | Runtime Error | 0 | 0 | 829 | #! /usr/bin/python
# -*- coding: utf-8 -*-
(t, n) = map(int, raw_input().split())
while t != 0 or n != 0:
M = [[False]*100 for i in range(100)]
for i in range(n):
(obx, oby) = map(int, raw_input().split())
M[oby+50][obx+50] = True
(sx, sy) = map(int, raw_input().split())
ST = [] #0:y 1:... | File "/tmp/tmpyui8gnla/tmpuojpfdr1.py", line 28
print cnt
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s036616488 | p01370 | u120360464 | 1434962430 | Python | Python | py | Runtime Error | 0 | 0 | 856 | #! /usr/bin/python
# -*- coding: utf-8 -*-
(t, n) = map(int, raw_input().split())
while t != 0 or n != 0:
M = [[False]*100 for i in range(100)]
for i in range(n):
(obx, oby) = map(int, raw_input().split())
M[oby+50][obx+50] = True
(sx, sy) = map(int, raw_input().split())
ST = [] #0:y 1:... | File "/tmp/tmprijtbvqq/tmp0u2licpt.py", line 28
print cnt
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s681857036 | p01371 | u731235119 | 1423155828 | Python | Python | py | Runtime Error | 19920 | 15600 | 694 | while 1:
N = int(raw_input())
if N == 0: break
stage = set(range(1,N+1))
time = [None] + [map(int,raw_input().split(" ")) for _ in range(N)]
dp = dict([[tuple([i]),time[i][0]] for i in range(1,N+1)])
count = 1
while count < N:
tmp_dp = dict()
for k, v in dp.iteritems():
cleared = set(k)
for st in stage... | File "/tmp/tmpr914n67h/tmp7pygvo76.py", line 22
print dp[tuple(sorted(stage))]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s129883039 | p01371 | u731235119 | 1423196071 | Python | Python | py | Runtime Error | 19930 | 9340 | 515 | INF = float("inf")
while 1:
N = int(raw_input())
if N == 0: break
time = [map(int,raw_input().split(" ")) for _ in range(N)]
dp = [INF for i in range(2**N)]
dp[0] = 0
for cleared in range(2**N):
for i in range(0,N):
now = 2 ** i
if now & cleared != 0:
continue
tmp_time = time[i][0]
for j in rang... | File "/tmp/tmpb_9mfd2x/tmpi7bscfix.py", line 20
print dp[2**N-1]
^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s132813653 | p01371 | u633068244 | 1424356118 | Python | Python | py | Runtime Error | 0 | 0 | 964 | #include <iostream>
#include <algorithm>
#include <string.h>
#include <stdio.h>
#define REP(i,a,b) for (int i = (a); i < (b); i++)
#define rep(i,a) REP(i,0,a)
using namespace std;
const int INF = 1 << 28;
int sp, N;
int t[16][17];
int dp[1 << 16][16];
int rec(int S, int v) {
if (dp[S][v] > 0) return dp[S][v];
... | File "/tmp/tmp_spfrt7y/tmpe25vg1u1.py", line 7
using namespace std;
^^^^^^^^^
SyntaxError: invalid syntax
| |
s340427608 | p01371 | u981364540 | 1471355446 | Python | Python3 | py | Runtime Error | 40000 | 10748 | 507 | import sys
while 1:
N = int(input())
if N == 0 : break
t = [list(map(int, input().split())) for i in range(N)]
dp = [sys.maxsize]*(1<<N)
dp[0] = 0
for i in range(1<<N):
for j in range(N):
if (i & (1<<j)) != 0: continue
cost = t[j][0]
for k in range(N):... | Traceback (most recent call last):
File "/tmp/tmpw1m0ps0l/tmp0_ue6jxy.py", line 3, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s311897101 | p01371 | u981364540 | 1471355873 | Python | Python3 | py | Runtime Error | 40000 | 10692 | 507 | import sys
while 1:
N = int(input())
if N == 0 : break
t = [list(map(int, input().split())) for i in range(N)]
dp = [sys.maxsize]*(1<<N)
dp[0] = 0
for i in range(1<<N):
for j in range(N):
if (i & (1<<j)) != 0: continue
cost = t[j][0]
for k in range(N):... | Traceback (most recent call last):
File "/tmp/tmp1mub7tql/tmp6_8lojg3.py", line 3, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s942287952 | p01371 | u981364540 | 1471356327 | Python | Python3 | py | Runtime Error | 40000 | 10860 | 512 | import sys
while 1:
N = int(input())
if N == 0 : sys.exit()
t = [list(map(int, input().split())) for i in range(N)]
dp = [sys.maxsize]*(1<<N)
dp[0] = 0
for i in range(1<<N):
for j in range(N):
if (i & (1<<j)) != 0: continue
cost = t[j][0]
for k in rang... | Traceback (most recent call last):
File "/tmp/tmp2u0hs9qs/tmppifxnjew.py", line 3, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s455211174 | p01371 | u981364540 | 1471356440 | Python | Python3 | py | Runtime Error | 40000 | 10696 | 507 | import sys
while 1:
N = int(input())
if N == 0 : sys.exit()
t = [list(map(int, input().split())) for i in range(N)]
dp = [500000]*(1<<N)
dp[0] = 0
for i in range(1<<N):
for j in range(N):
if (i & (1<<j)) != 0: continue
cost = t[j][0]
for k in range(N):... | Traceback (most recent call last):
File "/tmp/tmpqrqh8o0s/tmpx79zllty.py", line 3, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s159442751 | p01371 | u981364540 | 1471356979 | Python | Python3 | py | Runtime Error | 40000 | 10700 | 515 | import sys
while True:
N = int(input())
if N == 0 : sys.exit()
t = [list(map(int, input().split())) for i in range(N)]
dp = [sys.maxsize]*(1<<N)
dp[0] = 0
for i in range(1<<N):
for j in range(N):
if (i & (1<<j)) != 0: continue
cost = t[j][0]
for k in r... | Traceback (most recent call last):
File "/tmp/tmp9hm6z05a/tmpmua_u38n.py", line 3, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s687571056 | p01371 | u685815919 | 1474616666 | Python | Python | py | Runtime Error | 40000 | 8488 | 727 | import sys
def bitdp(N, costs):
dp = [sys.maxint] * 2**N
dp[0] = 0
# min cost of state i is calcurated by minimum of
# before state i-2**k + cost of minimum for clear k
for i in xrange(1, 2 ** N):
for k in xrange(N):
if i & 2**k > 0:
mincost = costs[k][0]
for x in xrange(0, N):
... | File "/tmp/tmpc2uxkj6e/tmplj4h4pne.py", line 16
print dp[2**N-1]
^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s647109603 | p01371 | u672443148 | 1515145101 | Python | Python3 | py | Runtime Error | 0 | 0 | 912 | while True:
N=int(input())
if N==0:
break
stage=[]
for i in range(N):
stage.append(list(map(int,input().split())))
INF=int(1e8)
dp=[INF for i in range(1<<N)]
dp[0]=0
for bit in range(1<<N): #ステージのクリア状況分だけループを回す
for i in range(N):
if bit & 1<... | Traceback (most recent call last):
File "/tmp/tmpv0bt77v2/tmpf8cqdvb2.py", line 2, in <module>
N=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s503495011 | p01371 | u855199458 | 1530101847 | Python | Python3 | py | Runtime Error | 0 | 0 | 777 | # -*- coding: utf-8 -*-
from itertools import combinations
N = int(input())
while N:
T = []
B = []
for i in range(N):
base, *other = list(map(int, input().split()))
B.append(base)
T.append(other)
cost = [10**7]*(2**N)
X = [2**i for i in range(N)]
for i, x in enumerate(X)... | Traceback (most recent call last):
File "/tmp/tmp3osnyrzw/tmp0_fvp0ud.py", line 3, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s081314435 | p01371 | u352394527 | 1530574783 | Python | Python3 | py | Runtime Error | 0 | 0 | 695 | INF = 10 ** 20
def minimum_cost(now, visited):
if (now, visited) in dp:
return dp[(now, visited)]
if visited == end:
return 0
ret = INF
for to in range(1, n + 1):
if to not in visited:
ret = min(ret, minimum_cost(to, tuple(sorted(list(visited) + [to]))) + cost(to, visited))
dp[(now, visi... | Traceback (most recent call last):
File "/tmp/tmp5sl912mj/tmpdnjz0gj7.py", line 20, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s748093039 | p01371 | u352394527 | 1530580014 | Python | Python3 | py | Runtime Error | 0 | 0 | 769 | INF = 10 ** 20
def minimum_cost(rest, dp, tlst, end, n):
if rest in dp:
return dp[rest]
if rest == end:
return 0
ret = INF
for ind, to in enumerate(rest):
if to == "0":
tmp = minimum_cost(rest[:ind] + "1" + rest[ind + 1:], dp, tlst, end, n) + cost(ind, rest, tlst, n)
if tmp < ret:
... | Traceback (most recent call last):
File "/tmp/tmprbagubnv/tmpvfiypepq.py", line 38, in <module>
main()
File "/tmp/tmprbagubnv/tmpvfiypepq.py", line 29, in main
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s685313398 | p01371 | u109084363 | 1361955394 | Python | Python | py | Runtime Error | 19930 | 4616 | 718 | import sys
import collections
while True:
N = int(raw_input())
if N == 0:
break
time = []
for i in xrange(N):
time.append(map(int, raw_input().split()))
def dp(state):
L = len(state)
if L <= 1:
return time[state[0]][0]
else:
temp ... | File "/tmp/tmp36rmqfge/tmp94mnac7l.py", line 28
print dp(state)
^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s960730773 | p01371 | u109084363 | 1361955533 | Python | Python | py | Runtime Error | 19930 | 4252 | 516 | import sys
while True:
N = int(raw_input())
if N == 0:
break
time = []
for i in xrange(N):
time.append(map(int, raw_input().split()))
def dp(state):
L = len(state)
if L <= 1:
return time[state[0]][0]
else:
temp = []
for i in state:
copy = state[:]
copy.remove(i)
min_time = time[i]... | File "/tmp/tmp_96_z15y/tmprllcw3w0.py", line 27
print dp(state)
^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.