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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s026578627 | p00155 | u811733736 | 1506924940 | Python | Python3 | py | Runtime Error | 0 | 0 | 2862 | # -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0155
"""
import sys
from sys import stdin
from math import sqrt
input = stdin.readline
def dijkstra(s, G):
BLACK, GRAY, WHITE = 0, 1, 2
d = [float('inf')] * 101
color = [WHITE] * 101
p = [-1] * 101
d[s] = 0
... | Traceback (most recent call last):
File "/tmp/tmpc8woibn7/tmppo019r5i.py", line 100, in <module>
main(sys.argv[1:])
File "/tmp/tmpc8woibn7/tmppo019r5i.py", line 41, in main
n = int(input())
^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s045262120 | p00155 | u811733736 | 1506925034 | Python | Python3 | py | Runtime Error | 0 | 0 | 2894 | # -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0155
"""
import sys
from sys import stdin
from math import sqrt
input = stdin.readline
def dijkstra(s, G):
BLACK, GRAY, WHITE = 0, 1, 2
d = [float('inf')] * 101
color = [WHITE] * 101
p = [-1] * 101
d[s] = 0
... | Traceback (most recent call last):
File "/tmp/tmp2t_bdzoo/tmpt50phx24.py", line 100, in <module>
main2(sys.argv[1:])
File "/tmp/tmp2t_bdzoo/tmpt50phx24.py", line 86, in main2
n = int(input())
^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s987250826 | p00155 | u104911888 | 1383702004 | Python | Python | py | Runtime Error | 0 | 0 | 1423 | import math
def routing(s,g,route):
ans=[]
i=g
while i!=-1:
ans.append(i+1)
i=route[i]
return ans[::-1]
inf=100000
while True:
n=input()
if n==0:break
L=[[inf]*n for i in range(n)]
for i in range(n):
L[i][i]=0
B=[map(int,raw_input().split()) for i in range(n... | File "/tmp/tmpmmkw9y1x/tmpqcfhl9e0.py", line 53
print 'NA'
^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s333288345 | p00155 | u104911888 | 1383702186 | Python | Python | py | Runtime Error | 0 | 0 | 1408 | import math
def routing(s,g,route):
ans=[]
i=g
while i!=-1:
ans.append(i+1)
i=route[i]
return ans[::-1]
inf=100000
while True:
n=input()
if n==0:break
L=[[inf]*n for i in range(n)]
for i in range(n):
L[i][i]=0
B=[map(int,raw_input().split()) for i in range(n... | File "/tmp/tmpvi8qptfg/tmph8esftdf.py", line 53
print 'NA'
^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s595125554 | p00155 | u104911888 | 1383702225 | Python | Python | py | Runtime Error | 0 | 0 | 1289 | import math
def routing(s,g,route):
ans=[]
i=g
while i!=-1:
ans.append(i+1)
i=route[i]
return ans[::-1]
inf=100000
while True:
n=input()
if n==0:break
L=[[inf]*n for i in range(n)]
for i in range(n):
L[i][i]=0
B=[map(int,raw_input().split()) for i in range(n... | File "/tmp/tmp4j11b78a/tmps3fwh0xy.py", line 52
print 'NA'
^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s890769388 | p00158 | u912237403 | 1419626644 | Python | Python | py | Runtime Error | 0 | 0 | 142 | d = {}
while 1:
n = int(raw_input())
if n==0: break
c = 0
while n != 1
if n % 2 ==0: n/=2
else: n = n*3+1
c += 1
print c | File "/tmp/tmp1xcuds3a/tmpgrxdqqng.py", line 6
while n != 1
^
SyntaxError: expected ':'
| |
s223242999 | p00158 | u260980560 | 1385146636 | Python | Python | py | Runtime Error | 0 | 0 | 219 | M = 10**6; dp = [-1]*M; dp[0],dp[1] = 0,0;
def collatz(n):
if dp[n]!=-1: return dp[n]
dp[n] = 1+collatz(n/2 if n%2==0 else 3*n+1)
return dp[n]
while 1:
n = input()
if n==0: break
print collatz(n) | File "/tmp/tmpa5olbwxo/tmpskv6agxx.py", line 9
print collatz(n)
^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s285140021 | p00160 | u647766105 | 1384837225 | Python | Python | py | Runtime Error | 0 | 0 | 285 | from bisect import bisect,bisect_left
from fractions import gcd
MAXN = 1000002
T = 2**20*3**14*5**9
H = filter(lambda i:gcd(T,i)==i,xrange(MAXN))
while True:
line = raw_input()
if line == "0":
break
m,n = map(int,line.split())
print bisect(H,n)-bisect_left(H,m) | File "/tmp/tmpn_ntjh9w/tmpm02yt7xz.py", line 11
print bisect(H,n)-bisect_left(H,m)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s699499813 | p00161 | u260980560 | 1501214164 | Python | Python3 | py | Runtime Error | 0 | 0 | 294 | while 1:
n = int(input())
team = []
for _ in range(n):
i, *T = map(int, input().split())
t = 0
for m, s in zip(T[::2], T[1::2]):
t += m*60 + s
team.append((t, i))
team.sort()
print(*[team[0][1], team[1][1], team[-2][1]], sep='\n') | Traceback (most recent call last):
File "/tmp/tmp3cq6_ck0/tmpzkjwezd2.py", line 2, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s211863390 | p00161 | u260980560 | 1501214379 | Python | Python3 | py | Runtime Error | 0 | 0 | 301 | while 1:
n = int(input())
team = []
for _ in range(n):
i, *T = map(int, input().split())
t = 0
for m, s in zip(T[::2], T[1::2]):
t += m*60 + s
team.append((t, i))
team.sort()
print(team[0][1])
print(team[1][1])
print(team[-2][1]) | Traceback (most recent call last):
File "/tmp/tmp_ytsja9c/tmpiix2y0vb.py", line 2, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s139951710 | p00162 | u260980560 | 1385147655 | Python | Python | py | Runtime Error | 0 | 0 | 313 | num = [2,3,5]
M = 10**6; S = [0]*(M+2); S[1] = 1; s = 0;
for i in xrange(1,M+1):
if S[i]==1:
for j in xrange(3):
S[min(M+1,num[j]*i)] = 1;
s += 1
S[i] = s
while 1:
try:
m,n = map(int, raw_input().split())
print S[n]-S[m-1]
except EOFError:
break | File "/tmp/tmpr8rc3jbl/tmp9vv_yhdm.py", line 12
print S[n]-S[m-1]
^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s148130881 | p00162 | u260980560 | 1385147748 | Python | Python | py | Runtime Error | 0 | 0 | 319 | num = [2,3,5]
M = 10**6; S = [0]*(M+2); S[1] = 1; s = 0;
i = 0;
while(i<M+1):
if S[i]==1:
for j in xrange(3):
S[min(M+1,num[j]*i)] = 1;
s += 1
S[i] = s
i+=1
while 1:
try:
m,n = map(int, raw_input().split())
print S[n]-S[m-1]
except EOFError:
break | File "/tmp/tmpqnpj__6o/tmpum0wjyyl.py", line 14
print S[n]-S[m-1]
^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s326372692 | p00162 | u260980560 | 1385148058 | Python | Python | py | Runtime Error | 0 | 0 | 419 | while 1:
try:
n,m = map(int, raw_input().split())
ans = 0
for i in xrange(n,m+1):
p = i
while p>1:
if p%2==0:
p/=2
elif p%3==0:
p/=3
elif p%5==0:
p/=5
... | File "/tmp/tmpqxxuduln/tmpzt9db8tl.py", line 16
print ans
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s404310881 | p00166 | u104911888 | 1369179772 | Python | Python | py | Runtime Error | 0 | 0 | 550 | import math
def inputData(j):
A=[]
t=0
for i in range(j-1):
v=input()
x=math.cos(math.pi*(v+t)/180)
y=math.sin(math.pi*(v+t)/180)
t+=v
A.append((x,y))
A.append(A[0])
return A
def calcArea(A):
return sum((A[i][0]-A[i+1][0])*(A[i][1]+A[i+1][1]) for i in ra... | File "/tmp/tmp9ro2h1a4/tmpcmaxjvg3.py", line 26
print 1
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s915343937 | p00167 | u146816547 | 1506517972 | Python | Python | py | Runtime Error | 0 | 0 | 442 | def bubble_sort(A, N):
flag = True
c = 0
i = 0
while flag:
flag = False
for j in range(N-1, i, -1):
if A[j] < A[j-1]:
A[j], A[j-1] = A[j-1], A[j]
c += 1
flag = True
i += 1
return c
while True:
N = int(raw_in... | File "/tmp/tmp20hstsys/tmp8kj8ve8q.py", line 24
A = [map(int, raw_input()) _ for i in range(N)]
^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: invalid syntax. Perhaps you forgot a comma?
| |
s839863011 | p00168 | u797636303 | 1559025029 | Python | Python3 | py | Runtime Error | 0 | 0 | 345 | def fib(n):
n=int(n)
F=[1,1,2]
if n>=3:
for j in range(2,n):
F.append(F[j-2]+F[j-1]+F[j])
return F[n]
for i in range(32):
a=input(int())
if a==0:
break
else:
print(-((-fib(a)//10)//365))
#https://python.ms/sub/misc/division/... | Traceback (most recent call last):
File "/tmp/tmp_56shxgk/tmpdie2h2l0.py", line 10, in <module>
a=input(int())
^^^^^^^^^^^^
EOFError: EOF when reading a line
| 0 |
s786118654 | p00168 | u797636303 | 1559025083 | Python | Python3 | py | Runtime Error | 0 | 0 | 345 | def fib(n):
n=int(n)
F=[1,1,2]
if n>=3:
for j in range(2,n):
F.append(F[j-2]+F[j-1]+F[j])
return F[n]
for i in range(32):
a=input(int())
if a==0:
break
else:
print(-((-fib(a)//10)//365))
#https://python.ms/sub/misc/division/... | Traceback (most recent call last):
File "/tmp/tmpuyvnsc5l/tmpgmtonsau.py", line 10, in <module>
a=input(int())
^^^^^^^^^^^^
EOFError: EOF when reading a line
| 0 |
s238126588 | p00168 | u797636303 | 1559025358 | Python | Python3 | py | Runtime Error | 0 | 0 | 233 | def fib(n):
n=int(n)
F=[1,1,2]
if n>=3:
for j in range(2,n):
F.append(F[j-2]+F[j-1]+F[j])
return F[n]
a=input(int())
if a==0:
break
else:
print(-((-fib(a)//10)//365))
| File "/tmp/tmpbgdexduw/tmp7g3rid6p.py", line 11
break
^^^^^
SyntaxError: 'break' outside loop
| |
s865591012 | p00168 | u797636303 | 1559025410 | Python | Python3 | py | Runtime Error | 0 | 0 | 203 | def fib(n):
n=int(n)
F=[1,1,2]
if n>=3:
for j in range(2,n):
F.append(F[j-2]+F[j-1]+F[j])
return F[n]
a=input(int())
print(-((-fib(a)//10)//365))
| File "/tmp/tmppbssujrr/tmplpsocilx.py", line 10
print(-((-fib(a)//10)//365))
IndentationError: unexpected indent
| |
s767178206 | p00168 | u529386725 | 1452334286 | Python | Python | py | Runtime Error | 0 | 0 | 244 | #???????????\?????¨??????????????????????????°???
a = [1, 2, 4]
MAX_N = 30
for i in xrange(3, MAX_N+1):
a.append(a[i-3] + a[i-2] + a[i-1])
while True:
n = input()
if n == 0:
break
else:
print a[n-1] / 3650 + 1 | File "/tmp/tmpl_3nfv0c/tmplkofc5vw.py", line 12
print a[n-1] / 3650 + 1
^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s001319494 | p00168 | u947762778 | 1508165052 | Python | Python3 | py | Runtime Error | 0 | 0 | 283 | a = []
a[:4] = [0, 1, 2, 3]
inList = []
while True:
price = int(input())
if price == 0:
break
inList.append(int(input()))
n = max(inList)
for i in range(4, n + 1):
a[i] = a[i-1] + a[i-2] + a[i-3]
for i in inList:
print((a[i] // 3650) + (a[i] % 3650 != 0)) | Traceback (most recent call last):
File "/tmp/tmp_07ybtup/tmpz29aa6_s.py", line 5, in <module>
price = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s320683718 | p00168 | u947762778 | 1508165114 | Python | Python3 | py | Runtime Error | 0 | 0 | 264 | a = []
a[:4] = [0, 1, 2, 3]
inList = []
while True:
n = int(input())
if n == 0:
break
inList.append(n)
n = max(inList)
for i in range(4, n + 1):
a[i] = a[i-1] + a[i-2] + a[i-3]
for i in inList:
print((a[i] // 3650) + (a[i] % 3650 != 0)) | Traceback (most recent call last):
File "/tmp/tmp69vm5n4m/tmpazeyf0i5.py", line 5, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s635233445 | p00168 | u584093205 | 1526879768 | Python | Python3 | py | Runtime Error | 0 | 0 | 262 | while 1:
n = int(input())
if n == 0:break
A = [1 for _ in range(30)]
for i in range(1, n + 1):
A[i] = A[i - 1]
if i > 1:
A[i] += A[i - 2]
if i > 2:
A[i] += A[i - 3]
print(A[n] // 3650 + 1)
| Traceback (most recent call last):
File "/tmp/tmpl8l32ki9/tmplinj7ygo.py", line 2, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s033762781 | p00168 | u584093205 | 1526879809 | Python | Python3 | py | Runtime Error | 0 | 0 | 262 | while 1:
n = int(input())
if n == 0:break
A = [1 for _ in range(30)]
for i in range(1, n + 1):
A[i] = A[i - 1]
if i > 1:
A[i] += A[i - 2]
if i > 2:
A[i] += A[i - 3]
print(A[n] // 3650 + 1)
| Traceback (most recent call last):
File "/tmp/tmp8d62fevy/tmptnw_xcsk.py", line 2, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s393501780 | p00168 | u584093205 | 1526879874 | Python | Python3 | py | Runtime Error | 0 | 0 | 262 | while 1:
n = int(input())
if n == 0:break
A = [1 for _ in range(30)]
for i in range(1, n + 1):
A[i] = A[i - 1]
if i > 1:
A[i] += A[i - 2]
if i > 2:
A[i] += A[i - 3]
print(A[n] // 3650 + 1)
| Traceback (most recent call last):
File "/tmp/tmp1ptj46or/tmpgr3ptt5m.py", line 2, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s538829562 | p00168 | u977698428 | 1397477533 | Python | Python | py | Runtime Error | 0 | 0 | 591 | #coding:utf-8
from __future__ import division,print_function
try:
input = raw_input
except NameError:
pass
# 上記のコードはPython2とPython3の違いを一部吸収するためのもの
memo=[0]*31
def solve(x):
if memo[x]==0:
if x>1:
memo[x]=solve(x-1)+solve(x-2)+solve(x-3)
return memo[x]
elif x==0:
... | Traceback (most recent call last):
File "/tmp/tmppgwrn1q_/tmphta1u1lu.py", line 29, in <module>
main()
File "/tmp/tmppgwrn1q_/tmphta1u1lu.py", line 24, in main
inp=input()
^^^^^^^
EOFError: EOF when reading a line
| |
s773879893 | p00168 | u708217907 | 1398743414 | Python | Python | py | Runtime Error | 0 | 0 | 202 | import sys, math
step = [1,1,2,4] + [0]*26
for i in range(4,30):
step[i] = step[i-1] + step[i-2] + step[i-3]
for s in sys.stdin:
n = int(s)
if n == 0: break
print int(math.ceil(step[n]/3650.0)) | File "/tmp/tmpq6784tke/tmp6qrqj_g8.py", line 9
print int(math.ceil(step[n]/3650.0))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s282302819 | p00168 | u708217907 | 1398743537 | Python | Python | py | Runtime Error | 0 | 0 | 202 | import sys, math
step = [1,1,2,4] + [0]*26
for i in range(4,31):
step[i] = step[i-1] + step[i-2] + step[i-3]
for s in sys.stdin:
n = int(s)
if n == 0: break
print int(math.ceil(step[n]/3650.0)) | File "/tmp/tmp9bug5_62/tmpe6bvez9u.py", line 9
print int(math.ceil(step[n]/3650.0))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s117989403 | p00168 | u708217907 | 1398743699 | Python | Python | py | Runtime Error | 0 | 0 | 189 | import math
step = [1,1,2,4] + [0]*27
for i in range(4,31):
step[i] = step[i-1] + step[i-2] + step[i-3]
while True:
n = int(s)
if n == 0: break
print int(math.ceil(step[n]/3650.0)) | File "/tmp/tmpt8wgb0qy/tmprfza8gws.py", line 9
print int(math.ceil(step[n]/3650.0))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s797068263 | p00170 | u633068244 | 1397901833 | Python | Python | py | Runtime Error | 0 | 0 | 608 | import itertools
def isOK(array):
for i in range(n-1):
if int(array[i][2])<sum([int(array[i][1]) for x in range(i+1,n)]):
return False
return G(array)
def G(array):
nume=sum([(i+1)*int(array[i][1]) for i in range(n)])*1.0
denomi=sum([int(array[i][1]) for i in range(n)])
return nume/denomi
while 1:
n=inpu... | File "/tmp/tmpu5snnvac/tmp1rpjooyv.py", line 20
print order
^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s535900571 | p00173 | u460331583 | 1346394685 | Python | Python | py | Runtime Error | 0 | 4956 | 148 | while True:
try:
a,b,c = map(str,raw_input().split())
b,c=a[1],a[2]
print "%s %d %d" %(a,b+c,200*b+300+c)
except EOFError:
break | File "/tmp/tmp8i2jsi4g/tmpgx_it052.py", line 5
print "%s %d %d" %(a,b+c,200*b+300+c)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s986562024 | p00173 | u460331583 | 1346394930 | Python | Python | py | Runtime Error | 0 | 4956 | 164 | while True:
try:
a = [10000]
a,b,c = map(str,raw_input().split())
b,c=a[1],a[2]
print "%s %d %d" %(a,b+c,200*b+300+c)
except EOFError:
break | File "/tmp/tmpmhnjg9nl/tmppt2axhoc.py", line 6
print "%s %d %d" %(a,b+c,200*b+300+c)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s013504020 | p00173 | u460331583 | 1346394998 | Python | Python | py | Runtime Error | 0 | 4956 | 183 | while True:
try:
a,b,c= [10000],[10000],[10000]
a,b,c = map(str,raw_input().split())
b,c=a[1],a[2]
print "%s %d %d" %(a,b+c,200*b+300+c)
except EOFError:
break | File "/tmp/tmpsy9zhdid/tmpic6ut2xg.py", line 6
print "%s %d %d" %(a,b+c,200*b+300+c)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s852124242 | p00173 | u633068244 | 1396263001 | Python | Python | py | Runtime Error | 0 | 0 | 88 | for i in range(9):
a,b,c = map(int, raw_input().split())
print a,b+c,200*b+300*c | File "/tmp/tmpl_l9b0tm/tmpc0xq5_i2.py", line 3
print a,b+c,200*b+300*c
^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s034351592 | p00175 | u633068244 | 1396265113 | Python | Python | py | Runtime Error | 0 | 0 | 143 | def f(n):
a = ""
while n>0:
a += str(n%4)
n //= 4
return a[::-1]
while 1:
n = input()
if n == -1: break
print f(n) if n > 0 else 0 | File "/tmp/tmpfsinpay5/tmpfr87a8b6.py", line 1
def f(n):
IndentationError: unexpected indent
| |
s330881806 | p00178 | u352394527 | 1531027199 | Python | Python3 | py | Runtime Error | 0 | 0 | 1200 | end = [1,1,1,1,1]
while True:
n = int(input())
if n == 0:
break
mp = [[0] * 5 for _ in range(4000)]
height = [0] * 5
cnt = 0
for i in range(n):
d, p, q = map(int, input().split())
q -= 1
cnt += p
if d == 1:
pos = max(height[q:q + p])
mp[pos][q:q + p] = [1] * p
if mp[pos... | Traceback (most recent call last):
File "/tmp/tmp64pcjt4j/tmp4f7a9hw7.py", line 3, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s682480977 | p00178 | u300946041 | 1447322731 | Python | Python | py | Runtime Error | 0 | 0 | 517 | N = raw_input()
while True:
ls = [[None] * 5] * 5000
flwr = 0
for _ in xrange(N):
d, l, pos = raw_input.split()
# block
if d == 1:
for i in xrange(l):
ls[flwr][pos].append(1)
else:
tmp = 0
for i in xrange(l):
... | Traceback (most recent call last):
File "/tmp/tmp7dmy_3ml/tmps3rnut_6.py", line 1, in <module>
N = raw_input()
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s179602216 | p00178 | u300946041 | 1447322878 | Python | Python | py | Runtime Error | 0 | 0 | 509 | N = input()
while True:
ls = [[None] * 5] * 5000
flwr = 0
for _ in xrange(N):
d, l, pos = raw_input.split()
# block
if d == 1:
for i in xrange(l):
ls[flwr][pos].append(1)
else:
tmp = 0
for i in xrange(l):
l... | Traceback (most recent call last):
File "/tmp/tmpj8gw1npa/tmpolqlk5ji.py", line 1, in <module>
N = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s801245572 | p00178 | u300946041 | 1447323517 | Python | Python | py | Runtime Error | 0 | 0 | 597 | N = input()
while True:
ls = [[None] * 5] * 5000
flwr = 0
for _ in xrange(N):
d, l, pos = raw_input.split()
# block
if d == 1:
for i in xrange(l):
ls[flwr][pos].append(1)
else:
tmp = 0
for i in xrange(l):
ls... | Traceback (most recent call last):
File "/tmp/tmpmszcb942/tmphn8cf3ob.py", line 1, in <module>
N = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s987408659 | p00178 | u300946041 | 1447323913 | Python | Python | py | Runtime Error | 0 | 0 | 619 | N = int(input())
while True:
ls = [[None] * 5] * 5000
flwr = 0
for _ in xrange(N):
d, l, pos = map(int, raw_input().split())
# block
if d == 1:
for i in xrange(l):
ls[flwr][pos].append(1)
else:
tmp = 0
for i in xrange(l):
... | Traceback (most recent call last):
File "/tmp/tmpsq0h04ft/tmpy_0g6bn1.py", line 1, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s187441808 | p00178 | u300946041 | 1447325657 | Python | Python | py | Runtime Error | 0 | 0 | 659 | #!/usr/local/bin/python
N = int(input())
while True:
ls = [[None] * 5] * 5000
flwr = 0
for _ in xrange(N):
d, l, pos = map(int, raw_input().split())
# block
if d == 1:
for i in xrange(l):
ls[flwr][pos].append(1)
else:
tmp = 0
... | File "/tmp/tmpnev0k11w/tmpmk0u0ndn.py", line 26
print ret
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s514478258 | p00178 | u300946041 | 1447332201 | Python | Python | py | Runtime Error | 0 | 0 | 651 | #!/usr/local/bin/python
def init():
return [[None] * 5] * 5000
while True:
N = int(input())
if N == 0:
break
d, l, pos = [int(n) for n in raw_input().split()]
lst = init()
flwr = 0
pos -= 1
for _ in xrange(N):
if d == 1:
for i in xrange(l):
... | File "/tmp/tmp43jzzndn/tmpyo2hig7g.py", line 27
print flwr
^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s006626402 | p00178 | u300946041 | 1447336433 | Python | Python | py | Runtime Error | 0 | 0 | 786 | #!/usr/local/bin/python
from itertools import islice
def init():
return [[None] * 5] * 5000
N = 4
while True:
#N = int(input())
if N == 0:
break
d, l, pos = [int(n) for n in raw_input().split()]
lst = init()
flwr = 0
for i in xrange(N):
print d, l, pos
# if d == 1:... | File "/tmp/tmpt2j8zw3l/tmpmi65zdpe.py", line 17
print d, l, pos
^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s927128248 | p00178 | u633068244 | 1397740634 | Python | Python | py | Runtime Error | 0 | 0 | 682 | while 1:
n=input()
if n==0:break
hmax=1000
block=[map(int,raw_input().split()) for i in range(n)]
field=[[0]*5 for i in range(hmax)]
for d,p,q in block:
if d==1:
for li in range(hmax-1,-1,-1):
if field[li][q-1:q+p-1]!=[0]*p:
field[li+1][q-1:q+p-1]=[1]*p
break
else:
field[0][q-1:q+p-1]=[1... | File "/tmp/tmpl7t4gp9s/tmpf3y91y1v.py", line 33
print sum([sum(field[li]) for li in range(hmax)])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s339297976 | p00178 | u633068244 | 1397740920 | Python | Python | py | Runtime Error | 0 | 0 | 644 | while 1:
n=input()
if n==0:break
hmax=10000
block=[map(int,raw_input().split()) for i in range(n)]
field=[[0]*5 for i in range(hmax)]
h=0
for d,p,q in block:
if d==1:
for li in range(h+1,-2,-1):
if field[li][q-1:q+p-1]!=[0]*p or li==-1:
field[li+1][q-1:q+p-1]=[1]*p
h=max(h,li+1)
break
e... | File "/tmp/tmpe6gh3c2o/tmp4k962bon.py", line 31
print sum([sum(field[li]) for li in range(hmax)])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s389419921 | p00178 | u633068244 | 1397741237 | Python | Python | py | Runtime Error | 0 | 0 | 636 | while 1:
n=input()
if n==0:break
hmax=5000
block=[map(int,raw_input().split()) for i in range(n)]
field=[[0]*5 for i in range(hmax)]
h=0
for d,p,q in block:
if d==1:
for li in range(h,-2,-1):
if field[li][q-1:q+p-1]!=[0]*p or li==-1:
field[li+1][q-1:q+p-1]=[1]*p
h=max(h,li+2)
break
else... | File "/tmp/tmpw837nt_6/tmpt7cxekup.py", line 31
print sum([sum(field[li]) for li in range(h)])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s289020451 | p00179 | u869924057 | 1521198372 | Python | Python3 | py | Runtime Error | 0 | 0 | 1801 | from collections import deque
import copy
def another_color(a, b):
if a == 'r' and b == 'g' or a == 'g' and b == 'r':
return 'b'
if a == 'r' and b == 'b' or a == 'b' and b == 'r':
return 'g'
if a == 'g' and b == 'b' or a == 'b' and b == 'g':
return 'r'
return None
def is_all_s... | Traceback (most recent call last):
File "/tmp/tmpgehviu93/tmphe9vkcy2.py", line 42, in <module>
sequence = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s924774811 | p00179 | u869924057 | 1521683492 | Python | Python3 | py | Runtime Error | 0 | 0 | 1634 | from collections import deque
import copy
def another_color(a, b):
if not a == 'r' and not b == 'r':
return 'r'
if not a == 'g' and not b == 'g':
return 'g'
return 'b'
def is_all_same_elements(es):
return all([e == es[0] for e in es[1:]]) if es else False
class State:
def __init_... | Traceback (most recent call last):
File "/tmp/tmp08fti9f2/tmpezdlcn_4.py", line 38, in <module>
sequence = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s459652299 | p00179 | u869924057 | 1521684136 | Python | Python3 | py | Runtime Error | 0 | 0 | 1675 | import sys
sys.setrecursionlimit(100000)
from collections import deque
import copy
def another_color(a, b):
if not a == 'r' and not b == 'r':
return 'r'
if not a == 'g' and not b == 'g':
return 'g'
return 'b'
def is_all_same_elements(es):
return all([e == es[0] for e in es[1:]]) if e... | Traceback (most recent call last):
File "/tmp/tmpp6vi96b9/tmpvbkvmmkc.py", line 41, in <module>
sequence = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s700890162 | p00179 | u869924057 | 1521684182 | Python | Python3 | py | Runtime Error | 0 | 0 | 1634 | from collections import deque
import copy
def another_color(a, b):
if not a == 'r' and not b == 'r':
return 'r'
if not a == 'g' and not b == 'g':
return 'g'
return 'b'
def is_all_same_elements(es):
return all([e == es[0] for e in es[1:]]) if es else False
class State:
def __init_... | Traceback (most recent call last):
File "/tmp/tmphcky1giv/tmpvc165exn.py", line 38, in <module>
sequence = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s137148665 | p00179 | u921825999 | 1521718458 | Python | Python | py | Runtime Error | 0 | 0 | 1632 | from collections import deque
import copy
def another_color(a, b):
if not a == 'r' and not b == 'r':
return 'r'
if not a == 'g' and not b == 'g':
return 'g'
return 'b'
def is_all_same_elements(es):
return all([e == es[0] for e in es[1:]]) if es else False
class State:
def __init_... | Traceback (most recent call last):
File "/tmp/tmpflaqs7li/tmphkv26jwy.py", line 38, in <module>
sequence = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s162216946 | p00179 | u921825999 | 1521718486 | Python | Python | py | Runtime Error | 0 | 0 | 1632 | from collections import deque
import copy
def another_color(a, b):
if not a == 'r' and not b == 'r':
return 'r'
if not a == 'g' and not b == 'g':
return 'g'
return 'b'
def is_all_same_elements(es):
return all([e == es[0] for e in es[1:]]) if es else False
class State:
def __init_... | Traceback (most recent call last):
File "/tmp/tmpnn70jn0n/tmplna4_2tl.py", line 38, in <module>
sequence = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s634853276 | p00179 | u921825999 | 1521718499 | Python | Python3 | py | Runtime Error | 0 | 0 | 1632 | from collections import deque
import copy
def another_color(a, b):
if not a == 'r' and not b == 'r':
return 'r'
if not a == 'g' and not b == 'g':
return 'g'
return 'b'
def is_all_same_elements(es):
return all([e == es[0] for e in es[1:]]) if es else False
class State:
def __init_... | Traceback (most recent call last):
File "/tmp/tmp7c0lrbcd/tmpqdgr2jmh.py", line 38, in <module>
sequence = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s820140720 | p00180 | u873482706 | 1436626492 | Python | Python | py | Runtime Error | 0 | 0 | 755 | def f(n, ans):
for k, c in dic.items():
a, b = k
if a == n:
if not b in cost or c < cost[b]:
cost[b] = c
elif b == n:
if not a in cost or c < cost[a]:
cost[a] = c
for k, c in sorted(cost.items(), key=lambda x: x[1]):
if not ... | File "/tmp/tmpd28g6mec/tmpsvotpsk7.py", line 29
print f(s, 0)
^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s465955772 | p00180 | u873482706 | 1437024275 | Python | Python | py | Runtime Error | 0 | 0 | 659 | def f(s, cost, route, ans):
route.append(s)
ans += cost[s]
del cost[s]
for k, c in data.items():
if s in k:
a, b = k
b = b if s == a else a
if not b in route:
if not b in cost or c < cost[b]:
cost[b] = c
if cost:
s = sorted(... | File "/tmp/tmpv5ppy_f5/tmpgwtfojie.py", line 26
print f(0, {0:0}, [], 0)
^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s351507261 | p00180 | u873482706 | 1437025075 | Python | Python | py | Runtime Error | 0 | 0 | 714 | def f(s, cost, route, ans):
route.append(s)
ans += cost[s]
del cost[s]
for k, c in data.items():
if s in k:
a, b = k
a, b = a, b if s == a else b, a
if not b in route:
if not b in cost or c < cost[b]:
... | File "/tmp/tmpk657t3c1/tmpwfxluc47.py", line 25
print f(0, {0:0}, [], 0)
^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s596828231 | p00180 | u873482706 | 1437025304 | Python | Python | py | Runtime Error | 0 | 0 | 750 | import copy
def f(s, cost, route, ans, data):
route.append(s)
ans += cost[s]
del cost[s]
_data = copy.deepcopy(data)
for k, c in _data.items():
if s in k:
a, b = k
a, b = a, b if s == a else b, a
if not b in route:
if not b in cost or c < ... | File "/tmp/tmp_qnfgmtg/tmp6f02zw1y.py", line 28
print f(0, {0:0}, [], 0, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s084568568 | p00181 | u873482706 | 1436689421 | Python | Python | py | Runtime Error | 0 | 0 | 525 | while True:
m, n = map(int, raw_input().split())
if m == n == 0: break
tl = 0
book = []
for i in range(n):
l = input()
tl += l
book.append(l)
else:
pe = float(tl)/m
ll = 0
c = 1
for i, length in enumerate(book):
ll += length
if pe <= ll... | File "/tmp/tmp5pdwqp3e/tmpn7e0vy1d.py", line 24
print pe
^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s199164298 | p00181 | u873482706 | 1436689666 | Python | Python | py | Runtime Error | 0 | 0 | 570 | while True:
m, n = map(int, raw_input().split())
if m == n == 0: break
tl = 0
book = []
for i in range(n):
l = input()
tl += l
book.append(l)
else:
pe = float(tl)/m
ll = 0
c = 1
for i, length in enumerate(book):
ll += length
if pe <= ll... | File "/tmp/tmpwkf3_96m/tmp841ttw4u.py", line 26
print pe
^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s196961934 | p00181 | u873482706 | 1436690783 | Python | Python | py | Runtime Error | 0 | 0 | 584 | while True:
m, n = map(int, raw_input().split())
if m == n == 0: break
tl = 0
book = []
for i in range(n):
l = input()
tl += l
book.append(l)
else:
pe = float(tl)/m
if m == 1:
print int(pe)
continue
ll = 0
c = 1
for i, length in enu... | File "/tmp/tmpos468_97/tmpttnwq5v7.py", line 13
print int(pe)
^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s578762562 | p00181 | u873482706 | 1436693962 | Python | Python | py | Runtime Error | 0 | 0 | 607 | while True:
m, n = map(int, raw_input().split())
if m == n == 0: break
tl = 0
book = []
for i in range(n):
l = input()
tl += l
book.append(l)
else:
pe = float(tl)/m
ll = []
c = 1
for i, length in enumerate(book):
ll.append(length)
if pe... | File "/tmp/tmppj1ddiv_/tmpbypnsdgo.py", line 26
print int(pe)
^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s346369853 | p00181 | u514808940 | 1457673372 | Python | Python3 | py | Runtime Error | 0 | 0 | 845 |
class Solve:
def __init__(self):
self.M, self.N = map(int, input().split())
self.bs = [int(input()) for i in range(self.N)]
self.S = min(sum(self.bs), 1500000)
self.l, self.r = 0, self.S
def check(self, W):
w = W
i = 1
for b in self.bs:
if(W... | Traceback (most recent call last):
File "/tmp/tmptwk7437t/tmp_4hymuiu.py", line 36, in <module>
print(Solve().solve())
^^^^^^^
File "/tmp/tmptwk7437t/tmp_4hymuiu.py", line 4, in __init__
self.M, self.N = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a l... | |
s331082747 | p00181 | u514808940 | 1457673558 | Python | Python3 | py | Runtime Error | 0 | 0 | 818 |
class Solve:
def __init__(self):
self.M, self.N = map(int, input().split())
self.bs = [int(input()) for i in range(self.N)]
self.S = min(sum(self.bs), 1500000)
self.l, self.r = 0, self.S
def check(self, W):
w = W
i = 1
for b in self.bs:
if(w... | Traceback (most recent call last):
File "/tmp/tmp4c16u8r4/tmpx_0zz70s.py", line 35, in <module>
print(Solve().solve())
^^^^^^^
File "/tmp/tmp4c16u8r4/tmpx_0zz70s.py", line 4, in __init__
self.M, self.N = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a l... | |
s908824760 | p00181 | u301729341 | 1495869058 | Python | Python3 | py | Runtime Error | 0 | 0 | 1083 | def nibutan(f_id,e_id,f_num,yn):
m_id = int((f_id + e_id) / 2)
m_num = w_lis[m_id]
if e_id - f_id <= 1:
if yn == 0:
return e_id
else:
return f_id
else:
if m_num > f_num:
return(nibutan(f_id,m_id -1,f_num,yn))
elif m_num < f... | Traceback (most recent call last):
File "/tmp/tmp9jood7yn/tmpbk_2fe6p.py", line 32, in <module>
m,n = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s583236912 | p00183 | u104911888 | 1367481784 | Python | Python | py | Runtime Error | 0 | 0 | 357 | while True:
s=raw_input()
if s=="0":break
s+="".join([raw_input() for i in range(2)])
L=[(i,i+1,i+2) for i in range(0,9,3)]+[(i,i+3,i+6) for i in range(3)]+[tupl\
e(range(0,9,4))]+[tuple(range(2,7,2))]
for i,j,k in L:
if s[i]==s[j]==s[k]:
print "b" if s[i]=="b" else "w"
... | File "/tmp/tmpb5vdyxtt/tmp8qy4apzc.py", line 5
L=[(i,i+1,i+2) for i in range(0,9,3)]+[(i,i+3,i+6) for i in range(3)]+[tupl\
^^^^^
SyntaxError: invalid syntax. Perhaps you forgot a comma?
| |
s261868643 | p00183 | u104911888 | 1367481877 | Python | Python | py | Runtime Error | 0 | 0 | 339 | while True:
s=raw_input()
if s=="0":break
s+="".join([raw_input() for i in range(2)])
L=[(i,i+1,i+2) for i in range(0,9,3)]+
[(i,i+3,i+6) for i in range(3)]+
[(0,4,8),(2,4,6)]
for i,j,k in L:
if s[i]==s[j]==s[k]:
print "b" if s[i]=="b" else "w"
break
else:... | File "/tmp/tmp2h5p657f/tmptfx9exkw.py", line 5
L=[(i,i+1,i+2) for i in range(0,9,3)]+
^
SyntaxError: invalid syntax
| |
s267287472 | p00184 | u814278309 | 1559164466 | Python | Python3 | py | Runtime Error | 0 | 0 | 427 | n=int(input())
while True:
if n==0:
break
x=[0 for i in range(7)]
for i in range(n):
a=int(input())
if 0<=a<10:
x[0]+=1
elif 10<=a<20:
x[1]+=1
elif 20<=a<30:
x[2]+=1
elif 30<=a<40:
x[3]+=1
elif 40<=a<50:
x[4]+=1
elif 50<=a<60:
x[5]+=1
else:
... | Traceback (most recent call last):
File "/tmp/tmptzo_djqw/tmp1oy1im0h.py", line 1, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s157005347 | p00184 | u814278309 | 1559173483 | Python | Python3 | py | Runtime Error | 0 | 0 | 425 | n=int(input())
x=[0 for i in range(7)]
while True:
if n==0:
break
for i in range(n):
a=int(input())
if 0<=a<10:
x[0]+=1
elif 10<=a<20:
x[1]+=1
elif 20<=a<30:
x[2]+=1
elif 30<=a<40:
x[3]+=1
elif 40<=a<50:
x[4]+=1
elif 50<=a<60:
x[5]+=1
else:
... | Traceback (most recent call last):
File "/tmp/tmp_o1pisk6/tmpjwjjbxno.py", line 1, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s083328847 | p00184 | u814278309 | 1559173542 | Python | Python3 | py | Runtime Error | 0 | 0 | 412 | n=int(input())
x=[0 for i in range(7)]
while True:
if n==0:
break
for i in range(n):
a=int(input())
if 0<=a<10:
x[0]+=1
elif 10<=a<20:
x[1]+=1
elif 20<=a<30:
x[2]+=1
elif 30<=a<40:
x[3]+=1
elif 40<=a<50:
x[4]+=1
elif 50<=a<60:
x[5]+=1
else:
... | Traceback (most recent call last):
File "/tmp/tmpwfm2crih/tmpp55n_m2w.py", line 1, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s102448187 | p00184 | u812047151 | 1469963121 | Python | Python3 | py | Runtime Error | 0 | 0 | 338 | while True:
n = int(input())
ans = [0 for _ in range(7)]
for _ in range(n):
age = int(input())
if age < 10:
ans[0] += 1
elif age < 20:
ans[1] += 1
elif age < 30:
ans[2] += 1
elif age < 40:
ans[3] += 1
elif age < 50:
ans[4] += 1
elif age < 60:
ans[5] += 1
else:
ans[6] += 1
for a ... | Traceback (most recent call last):
File "/tmp/tmpxrkwas_c/tmp2m08zy7c.py", line 2, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s234596117 | p00184 | u621997536 | 1397549841 | Python | Python | py | Runtime Error | 0 | 0 | 312 | #include<algorithm>
#include<iostream>
using namespace std;
int main()
{
while(1)
{
int c[7] = {}, n;
cin >> n;
if(!n)
break;
for(int i = 0; i < n; i++)
{
int a;
cin >> a;
c[min(a / 10, 6)]++;
}
for(int i = 0; i < 7; i++)
cout << c[i] << endl;
}
} | File "/tmp/tmpvercjz8c/tmp9ht5pgrk.py", line 3
using namespace std;
^^^^^^^^^
SyntaxError: invalid syntax
| |
s817812993 | p00185 | u873482706 | 1436703171 | Python | Python | py | Runtime Error | 0 | 0 | 804 | while True:
m = input()
if m == 0: break
L = [i for i in range(2, m+1)]
p = 2
q = None
ans = []
while L:
_L = L[:]
for n in _L:
if n == p:
ans.append(n)
L.remove(n)
else:
if n % p == 0:
... | File "/tmp/tmpt7ln0hbl/tmpd5009beu.py", line 37
print c
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s679221125 | p00185 | u811733736 | 1507126295 | Python | Python3 | py | Runtime Error | 0 | 0 | 1207 | # -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0185
"""
import sys
from sys import stdin
from bisect import bisect_left
input = stdin.readline
def create_prime_list(limit):
""" ??¨??????????????????????????§limit?????§????´???°?????????????±???????
https://ja.wikipedia.o... | Traceback (most recent call last):
File "/tmp/tmpmq5jj70a/tmp7l8suux5.py", line 48, in <module>
main(sys.argv[1:])
File "/tmp/tmpmq5jj70a/tmp7l8suux5.py", line 32, in main
n = int(input())
^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s221621329 | p00185 | u808429775 | 1524940104 | Python | Python3 | py | Runtime Error | 0 | 0 | 1108 | import array
import bisect
def is_prime_number(num):
limit = int(num ** 0.5)
for lp in range(3, limit + 1, 2):
if num % lp == 0:
return False
return True
LENGTH = 1000000
prime_number_list = array.array("i", [True] * (LENGTH + 1))
prime_number_list[0] = False
prime_number_list[1] ... | Traceback (most recent call last):
File "/tmp/tmp2_ey_esq/tmp2svfm_76.py", line 35, in <module>
input_num = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s322898441 | p00185 | u808429775 | 1524942222 | Python | Python3 | py | Runtime Error | 0 | 0 | 1361 | import array
import bisect
def is_prime_number(num):
limit = int(num ** 0.5)
for lp in range(3, limit + 1, 2):
if num % lp == 0:
return False
return True
def binary_search(num_list, num):
left = 0
right = len(num_list)
while left <= right:
mid = (left + right) ... | Traceback (most recent call last):
File "/tmp/tmpwwws9qcs/tmpsir_9fas.py", line 52, in <module>
input_num = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s786495184 | p00185 | u352394527 | 1529730882 | Python | Python3 | py | Runtime Error | 0 | 0 | 582 | from bisect import bisect_left as bl
def primes(n):
tf = [True] * (n + 1)
tf[0] = tf[1] = False
for i in range(2, int(n ** (1 / 2) + 1)):
if tf[i]:
for j in range(i ** 2, n + 1, i):
tf[j] = False
return [i for i in range(n + 1) if tf[i]]
def search_pair(x, prime_lst):
cnt = 0
for prime in... | Traceback (most recent call last):
File "/tmp/tmpsfmltagi/tmpzwgmskz8.py", line 24, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s560045312 | p00185 | u621997536 | 1399874459 | Python | Python | py | Runtime Error | 0 | 0 | 329 | MN = 100000
prime = []
mem = [False] * 2 + [True] * MN
for i in range(2, MN):
if not mem[i]:
continue
prime.append(i)
for j in range(i + i, MN, i):
mem[j] = False
while True:
N, ans = input(), 0
if not N:
break
for p in prime:
if p > N / 2:
break
if mem[N - p]:
ans += 1
p... | Traceback (most recent call last):
File "/tmp/tmpwzqk_qie/tmpg1o3_qfl.py", line 12, in <module>
N, ans = input(), 0
^^^^^^^
EOFError: EOF when reading a line
| |
s280521608 | p00186 | u043254318 | 1528822780 | Python | Python3 | py | Runtime Error | 0 | 0 | 245 | while True:
N = input()
if N == "0":
break
q1,b,c1,c2,q2 = [int(i) for i in N.split()]
x = min((b-c2*q1) // (c1-c2), q2, b // c1)
y = (b-c1*x) // c2
if x <= 0:
print("NA")
else:
print(x,y)
| Traceback (most recent call last):
File "/tmp/tmp_femuwgm/tmp34gtuzg4.py", line 2, in <module>
N = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s073683672 | p00188 | u873482706 | 1436771940 | Python | Python | py | Runtime Error | 0 | 0 | 473 | import math
def f(check, n, L, count):
count += 1
median = int(math.floor(float(n)/2))
if len(L) == 1 or L[median] == check:
return count
elif L[median] < check:
L = L[median+1:]
elif check < L[median]:
L = L[:median]
n = len(L)
return f(check, n, L, count)
while Tr... | File "/tmp/tmpnxl0v3gz/tmpj_02waem.py", line 20
print f(check, n-1, L, 0)
^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s897334817 | p00188 | u873482706 | 1436772032 | Python | Python | py | Runtime Error | 0 | 0 | 475 | import math
def f(check, n, L, count):
count += 1
median = int(math.floor(float(n)/2))
if len(L) == 1 or L[median] == check:
return count
elif L[median] < check:
L = L[median+1:]
elif check < L[median]:
L = L[:median]
n = len(L)-1
return f(check, n, L, count)
while ... | File "/tmp/tmp51p9d0e5/tmp3f24_ug5.py", line 20
print f(check, n-1, L, 0)
^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s029364596 | p00188 | u873482706 | 1436782847 | Python | Python | py | Runtime Error | 0 | 0 | 501 | import math
def f(check, n, L, count):
count += 1
median = int(math.floor(float(n-1)/2))
if len(L) == 1:
return count
elif L[median] == check:
return count
elif L[median] < check:
L = L[median+1:]
elif check < L[median]:
L = L[:median]
n = len(L)
return f... | File "/tmp/tmp1gsw3rql/tmp4pka5w4o.py", line 22
print f(check, n, L, 0)
^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s039428486 | p00188 | u873482706 | 1436783601 | Python | Python | py | Runtime Error | 0 | 0 | 438 | def f(check, n, L, count):
count += 1
median = (n-1)/2
if len(L) == 1 or L[median] == check:
return count
elif L[median] < check:
L = L[median+1:]
elif check < L[median]:
L = L[:median]
n = len(L)
return f(check, n, L, count)
while True:
n = int(raw_input())
... | File "/tmp/tmpm8pog2ed/tmpm0dehugo.py", line 18
print f(check, n, L, 0)
^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s177622560 | p00188 | u078042885 | 1486417930 | Python | Python3 | py | Runtime Error | 0 | 0 | 231 | while 1:
l,r=0,int(input())
a=[int(input()) for _ in range(r)]
r-=1;c=0
k=int(input())
while l<=r:
c+=1
m=(l+r)//2
if a[m]==k:break
if a[m]<k:l=m+1
else:r=m-1
print(c) | Traceback (most recent call last):
File "/tmp/tmp_skksxxw/tmp4wq8_ji0.py", line 2, in <module>
l,r=0,int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s288418878 | p00188 | u301729341 | 1495863827 | Python | Python3 | py | Runtime Error | 0 | 0 | 612 | def nibutan(f_id,e_id,f_num,count):
m_id = int((f_id + e_id) / 2)
m_num = n_lis[m_id]
count += 1
if (f_id > e_id):
return count
else:
if m_num > f_num:
return(nibutan(f_id,m_id -1,f_num,count))
elif m_num < f_num:
return(nibutan(m_id + 1,e_... | Traceback (most recent call last):
File "/tmp/tmpd01mv0tn/tmpzk93a8lu.py", line 22, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s505513713 | p00188 | u133119785 | 1509186571 | Python | Python3 | py | Runtime Error | 0 | 0 | 470 | def search(n,d,t):
b = 0
e = n
r = 0
while True:
r += 1
if b > e:
return r
else:
i = (b+e)//2
if t == d[i]:
return r
elif t < d[i]:
e = i - 1
else:
b = i + 1
while True:
... | Traceback (most recent call last):
File "/tmp/tmptrk7sgq0/tmpi54d5wbx.py", line 18, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s143541845 | p00188 | u133119785 | 1509186630 | Python | Python3 | py | Runtime Error | 0 | 0 | 465 | def search(n,d,t):
b = 0
e = n
r = 0
while True:
r += 1
if b > e:
return r
else:
i = (b+e)//2
if t == d[i]:
return r
elif t < d[i]:
e = i - 1
else:
b = i + 1
while True:
... | Traceback (most recent call last):
File "/tmp/tmpcg1z4cpk/tmpn15446fe.py", line 18, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s996292216 | p00188 | u633068244 | 1399013843 | Python | Python | py | Runtime Error | 0 | 0 | 214 | while 1:
n = input()
if n == 0: break
N = [int(raw_input()) for i in range(n)]
s = input()
i = n/2
c = 1
while i > 0:
c += 1
if N[i] == s:
break
elif N[i] < s:
i /= 2
else:
i += i/2
print c | File "/tmp/tmp5rhl7dpo/tmpmuq2ybhh.py", line 16
print c
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s591909962 | p00189 | u695154284 | 1492094877 | Python | Python3 | py | Runtime Error | 0 | 0 | 1048 | def solve(_dp, _v):
for k in range(0, _v + 1):
for i in range(0, _v + 1):
for j in range(0, _v + 1):
_dp[i][j] = min(_dp[i][j], _dp[i][k] + _dp[k][j])
return _dp
if __name__ == '__main__':
while True:
n = int(input())
if n == 0: break
dp = [[100... | Traceback (most recent call last):
File "/tmp/tmp597coich/tmp8ra5z1uc.py", line 12, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s468059789 | p00189 | u695154284 | 1492095027 | Python | Python3 | py | Runtime Error | 0 | 0 | 1048 | def solve(_dp, _v):
for k in range(0, _v + 1):
for i in range(0, _v + 1):
for j in range(0, _v + 1):
_dp[i][j] = min(_dp[i][j], _dp[i][k] + _dp[k][j])
return _dp
if __name__ == '__main__':
while True:
n = int(input())
if n == 0: break
dp = [[100... | Traceback (most recent call last):
File "/tmp/tmpep9976du/tmp4nlso4vg.py", line 12, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s181355653 | p00189 | u798803522 | 1508129533 | Python | Python3 | py | Runtime Error | 0 | 0 | 660 | road = int(input())
while road > 0:
answer = [[float("inf") if n != m else 0 for n in range(10)] for m in range(10)]
for _ in range(road):
c1, c2, w = (int(n) for n in input().split(" "))
answer[c1][c2] = w
answer[c2][c1] = w
city = max(connect.keys()) + 1
for i in range(city):
... | Traceback (most recent call last):
File "/tmp/tmpzujtgsxi/tmplqco67n6.py", line 1, in <module>
road = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s788068710 | p00189 | u798803522 | 1508129572 | Python | Python3 | py | Runtime Error | 0 | 0 | 660 | road = int(input())
while road > 0:
answer = [[float("inf") if n != m else 0 for n in range(10)] for m in range(10)]
for _ in range(road):
c1, c2, w = (int(n) for n in input().split(" "))
answer[c1][c2] = w
answer[c2][c1] = w
city = max(connect.keys()) + 1
for i in range(city):
... | Traceback (most recent call last):
File "/tmp/tmpvhmxz3fw/tmpwidza4yi.py", line 1, in <module>
road = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s585325258 | p00189 | u798803522 | 1508129639 | Python | Python3 | py | Runtime Error | 0 | 0 | 706 | road = int(input())
while road > 0:
answer = [[float("inf") if n != m else 0 for n in range(10)] for m in range(10)]
city = 0
for _ in range(road):
c1, c2, w = (int(n) for n in input().split(" "))
answer[c1][c2] = w
answer[c2][c1] = w
city = max(city, c1, c2)
city = max(c... | Traceback (most recent call last):
File "/tmp/tmpsqod1ksf/tmpcpcc9dhm.py", line 1, in <module>
road = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s616745417 | p00189 | u011621222 | 1509611180 | Python | Python3 | py | Runtime Error | 0 | 0 | 950 | while True:
N = int(input())
if N == 0:
break
INF = 1000000000
mat = []
for i in range(10):
row = []
for j in range(10):
if i == j:
row.append(0)
else:
row.append(INF)
mat.append(row)
for i in range(N):
... | Traceback (most recent call last):
File "/tmp/tmpmwhdthkh/tmpxnke2hut.py", line 2, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s572332414 | p00191 | u408260374 | 1432209154 | Python | Python | py | Runtime Error | 0 | 0 | 664 | from math import sqrt
prime = [1 for _ in xrange(10**6+1)]
prime[1] = 1
prime[0] = 0
for i in xrange(2, int(sqrt(10**6+1))+1):
if prime[i] == 1:
for j in xrange(i+i, 10**6+1, i):
prime[j] = 0
while True:
N, X = map(int, raw_input().split())
if (N, X) == (0, 0): break
price = [input()... | Traceback (most recent call last):
File "/tmp/tmpv3uw9caf/tmpcja_boag.py", line 2, in <module>
prime = [1 for _ in xrange(10**6+1)]
^^^^^^
NameError: name 'xrange' is not defined. Did you mean: 'range'?
| |
s936661746 | p00191 | u847467233 | 1529445629 | Python | Python3 | py | Runtime Error | 0 | 0 | 526 | # AOJ 0191: Baby Tree
# Python3 2018.6.20 bal4u
while True:
n, m = list(map(int, input().split()))
if n == 0: break
d = [[0.0 for j in range(n)] for i in range(n)]
for i in range(n): d[i] = list(map(float, input().split()))
dp = [[0.0 for j in range(n)] for i in range(n)]
for i in range(n): dp[0][i] = 1
for k... | Traceback (most recent call last):
File "/tmp/tmpgxmzxdi1/tmpjg84xskz.py", line 5, in <module>
n, m = list(map(int, input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s076779886 | p00192 | u352394527 | 1529749517 | Python | Python3 | py | Runtime Error | 0 | 0 | 2007 | from collections import deque
def out(time, parking):
x = len(parking)
outs1 = []
outs2 = []
for i in range(x):
for j in range(2):
if parking[i][j] != None:
parking[i][j][0] -= time
for i in range(x):
c1 = parking[i][0]
c2 = parking[i][1]
if c1 != None and c2 != None:
i... | Traceback (most recent call last):
File "/tmp/tmpo3n0qt0j/tmprjr4xt6c.py", line 68, in <module>
m, n = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s595043322 | p00193 | u492556875 | 1424364852 | Python | Python3 | py | Runtime Error | 0 | 0 | 1483 | import sys
def generate_next_hexes(x, y):
hexes = [(x, y - 1), (x, y + 1), (x - 1, y), (x + 1, y)]
if y % 2:
hexes += [(x - 1, y - 1), (x - 1, y + 1)]
else:
hexes += [(x + 1, y - 1), (x + 1, y + 1)]
hexes = [(a, b) for (a, b) in hexes if 1 <= b <= m and 1 <= b <= n]
return hexes
de... | File "/tmp/tmp2fclhafp/tmp6j1862km.py", line 18
if pos not in hex_map or distance < hex_map[pos]):
^
SyntaxError: unmatched ')'
| |
s842612108 | p00193 | u647766105 | 1394761351 | Python | Python | py | Runtime Error | 0 | 0 | 1161 | #Deven-Eleven:
D = (((-1, -1), (0, -1), (1, 0), (0, 1), (-1, 1), (-1, 0)),
((0, -1), (1, -1), (1, 0), (1, 1), (0, 1), (-1, 0)))
def func(y, x):
q = [(y, x, 0)]
cover = [[-1] * m for _ in xrange(n)]
while len(q) != 0:
y, x, step = q.pop(0)
if cover[y][x] >= 0:
continue
... | File "/tmp/tmp5ulc34w6/tmpmv_vr7xr.py", line 38
print solve()
^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s280286225 | p00193 | u647766105 | 1394763561 | Python | Python | py | Runtime Error | 0 | 0 | 1179 | #Deven-Eleven:
D = (((-1, -1), (0, -1), (1, 0), (0, 1), (-1, 1), (-1, 0)),
((0, -1), (1, -1), (1, 0), (1, 1), (0, 1), (-1, 0)))
def func(y, x):
q = [(y, x, 0)]
cover = [[-1] * m for _ in xrange(n)]
while len(q) != 0:
y, x, step = q.pop(0)
if cover[y][x] >= 0:
continue
... | File "/tmp/tmpft08gdl2/tmpa_26k7yy.py", line 38
print solve()
^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s831656792 | p00193 | u647766105 | 1394763723 | Python | Python | py | Runtime Error | 0 | 0 | 1159 | D = (((-1, -1), (0, -1), (1, 0), (0, 1), (-1, 1), (-1, 0)), ((0, -1), (1, -1), (1, 0), (1, 1), (0, 1), (-1, 0)))
def func(y, x):
q = [(y, x, 0)]
cover = [[-1] * m for _ in xrange(n)]
while len(q) != 0:
y, x, step = q.pop(0)
if cover[y][x] >= 0:
continue
cover[y][x] = step... | File "/tmp/tmppje0ovuo/tmpg8knv14x.py", line 36
print solve()
^^^^^^^^^^^^^
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.