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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s752049777 | p01809 | u314932236 | 1529465192 | Python | Python3 | py | Runtime Error | 0 | 0 | 110 | import math
def main():
p = int(input())
q = int(input())
print(int(q/math.gcd(p,q)))
main()
| Traceback (most recent call last):
File "/tmp/tmpv7y6xepk/tmp8fxf89vr.py", line 8, in <module>
main()
File "/tmp/tmpv7y6xepk/tmp8fxf89vr.py", line 4, in main
p = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s110568154 | p01809 | u314932236 | 1529465939 | Python | Python3 | py | Runtime Error | 0 | 0 | 75 | import math
p = int(input())
q = int(input())
print(int(q/math.gcd(p,q)))
| Traceback (most recent call last):
File "/tmp/tmpfqxkoq0d/tmpb5fjhaot.py", line 3, in <module>
p = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s447683303 | p01811 | u372789658 | 1475426937 | Python | Python3 | py | Runtime Error | 0 | 0 | 729 | special=False
target=input()
if target[0]=="A" and target[-1]=="C" and "B" in target and "ABC" in target:
pass
else:
special=True
special="True"
old=["ABC"]
new=[]
word=["A","B","C"]
while old != [] or special=True:
if target in old:
print("Yes")
break
for i in old:
for j in... | File "/tmp/tmpim41edne/tmpi08q_tmx.py", line 12
while old != [] or special=True:
^
SyntaxError: invalid syntax
| |
s473799107 | p01811 | u260980560 | 1482933449 | Python | Python | py | Runtime Error | 10 | 6392 | 274 | s = raw_input()
used = set()
def dfs(s):
if s in used:
return 0
if s == "ABC":
return 1
if "ABC" in s:
for c in "ABC":
if dfs(s.replace("ABC", c)):
return 1
used.add(s)
return 0
print dfs(s)*"Yes"or"No" | File "/tmp/tmp75wy15n8/tmpk58amcbp.py", line 14
print dfs(s)*"Yes"or"No"
^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s789987457 | p01811 | u260980560 | 1482933554 | Python | Python | py | Runtime Error | 10 | 6424 | 315 | import sys
s = raw_input()
used = set()
sys.setrecursionlimit(len(s))
def dfs(s):
if s in used:
return 0
if s == "ABC":
return 1
if "ABC" in s:
for c in "ABC":
if dfs(s.replace("ABC", c)):
return 1
used.add(s)
return 0
print dfs(s)*"Yes"or"No" | File "/tmp/tmpheeasu4c/tmpp4xkoa2j.py", line 16
print dfs(s)*"Yes"or"No"
^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s072354743 | p01811 | u942982291 | 1508396148 | Python | Python | py | Runtime Error | 10 | 6464 | 351 | #!/usr/bin/python
if __name__ == "__main__":
S = raw_input()
c = ['A','B','C']
while True:
if len(S) <= 3:
print "Yes" if S == "ABC" else "No"
break
T = S.strip().split("ABC")
P = ''.join(T)
cnt = 0
for x in c:
if x in P:
cnt += 1
else:
S = x.join(T)
if len(t) == 1 or c... | File "/tmp/tmpq056neih/tmpww8pj_dr.py", line 9
print "Yes" if S == "ABC" else "No"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s257950565 | p01811 | u591052358 | 1530367259 | Python | Python3 | py | Runtime Error | 20 | 5608 | 1041 | def solve(s):
if len(s) ==3:
if s[0]=='A' and s[1]=='B' and s[2]=='C':
return True
else:
return False
i=0
a = 0
b = 0
c = 0
lis =[]
while i < len(s):
if i+2<len(s) and s[i] =='A' and s[i+1] == 'B' and s[i+2] == 'C':
lis.append('X')
... | Traceback (most recent call last):
File "/tmp/tmp5x5q_eav/tmp107fi48t.py", line 46, in <module>
if solve(input()):
^^^^^^^
EOFError: EOF when reading a line
| |
s980503912 | p01828 | u506554532 | 1514535527 | Python | Python3 | py | Runtime Error | 20 | 5568 | 233 | def judge(s):
si = 0
for t in T:
if t == s[si]:
si += 1
if si == len(s): return True
return False
S,T = input(),input()
N = len(S)
print('Yes' if judge(S[::2]) or judge(S[1::2]) else 'No') | Traceback (most recent call last):
File "/tmp/tmpi5iidoe6/tmppce4nmn_.py", line 9, in <module>
S,T = input(),input()
^^^^^^^
EOFError: EOF when reading a line
| |
s706080180 | p01828 | u509278866 | 1528271582 | Python | Python3 | py | Runtime Error | 60 | 9056 | 928 | 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/tmpsut70b81/tmpvinb6tt3.py", line 38, in <module>
print(main())
^^^^^^
File "/tmp/tmpsut70b81/tmpvinb6tt3.py", line 22, in main
s = S()
^^^
File "/tmp/tmpsut70b81/tmpvinb6tt3.py", line 14, in S
def S(): return input()
... | |
s562801404 | p01839 | u633333374 | 1503186619 | Python | Python | py | Runtime Error | 0 | 0 | 450 | while 1:
n = int(input())
if n == 0:
break
lst = []
b = 0
for i in range(n):
s = str(raw_input())
lst.append(s)
if s == "Un":
if ("A" in lst) == True:
lst.remove("A")
lst.remove("Un")
else:
b = 1
... | File "/tmp/tmp8gajrvdo/tmpit8qltfw.py", line 17
print "NO"
^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s927696920 | p01839 | u209989098 | 1529975987 | Python | Python3 | py | Runtime Error | 0 | 0 | 224 | a = int(input())
aa = 0
un = 0
p = 0
for i in range(a):
k = input()
if k == 'A':
aa += 1
elif k == 'Un':
un += 1
if un > aa:
p = 1
if aa > un:
p = 1
if p = 0:
print("YES")
else:
print("NO")
| File "/tmp/tmpdb3nneam/tmpawd3w5bh.py", line 21
if p = 0:
^^^^^
SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='?
| |
s072023411 | p01839 | u136916346 | 1530112085 | Python | Python3 | py | Runtime Error | 0 | 0 | 372 | from collections import Counter as c
l=[input() for _ in range(int(input()))]
m=c(l)
if l[-1]!="Un":
print("NO")
elif m["A"]==m["Un"] and l[0]=="A":
y=True
for i in l:
if i=="A":
ca+=1
elif i=="Un":
cu+=1
if ca!=cu:
y=False
break
else:
ca=0
cu=0
if y:print... | File "/tmp/tmp_pc1i5u8/tmp8x55koim.py", line 11
elif i=="Un":
TabError: inconsistent use of tabs and spaces in indentation
| |
s838331928 | p01839 | u136916346 | 1530112118 | Python | Python3 | py | Runtime Error | 0 | 0 | 390 | from collections import Counter as c
l=[input() for _ in range(int(input()))]
m=c(l)
if l[-1]!="Un":
print("NO")
elif m["A"]==m["Un"] and l[0]=="A":
y=True
ca=0
cu=0
for i in l:
if i=="A":
ca+=1
elif i=="Un":
cu+=1
if ca!=cu:
y=False
break
else:
ca=0
c... | File "/tmp/tmpbywszqhv/tmp01j0u32b.py", line 13
elif i=="Un":
TabError: inconsistent use of tabs and spaces in indentation
| |
s547402846 | p01839 | u136916346 | 1530146365 | Python | Python3 | py | Runtime Error | 0 | 0 | 304 | l=[int(input()) for _ in range(int(input()))]
s=[]
isno=False
for i in l:
if i=="A":
s.append(1)
else:
try:
_=s.pop()
except:
print("NO")
isno=True
break
if not isno and not s:print("YES")
elif not isno and s:print("NO")
| Traceback (most recent call last):
File "/tmp/tmpfcywxvip/tmpr3d03zg4.py", line 1, in <module>
l=[int(input()) for _ in range(int(input()))]
^^^^^^^
EOFError: EOF when reading a line
| |
s979114772 | p01840 | u209989098 | 1529987167 | Python | Python3 | py | Runtime Error | 0 | 0 | 239 | # coding: utf-8
# Your code here!
a = list(map(int,input().split()))
b = list(map(int,input().split()))
d = 0
k = 0
su = 0
for i in range(a[2]):
k += 1
su = max(su,k)
if b[d] = i + 1:
k = 0
print(su)
| File "/tmp/tmpvunfkkwo/tmpfvns13og.py", line 15
if b[d] = i + 1:
^^^^
SyntaxError: cannot assign to subscript here. Maybe you meant '==' instead of '='?
| |
s877776677 | p01841 | u260980560 | 1501396204 | Python | Python3 | py | Runtime Error | 20 | 7756 | 272 | def convert(S):
return eval(S.replace(")[","),[").replace("](","],("))
def dfs(A, B):
if not A or not B:
return ()
return (dfs(A[0], B[0]), [A[1][0] + B[1][0]], dfs(A[2], B[2]))
print(str(dfs(convert(input()), convert(input()))).replace(", ","")[1:-1]) | Traceback (most recent call last):
File "/tmp/tmpur30gyde/tmp7jvss3wn.py", line 7, in <module>
print(str(dfs(convert(input()), convert(input()))).replace(", ","")[1:-1])
^^^^^^^
EOFError: EOF when reading a line
| |
s660471390 | p01841 | u011621222 | 1530175836 | Python | Python3 | py | Runtime Error | 0 | 0 | 2283 | in1 = input()
in2 = input()
nodes = [[-1,-1,-1] for _ in range(1000)]
nodes2 = [[-1,-1,-1] for _ in range(1000)]
nodes3 = [[-1,-1,-1] for _ in range(1000)]
def create_node(s, cnt):
#print('s: ' + s)
cnt_l = 0
cnt_r = 0
for i in range(len(s)):
if s[i] == '(':
cnt_l += 1
... | Traceback (most recent call last):
File "/tmp/tmp0o9nd7bi/tmpj3qpxwla.py", line 1, in <module>
in1 = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s281315554 | p01841 | u011621222 | 1530177503 | Python | Python3 | py | Runtime Error | 30 | 5744 | 2487 | in1 = input()
in2 = input()
nodes = [[-1,-1,-1] for _ in range(800)]
nodes2 = [[-1,-1,-1] for _ in range(800)]
nodes3 = [[-1,-1,-1] for _ in range(800)]
def create_node(s, cnt):
#print('s: ' + s)
cnt_l = 0
cnt_r = 0
for i in range(len(s)):
if s[i] == '(':
cnt_l += 1
e... | Traceback (most recent call last):
File "/tmp/tmp7owbskoq/tmpa344lif9.py", line 1, in <module>
in1 = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s818337242 | p01841 | u011621222 | 1530178225 | Python | Python3 | py | Runtime Error | 200 | 34212 | 2496 | in1 = input()
in2 = input()
nodes = [[-1,-1,-1] for _ in range(100000)]
nodes2 = [[-1,-1,-1] for _ in range(100000)]
nodes3 = [[-1,-1,-1] for _ in range(100000)]
def create_node(s, cnt):
#print('s: ' + s)
cnt_l = 0
cnt_r = 0
for i in range(len(s)):
if s[i] == '(':
cnt_l += 1
... | Traceback (most recent call last):
File "/tmp/tmpimit7bn0/tmp_vox_4gr.py", line 1, in <module>
in1 = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s334233639 | p01845 | u633333374 | 1503189489 | Python | Python | py | Runtime Error | 40000 | 6364 | 309 | while 1:
r,w,c,a = map(int,raw_input().split())
if r == w == c == a == 0:
break
b = 0
sum = 0
if r % c == 0:
if r / c >= w:
b = 1
while b == 0:
sum += 1
r += a
if r % c == 0:
if r/c>=w:
b = 1
print sum | File "/tmp/tmpppw0y2k_/tmpm1eo1p75.py", line 16
print sum
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s445487087 | p01845 | u136916346 | 1530147656 | Python | Python3 | py | Runtime Error | 0 | 0 | 212 | while 1:
R0,W0,C,R=map(int,input().split())
if not R0 and not W0 and not C and not R:break
n=0
while 1:
if W0>1 and int((R0+R*n)/W0)==C:break
elif W0==1 and (R0+R*n)>=C:break
n+=1
print(n)
| Traceback (most recent call last):
File "/tmp/tmp12tsorxq/tmpftn4k85h.py", line 2, in <module>
R0,W0,C,R=map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s367307748 | p01846 | u078042885 | 1486428596 | Python | Python3 | py | Runtime Error | 0 | 0 | 542 | while 1:
s=input()
if s=='#':break
p=0
e=[[],[]]
for x in s:
if x=='b':e[p]+=['b']
elif x=='/':p+=1
else:
for j in range(int(x)):e[p]+=['.']
ans=''
a,b,c,d=map(int,input().split())
e[a-1][b-1],e[c-1][d-1]=e[c-1][d-1],e[a-1][b-1]
for i in range(2):
... | Traceback (most recent call last):
File "/tmp/tmpavoa2bp2/tmpkxidlnmx.py", line 2, in <module>
s=input()
^^^^^^^
EOFError: EOF when reading a line
| |
s545174551 | p01846 | u078042885 | 1486429057 | Python | Python3 | py | Runtime Error | 0 | 0 | 527 | while 1:
s=input()
if s=='#':break
p=0
e=[[],[]]
for x in s:
if x=='b':e[p]+=['b']
elif x=='/':p+=1
else:
for j in range(int(x)):e[p]+=['.']
ans=''
a,b,c,d=map(int,input().split())
e[a-1][b-1]='.'
e[c-1][d-1]='b'
for i in range(2):
if i... | Traceback (most recent call last):
File "/tmp/tmp4hza4yyn/tmpuar63l0s.py", line 2, in <module>
s=input()
^^^^^^^
EOFError: EOF when reading a line
| |
s142128738 | p01849 | u260980560 | 1501516060 | Python | Python3 | py | Runtime Error | 40000 | 7604 | 409 | while 1:
n, m = map(int, input().split())
if n == m == 0:
break
*S, = map(int, input().split())
*D, = map(int, input().split())
from itertools import permutations
ans = 10**18
for P in permutations(S):
Q = [0]*(n+1)
for i, e in enumerate(P):
Q[i+1] = P[i]... | Traceback (most recent call last):
File "/tmp/tmp6oakzqph/tmppzzb7fzf.py", line 2, in <module>
n, m = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s224449488 | p01849 | u260980560 | 1501516323 | Python | Python3 | py | Runtime Error | 40000 | 7700 | 432 | from itertools import permutations
while 1:
n, m = map(int, input().split())
if n == m == 0:
break
*S, = map(int, input().split())
*D, = map(int, input().split())
def solve(S, D):
for P in permutations(S):
Q = [0]*(n+1)
for i, e in enumerate(P):
... | Traceback (most recent call last):
File "/tmp/tmpohck1cjf/tmpf876n9lz.py", line 3, in <module>
n, m = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s872771974 | p01849 | u260980560 | 1501518132 | Python | Python3 | py | Runtime Error | 40000 | 7708 | 425 | from itertools import permutations
while 1:
n, m = map(int, input().split())
if n == m == 0:
break
*S, = map(int, input().split())
*D, = map(int, input().split())
def solve(S, D):
Q = [0]*(n+1)
for P in permutations(S):
for i, e in enumerate(P):
Q... | Traceback (most recent call last):
File "/tmp/tmph558c1nh/tmp5g1fw_mj.py", line 3, in <module>
n, m = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s221362866 | p01849 | u260980560 | 1501519497 | Python | Python3 | py | Runtime Error | 40000 | 7932 | 781 | from collections import deque
while 1:
n, m = map(int, input().split())
if n == m == 0:
break
*S, = map(int, input().split())
*D, = map(int, input().split())
deq = deque(S)
D.sort()
def dfs(r, idx, prev):
if idx == m:
return 0
if r == n:
s = 0... | Traceback (most recent call last):
File "/tmp/tmpxv6fzohp/tmpz7gj1yqr.py", line 3, in <module>
n, m = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s219518245 | p01852 | u349293999 | 1463459803 | Python | Python | py | Runtime Error | 0 | 0 | 54 | i = bin(int(raw_input()))
print len(str(i)[2:]) + "\n" | File "/tmp/tmp_64o1diz/tmpz5erqfce.py", line 2
print len(str(i)[2:]) + "\n"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s843470045 | p01858 | u011621222 | 1527852606 | Python | Python3 | py | Runtime Error | 20 | 5612 | 1376 | K = int(input())
Is = [input() for i in range(K)]
Ns = [input() for i in range(K)]
atk_I = 0
atk_N = 0
#"mamoru", "tameru", "kougekida"
#"Isono-kun", "Nakajima-kun", "Hikiwake-kun"
for i, n in zip(Is, Ns):
i_n = [i, n]
if (i_n.count("mamoru") == 2):
pass
elif (i_n.count("mamoru") == 1):
if (i_n.count("tameru") =... | Traceback (most recent call last):
File "/tmp/tmpw9e27ly_/tmpghq6857q.py", line 1, in <module>
K = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s275631656 | p01859 | u568192366 | 1530797069 | Python | Python3 | py | Runtime Error | 0 | 0 | 636 | #include<bits/stdc++.h>
using namespace std;
int ans = 1000;
bool dfs(int L0, int R0, int L1, int R1) {
if (L1 >= 5 and R1 >= 5) {
return true;
}
if (R0 <= 4 and L1 <= 4 and !dfs(R0+L1,R1,L0,R0))return true;
if (R0 <= 4 and R1 <= 4 and !dfs(L1,R0+R1,L0,R0))return true;
if (L0 <= 4 and L1 <= 4 and !dfs(L0+L1... | File "/tmp/tmpf6bxe9fh/tmp7unh2gf2.py", line 3
using namespace std;
^^^^^^^^^
SyntaxError: invalid syntax
| |
s279550451 | p01865 | u036236649 | 1490609991 | Python | Python3 | py | Runtime Error | 0 | 0 | 315 | import numpy as np
L = int(input())
N = int(input())
xs = []
ws = []
for i in range(N):
x, w = map(int, input().split())
xs.append(x)
ws.append(w)
xs = np.array(xs)
ws = np.array(ws)
s = sum(xs * ws)
if(s == 0):
print(0)
elif(s < 0):
print(1)
print(-s, 1)
else:
print(1)
print(s, -1) | Traceback (most recent call last):
File "/tmp/tmp8fr3hx44/tmpavmva7v0.py", line 2, in <module>
L = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s541653278 | p01865 | u036236649 | 1490610014 | Python | Python3 | py | Runtime Error | 0 | 0 | 315 | import numpy as np
L = int(input())
N = int(input())
xs = []
ws = []
for i in range(N):
x, w = map(int, input().split())
xs.append(x)
ws.append(w)
xs = np.array(xs)
ws = np.array(ws)
s = sum(xs * ws)
if(s == 0):
print(0)
elif(s < 0):
print(1)
print(-s, 1)
else:
print(1)
print(s, -1) | Traceback (most recent call last):
File "/tmp/tmpfafzvabi/tmps991xzh_.py", line 2, in <module>
L = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s044018770 | p01865 | u036236649 | 1490610338 | Python | Python3 | py | Runtime Error | 0 | 0 | 233 | import numpy as np
L = int(input())
N = int(input())
s = 0
for i in range(N):
x, w = map(int, input().split())
s += x * w
if(s == 0):
print(0)
elif(s < 0):
print(1)
print(1, -s)
else:
print(1)
print(-1, s) | Traceback (most recent call last):
File "/tmp/tmppwsobtm3/tmpwh1hvvbl.py", line 2, in <module>
L = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s201330467 | p01869 | u078042885 | 1486947127 | Python | Python3 | py | Runtime Error | 4820 | 29704 | 410 | import bisect
a=[]
def f(n,p):
m=-1<<20
x=bisect.bisect_left(a,n)
if a[x]==n:m=1
if a[p]**2>n:return m
if n%a[p]==0:m=f(n//a[p],p)+1
return max(m,f(n,p+1))
for i in range(1,19):
for j in range(1<<i):
b=''
for k in range(i):
if (j//(1<<k))%2:b+='2'
els... | Traceback (most recent call last):
File "/tmp/tmp2csg45xt/tmpcisdnnbg.py", line 19, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s326533131 | p01869 | u078042885 | 1486947930 | Python | Python3 | py | Runtime Error | 4760 | 29700 | 424 | import bisect
a=[]
def f(n,p):
m=-1<<20
x=bisect.bisect_left(a,n)
if a[x]==n and x!=len(a):m=1
if a[p]**2>n:return m
if n%a[p]==0:m=f(n//a[p],p)+1
return max(m,f(n,p+1))
for i in range(1,19):
for j in range(1<<i):
b=''
for k in range(i):
if (j//(1<<k))%2:b+='2'
... | Traceback (most recent call last):
File "/tmp/tmpt2ecr9ee/tmp3ohczmkh.py", line 19, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s324658831 | p01869 | u078042885 | 1486952121 | Python | Python3 | py | Runtime Error | 430 | 27396 | 378 | import bisect
a=[]
def f(a,bin,n):
if bin>n:return
if bin:a+=[bin]
f(a,bin*10+2,n)
f(a,bin*10+8,n)
def g(n,p):
m=-1<<20
x=bisect.bisect_left(a,n)
if x!=len(a) and a[x]==n:m=1
if a[p]**2>n:return m
if n%a[p]==0:m=g(n//a[p],p)+1
return max(m,g(n,p+1))
n=int(input())
if n&1:print(... | Traceback (most recent call last):
File "/tmp/tmp1dxzqpca/tmplbp88h7g.py", line 17, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s307987195 | p01869 | u078042885 | 1486952487 | Python | Python3 | py | Runtime Error | 450 | 32324 | 390 | import bisect
a=[]
def f(a,bin,n):
if bin>n:return
if bin:a+=[bin]
f(a,bin*10+2,n)
f(a,bin*10+8,n)
def g(n,p):
m=-1<<20
x=bisect.bisect_left(a,n)
if x!=len(a) and a[x]==n:m=1
if a[p]**2>n:return m
if n%a[p]==0:m=g(n//a[p],p)+1
return max(m,g(n,p+1))
n=int(input())
if n&1:print(... | Traceback (most recent call last):
File "/tmp/tmpd6ly8a8h/tmpp5ej2yyb.py", line 17, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s350771477 | p01869 | u078042885 | 1486952724 | Python | Python3 | py | Runtime Error | 450 | 32388 | 415 | import bisect
a=[]
def f(a,bin,n):
if bin>n:return
if bin:a+=[bin]
f(a,bin*10+2,n)
f(a,bin*10+8,n)
def g(n,p):
m=-1<<20
x=bisect.bisect_left(a,n)
if p>len(a):return m
if x!=len(a) and a[x]==n:m=1
if a[p]**2>n:return m
if n%a[p]==0:m=g(n//a[p],p)+1
return max(m,g(n,p+1))
n=i... | Traceback (most recent call last):
File "/tmp/tmpum8qsh81/tmpm2gevvzq.py", line 18, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s624011071 | p01901 | u372789658 | 1517107407 | Python | Python | py | Runtime Error | 10 | 4660 | 533 | # coding: utf-8
# Your code here!
effect_time = int(raw_input())
number_of_data = int(raw_input())
live_time =[]
longest_time = 0
for i in range (number_of_data):
begin_time,finish_time = list(map(int,raw_input().split()))
for j in range (begin_time,finish_time):
live_time.append(j)
for i in range (live... | File "/tmp/tmpfo8d4n7y/tmpip6403s5.py", line 18
print longest_time
^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s352010591 | p01905 | u847467233 | 1531300560 | Python | Python3 | py | Runtime Error | 0 | 0 | 491 | # AOJ 2805: Tournament
# Python3 2018.7.11 bal4u
def calc(l, n):
if n == 2:
if a[l] and a[l+1]: return [0, True]
if a[l] or a[l+1]: return [0, False]
return [1, False]
m = n >> 1
c1, f1 = calc(l, m)
c2, f2 = calc(l+m, m)
if f1 and f2: return [c1+c2, True]
if f1 or f2: return [c1+c2, False]
return [c1+c2+1... | Traceback (most recent call last):
File "/tmp/tmpnvw9_0fi/tmpx4bc61k9.py", line 17, in <module>
N, M = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s394967216 | p01905 | u819979588 | 1513583687 | Python | Python | py | Runtime Error | 0 | 0 | 80 | N, M = map(int, input().split())
a = map(int, input().split())
print(N - 1 - M) | Traceback (most recent call last):
File "/tmp/tmp7_odaed7/tmp9fjbar4q.py", line 1, in <module>
N, M = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s454700892 | p01905 | u614485948 | 1530177194 | Python | Python3 | py | Runtime Error | 0 | 0 | 297 | a = input().split(' ')
while a != ['0','0']:
recomend = [0 for _ in range(int(a[1]))]
for i in range(int(a[0])):
b = input().split(' ')
if recomend[int(b[0])-1] < int(b[1]):
recomend[int(b[0])-1] = int(b[1])
print(sum(recomend))
a = input().split(' ')
| Traceback (most recent call last):
File "/tmp/tmp06obx26i/tmp6wbxmv0q.py", line 1, in <module>
a = input().split(' ')
^^^^^^^
EOFError: EOF when reading a line
| |
s362641552 | p01905 | u614485948 | 1530184883 | Python | Python3 | py | Runtime Error | 0 | 0 | 684 | def make_alphabet(now_alphabet, alphabet):
next_alphabet = []
for n_al in now_alphabet:
for al in alphabet:
next_alphabet.append(n_al+al)
return next_alphabet
a = int(input())
b = []
for a in range(a):
b.append(input())
alphabet = [chr(ch) for ch in range(97,123)]
now_alphabet = alp... | Traceback (most recent call last):
File "/tmp/tmp74zbrfec/tmp4955h6yv.py", line 8, in <module>
a = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s447069683 | p01907 | u429835330 | 1530186082 | Python | Python3 | py | Runtime Error | 540 | 28476 | 279 | p = float(input())
N = int(input())
num = {}
num[1] = [0, 0]
for i in range(N-1):
x, y, c = map(int, input().split())
num[y] = [num[x][0]+1, c]
t = 0
for i in num.keys():
t += num[i][1] * (p**num[i][0])
d = 0
for i in num.keys():
d += p**num[i][0]
print(t+t*d)
| Traceback (most recent call last):
File "/tmp/tmptyw4rcs6/tmpnqtwkn59.py", line 1, in <module>
p = float(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s237102364 | p01923 | u967268722 | 1556099538 | Python | Python3 | py | Runtime Error | 0 | 0 | 390 | m,n=map(int,input().split())
a =[]
for _ in range(m):
a.append(list(map(int,input().split())))
for index in range(m):
a[index].append(sum(a[index]))
for a_column in a:
for num in a_column[:-1]:
print(num, end=' ')
print(a_column[-1])
for row_index in range(n+1):
sum = 0
for a_column in a... | Traceback (most recent call last):
File "/tmp/tmpfyefzuvv/tmp2hoptrce.py", line 1, in <module>
m,n=map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s460846690 | p01923 | u967268722 | 1556099551 | Python | Python3 | py | Runtime Error | 0 | 0 | 390 | m,n=map(int,input().split())
a =[]
for _ in range(m):
a.append(list(map(int,input().split())))
for index in range(m):
a[index].append(sum(a[index]))
for a_column in a:
for num in a_column[:-1]:
print(num, end=' ')
print(a_column[-1])
for row_index in range(n+1):
sum = 0
for a_column in a... | Traceback (most recent call last):
File "/tmp/tmpjxrhxtso/tmpgdk06sjg.py", line 1, in <module>
m,n=map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s942703166 | p01924 | u260980560 | 1499831452 | Python | Python | py | Runtime Error | 0 | 0 | 269 | while 1:
t, d, l = map(int, raw_input().split())
rest = ans = 0
for i in xrange(t):
x = int(raw_input())
if l <= x:
rest = d
elif rest:
rest -= 1
if rest and i < t-1:
ans += 1
print ans | File "/tmp/tmptwt1s5oq/tmp188qo1c9.py", line 12
print ans
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s606186393 | p01924 | u958378108 | 1530614815 | Python | Python3 | py | Runtime Error | 0 | 0 | 336 | while True:
T,D,L = map(int,input().split())
if T==0 and D ==0 and L == 0:
break
x = [int(input()) for i in range(T)]
l = [0]*T
for i in range(T-1):
if x[i] >= L:
for j in range(D):
l[i+j] = 1
total = 0
for i in range(T-1):
total += l[i]
... | Traceback (most recent call last):
File "/tmp/tmp_54dp3hp/tmp1vdph4hc.py", line 2, in <module>
T,D,L = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s960673746 | p01924 | u958378108 | 1530615441 | Python | Python3 | py | Runtime Error | 0 | 0 | 373 | while True:
T,D,L = map(int,input().split())
if T==0 and D ==0 and L == 0:
break
x = [int(input()) for i in range(T)]
l = [0]*(T-1)
for i in range(T-1):
if x[i] >= L:
for j in range(D):
if i+j<T-1:
l[i+j] = 1
total = 0
for i in ... | Traceback (most recent call last):
File "/tmp/tmp1lpesmyl/tmp713d1fw2.py", line 2, in <module>
T,D,L = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s622032866 | p01924 | u958378108 | 1530615545 | Python | Python3 | py | Runtime Error | 0 | 0 | 373 | while True:
T,D,L = map(int,input().split())
if T==0 and D ==0 and L == 0:
break
x = [int(input()) for i in range(T)]
l = [0]*(T-1)
for i in range(T-1):
if x[i] >= L:
for j in range(D):
if i+j<T-1:
l[i+j] = 1
total = 0
for i in ... | Traceback (most recent call last):
File "/tmp/tmprfhncyb2/tmp9vim3ttp.py", line 2, in <module>
T,D,L = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s652741636 | p01924 | u958378108 | 1530615570 | Python | Python3 | py | Runtime Error | 0 | 0 | 372 | while True:
T,D,L = map(int,input().split())
if T==0 and D ==0 and L == 0:
break
x = [int(input()) for i in range(T)]
l = [0]*1000
for i in range(T-1):
if x[i] >= L:
for j in range(D):
if i+j<T-1:
l[i+j] = 1
total = 0
for i in r... | Traceback (most recent call last):
File "/tmp/tmp_mhrzygr/tmpnd1lph9k.py", line 2, in <module>
T,D,L = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s243478589 | p01924 | u958378108 | 1530618951 | Python | Python3 | py | Runtime Error | 0 | 0 | 531 | while True:
T,D,L = map(int,input().split())
if T==0 and D ==0 and L == 0:
break
x = [int(input()) for i in range(T)]
l = [0]*(T-1)
i = 0
m = 0
while i<T-1:
#for i in range(T-1):
if m < i:
m = i
if x[i] >= L and D > m-i:
tmp=m
... | Traceback (most recent call last):
File "/tmp/tmpnw8j400_/tmp1clan2dy.py", line 2, in <module>
T,D,L = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s406788485 | p01924 | u958378108 | 1530618954 | Python | Python3 | py | Runtime Error | 0 | 0 | 531 | while True:
T,D,L = map(int,input().split())
if T==0 and D ==0 and L == 0:
break
x = [int(input()) for i in range(T)]
l = [0]*(T-1)
i = 0
m = 0
while i<T-1:
#for i in range(T-1):
if m < i:
m = i
if x[i] >= L and D > m-i:
tmp=m
... | Traceback (most recent call last):
File "/tmp/tmp_kq_26xy/tmpr_4a2wu0.py", line 2, in <module>
T,D,L = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s731971799 | p01926 | u260980560 | 1499883440 | Python | Python | py | Runtime Error | 40000 | 16348 | 801 | while 1:
n, m = map(int, raw_input().split())
if n == m == 0:
break
S = map(int, raw_input().split())
left = -1; right = max(S)+2
def check(mid):
if 1+mid <= S[0]:
return 10**9
cnt = 0; l = 1
target = S[n-1] - mid
for i in xrange(n-1):
... | File "/tmp/tmprbws4bfu/tmprxpeo014.py", line 27
print -1
^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s239291964 | p01926 | u260980560 | 1499883786 | Python | Python | py | Runtime Error | 0 | 0 | 980 | while 1:
n, m = map(int, raw_input().split())
if n == m == 0:
break
S = map(int, raw_input().split())
left = -1; right = max(S)+2
def check(mid):
if 1+mid <= S[0]:
return 10**9
cnt = 0; l = 1
target = S[n-1] - mid
for i in xrange(n-1):
... | File "/tmp/tmpyvgannnm/tmp9tv7wocp.py", line 32
print -1
^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s114679864 | p01926 | u724548524 | 1526666532 | Python | Python3 | py | Runtime Error | 0 | 0 | 971 | import bisect
def countM(x):
b = 0
l = 1
if l + x < s[0]:
return - 1
while True:
b += 1
if l + x > s[-1]:
break
i = bisect.bisect_right(s, l)
if l + x > s[i]:
l += max(1, x - min(abs(l - s[i - 1]), abs(l - s[i])))
else:
... | Traceback (most recent call last):
File "/tmp/tmp86tvq76c/tmp22egl1n7.py", line 35, in <module>
n, m = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s944389615 | p01926 | u724548524 | 1526667552 | Python | Python3 | py | Runtime Error | 0 | 0 | 888 | import bisect
def countM(x):
b = 0
l = 1
if l + x < s[0]:
return - 1
while True:
b += 1
if l + x > s[-1]:
break
i = bisect.bisect_right(s, l)
if l + x > s[i]:
l += max(1, x - min(abs(l - s[i - 1]), abs(l - s[i])))
else:
... | Traceback (most recent call last):
File "/tmp/tmp6sozh29c/tmpwvn06fn8.py", line 29, in <module>
n, m = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s815436011 | p01937 | u441981269 | 1518944441 | Python | Python | py | Runtime Error | 0 | 0 | 4982 |
import java.io.*;
import java.util.*;
/**
* AIZU ONLINE JUDGE
* 2837 Cryptex
* 2018/02/17
*/
public class Main {
int N;
int M;
int[] T;
int nidx; // 負になる場所
// 単純最小値(2倍)を返す
int min() {
int sum1 = 0;
int sum2 = 0;
int max1 = 0;
int max2 = 0;
for(... | File "/tmp/tmphkcvzdwd/tmpfjqwulex.py", line 8
* 2018/02/17
^
SyntaxError: leading zeros in decimal integer literals are not permitted; use an 0o prefix for octal integers
| |
s905741467 | p01939 | u815718214 | 1505878077 | Python | Python3 | py | Runtime Error | 60 | 7708 | 169 | s = input()
n, m = s.split()
n = int(n)
m = int(m)
maxd = m // (n - 1)
A = m - maxd * (n-1) + 1
B = m - (n-1) + 1
ans = (A+B)*maxd + (m+1)
ans %= 1000000007
print(ans) | Traceback (most recent call last):
File "/tmp/tmp2ak784fp/tmpb6elqhmh.py", line 1, in <module>
s = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s914872612 | p01939 | u864932961 | 1505879807 | Python | Python | py | Runtime Error | 10 | 6452 | 135 | asd = raw_input()
asdd = asd.split()
n = int(asdd[0])
m = int(asdd[1])
x=(m+1)/(n-1)
print (2*((m+1)*x-x*(n-1)*(x+1)/2)+m+1)%1000000007 | Traceback (most recent call last):
File "/tmp/tmp80og08u0/tmphjkpcfgn.py", line 1, in <module>
asd = raw_input()
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s369345445 | p01939 | u864932961 | 1505879918 | Python | Python | py | Runtime Error | 10 | 6472 | 183 | asd = raw_input()
asdd = asd.split()
n = int(asdd[0])
if n == 1:
print m+1%1000000007
exit(0)
m = int(asdd[1])
x=(m+1)/(n-1)
print (2*((m+1)*x-x*(n-1)*(x+1)/2)+m+1)%1000000007 | File "/tmp/tmphg0_51mq/tmpj3js2mxw.py", line 5
print m+1%1000000007
^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s162004671 | p01941 | u260980560 | 1505881300 | Python | Python3 | py | Runtime Error | 0 | 0 | 673 | N, C = map(int, input().split())
events = []
for i in range(N):
events.append(list(map(int, input().split())))
dp = [[0]*201 for i in range(C+1)]
for j in range(C+1):
for k in range(-1000, 1001):
if k != 0:
dp[j][k] = -10**18
for a, b, c in events:
for j in range(C-c, -1, -1):
f... | Traceback (most recent call last):
File "/tmp/tmpipd9ddyz/tmpv7ctc3yr.py", line 1, in <module>
N, C = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s993411339 | p01942 | u260980560 | 1505897352 | Python | Python3 | py | Runtime Error | 20 | 7892 | 1316 | from heapq import heappush, heappop
H, W, T, Q = map(int, input().split())
que = []
state = [[0]*W for i in range(H)]
data1 = [[0]*(W+1) for i in range(H+1)]
data2 = [[0]*(W+1) for i in range(H+1)]
def get(data, h, w):
s = 0
while h:
w0 = w
el = data[h]
while w0:
s += el[w0]
... | Traceback (most recent call last):
File "/tmp/tmpha0ip06y/tmpusvkyw26.py", line 2, in <module>
H, W, T, Q = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s542473808 | p01969 | u448934746 | 1522207816 | Python | Python3 | py | Runtime Error | 0 | 0 | 2373 | #include <stdio.h>
#include <stdlib.h>
#define inf (int)(1e8)
int alf_to_num(char c){
return (int)c - (int)'A';
}
int main(){
int H, W, i, j, k, nowv;
char s, t;
scanf("%d %d %c %c", &H, &W, &s, &t);
char **a = (char **)malloc(sizeof(char *) * (H + 2));
for(i = 0; i <= H + 1; i++){
a[i] = (char *)malloc(sizeo... | File "/tmp/tmp7gm2ifj6/tmp0i8opv0e.py", line 5
int alf_to_num(char c){
^^^^^^^^^^
SyntaxError: invalid syntax
| |
s403027268 | p01970 | u549152235 | 1522209245 | Python | Python3 | py | Runtime Error | 0 | 0 | 5518 | using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Globalization;
using System.Diagnostics;
using Pair = System.Collections.Generic.KeyValuePair<int, int>;
class Program
{
static void Main()
{
Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { ... | File "/tmp/tmp2e3ykmzp/tmp0najfyy_.py", line 106
//oneの後に0を置くとき、zero_primeはone_primeになる
^
SyntaxError: invalid character '、' (U+3001)
| |
s854596738 | p01973 | u273756488 | 1532183919 | Python | Python3 | py | Runtime Error | 20 | 5604 | 324 | S = input()
n = int(input())
P = [input() for i in range(n)]
ans = 0
for p in P:
i = 0
while i < len(S):
for q in p:
if S[i] != q:
break
i += 1
else:
S = S[:i-1] + '*' + S[i:]
ans += 1
continue
i += 1
print(a... | Traceback (most recent call last):
File "/tmp/tmpjo77p4ld/tmpdlvzp4je.py", line 1, in <module>
S = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s099354528 | p01973 | u273756488 | 1532184066 | Python | Python3 | py | Runtime Error | 20 | 5600 | 373 | S = input()
n = int(input())
P = [input() for i in range(n)]
ans = 0
for p in P:
i = 0
while i < len(S):
for q in p:
if S[i] != q:
break
i += 1
if i > len(S):
break
else:
S = S[:i-1] + '*' + S[i:]
ans ... | Traceback (most recent call last):
File "/tmp/tmpgeo2binj/tmp3hy20m96.py", line 1, in <module>
S = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s158524109 | p01981 | u888550928 | 1531203448 | Python | Python3 | py | Runtime Error | 0 | 0 | 327 | while True:
a = list(map(str, input().split()))
if a[0] == "0":
break
elif int(a[1]) <= 30:
print(" ".join(a))
elif int(a[1]) == 31 and int(a[2]) <= 4:
print(" ".join(a))
else:
a[0] = "?"
s = int(a[1])
s -= 30
a[1] = str(s)
print(" ".jo... | Traceback (most recent call last):
File "/tmp/tmpglwobeos/tmp3469u94k.py", line 2, in <module>
a = list(map(str, input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s454862003 | p01982 | u209989098 | 1530607870 | Python | Python3 | py | Runtime Error | 0 | 0 | 286 | a = list(map(int,input().split()))
b = []
su = 0
s = 0
for i in range(a[0]):
b.append(int(input()))
for i in range(a[1],a[2]+1):
for j in range(a[0]):
if a % b[j] == 0:
su += 1
if(j % 2 == 0):
s += 1
break
if su == 0:
if a[0] % 2 == 0:
s += 1
su = 0
print(s)
| Traceback (most recent call last):
File "/tmp/tmp_h0y3fvk/tmp6dawgzmg.py", line 1, in <module>
a = list(map(int,input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s839456968 | p01983 | u731941832 | 1530687666 | Python | Python3 | py | Runtime Error | 0 | 0 | 558 | def solve(s,p):
if s[0]!='[':
return[p//1000,p//100%10,p//10%10,p%10][ord(s[0])-ord('a')]
i=3
while s.count('[',2,i)!=s.count(']',2,i):
i+=1
j=i+1
while s.count('[',i,j)!=s.count(']',i,j):
j+=1
l=solve(s[2:i])
r=solve(s[i:j])
if s[1]=='+':
return l|r
e... | Traceback (most recent call last):
File "/tmp/tmprye3ixa0/tmp9aala4lj.py", line 19, in <module>
s=input()
^^^^^^^
EOFError: EOF when reading a line
| |
s862302416 | p01983 | u731941832 | 1530687686 | Python | Python3 | py | Runtime Error | 0 | 0 | 562 | def solve(s,p):
if s[0]!='[':
return[p//1000,p//100%10,p//10%10,p%10][ord(s[0])-ord('a')]
i=3
while s.count('[',2,i)!=s.count(']',2,i):
i+=1
j=i+1
while s.count('[',i,j)!=s.count(']',i,j):
j+=1
l=solve(s[2:i],p)
r=solve(s[i:j],p)
if s[1]=='+':
return l|r
... | Traceback (most recent call last):
File "/tmp/tmpu0vl2ypw/tmp0_qpnwaq.py", line 19, in <module>
s=input()
^^^^^^^
EOFError: EOF when reading a line
| |
s079701253 | p01983 | u731941832 | 1530688442 | Python | Python3 | py | Runtime Error | 0 | 0 | 562 | def solve(s,p):
if s[0]!='[':
return[p//1000,p//100%10,p//10%10,p%10][ord(s[0])-ord('a')]
i=3
while s.count('[',2,i)!=s.count(']',2,i):
i+=1
j=i+1
while s.count('[',i,j)!=s.count(']',i,j):
j+=1
l=solve(s[2:i],p)
r=solve(s[i:j],p)
if s[1]=='+':
return l|r
... | Traceback (most recent call last):
File "/tmp/tmp1r6qxpi7/tmph0k5lhbd.py", line 19, in <module>
s=input()
^^^^^^^
EOFError: EOF when reading a line
| |
s234898373 | p01984 | u188938853 | 1530523321 | Python | Python3 | py | Runtime Error | 0 | 0 | 1256 | # 文字列s以下のa,bを使った短歌数
def calc(a, b, s):
sz = len(s)
dp = [[0] * 2 for i in range(sz + 1)]
dp[0][0] = 1
dp[0][1] = 0
for i in range(sz):
if s[i] == str(a):
dp[i + 1][0] += dp[i][0]
elif s[i] > str(a):
if i == 0 and a == 0:
a == 0
else... | Traceback (most recent call last):
File "/tmp/tmpsij8yggd/tmpymuxrcxa.py", line 44, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s763707462 | p02018 | u126202702 | 1545547039 | Python | Python3 | py | Runtime Error | 0 | 0 | 108 | n = int(input())
a = list(map(int, input().split()))
r = 0
for j in a:
if a % 2 == 0:
r += 1
print(r)
| Traceback (most recent call last):
File "/tmp/tmpft1lfm7x/tmpipwlm_04.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s451248125 | p02099 | u099826363 | 1528979376 | Python | Python3 | py | Runtime Error | 0 | 0 | 350 | N = int(input())
A = []
for i in range(N):
a = int(input())
A.append(a)
ans = [0]*len(A)
for i in range(N-1):
for j in range(i+1,N):
if A[i]>A[j]:
ans[i]+=3
elif A[i]==A[j]:
ans[i]+=1
ans[j]+=1
elif A[i]<A[j]:
ans[j]+=3
for i in range... | Traceback (most recent call last):
File "/tmp/tmpgg4y5136/tmpe84wg8k9.py", line 1, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s986193934 | p02100 | u182044618 | 1490238968 | Python | Python3 | py | Runtime Error | 20 | 7824 | 1233 | def parse(S):
poly = []
t = []
for x in S.split('+'):
if '-' in x:
t = t + ['-' + a if i != 0 else a for i, a in enumerate(x.split('-'))]
else:
t.append(x)
for x in t:
if '^' in x:
t = x.split('x^')
if len(t[0]) == 0:
... | Traceback (most recent call last):
File "/tmp/tmpl3t7wjz_/tmp78zso3z9.py", line 64, in <module>
S=input()
^^^^^^^
EOFError: EOF when reading a line
| |
s747388815 | p02100 | u182044618 | 1490239339 | Python | Python3 | py | Runtime Error | 30 | 7828 | 1314 | def parse(S):
poly = []
t = []
for x in S.split('+'):
if '-' in x:
t = t + ['-' + a if i != 0 else a for i, a in enumerate(x.split('-'))]
else:
t.append(x)
for x in t:
if '^' in x:
t = x.split('x^')
if len(t[0]) == 0:
... | Traceback (most recent call last):
File "/tmp/tmp2k_66eu8/tmpy42onvk9.py", line 67, in <module>
S=input()
^^^^^^^
EOFError: EOF when reading a line
| |
s133200749 | p02100 | u724548524 | 1526609567 | Python | Python3 | py | Runtime Error | 30 | 6352 | 1646 | import copy
s = input()
k = [0] * 6
t = []
while True:
i = 0
if "+" in s[1:]:
i = 1 + s[1:].index("+")
if "-" in s[1:]:
if i > 0:i = min(i, 1 + s[1:].index("-"))
else:i = 1 + s[1:].index("-")
if i == 0:
k[0] = int(s)
break
j = s.index("x")
if j + 3 == i:
... | Traceback (most recent call last):
File "/tmp/tmpv5_srko5/tmpciyodls8.py", line 2, in <module>
s = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s323927433 | p02100 | u858560358 | 1528973568 | Python | Python3 | py | Runtime Error | 240 | 5584 | 254 | S = input().replace('^', '**').replace('x', '*1*(x)')[1:]
for i in range(2000, -2001, -1):
if i == 0: continue
T = S.replace('x', str(i))
#print(T, eval(T))
if eval(T) == 0:
print('(x{:+})'.format(-i), end='')
else:
print()
| Traceback (most recent call last):
File "/tmp/tmpcjdhvbjh/tmpmt79m26y.py", line 1, in <module>
S = input().replace('^', '**').replace('x', '*1*(x)')[1:]
^^^^^^^
EOFError: EOF when reading a line
| |
s161730820 | p02100 | u858560358 | 1528973711 | Python | Python3 | py | Runtime Error | 180 | 5584 | 275 | S = input().replace('+x', '+1x').replace('^', '**').replace('x', '*1*(x)')[1:]
for i in range(2000, -2001, -1):
if i == 0: continue
T = S.replace('x', str(i))
#print(T, eval(T))
if eval(T) == 0:
print('(x{:+})'.format(-i), end='')
else:
print()
| Traceback (most recent call last):
File "/tmp/tmpojevgr7q/tmp3s64rac8.py", line 1, in <module>
S = input().replace('+x', '+1x').replace('^', '**').replace('x', '*1*(x)')[1:]
^^^^^^^
EOFError: EOF when reading a line
| |
s035309247 | p02124 | u220567890 | 1522116426 | Python | Python3 | py | Runtime Error | 0 | 0 | 40 | print("ai1333"+"3"*"int(input())//100))
| File "/tmp/tmpo7s64ala/tmpmc3wptez.py", line 1
print("ai1333"+"3"*"int(input())//100))
^
SyntaxError: unterminated string literal (detected at line 1)
| |
s936687428 | p02126 | u724548524 | 1526521736 | Python | Python3 | py | Runtime Error | 0 | 0 | 355 | n, m, c = map(int, input().split())
l = (0,) + tuple(map(int, input().split()))
a = [0] * (c + 1)
w = [tuple(map(int, input().split())) for _ in range(n)]
w.sort(key = lambda x:x[1], reverse = True)
v = 0
p = 0
for i in range(n):
if l[w[i][0]]:
l[w[i][0]] -= 1
v += w[i][1]
p += 1
if ... | Traceback (most recent call last):
File "/tmp/tmpxm317fvy/tmpivz2yjs7.py", line 1, in <module>
n, m, c = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s412753928 | p02233 | u424720817 | 1531801224 | Python | Python3 | py | Runtime Error | 0 | 0 | 308 | def memolize(f):
cache = {}
def helper(x):
if x not in cache:
cache[x] = f(x)
return cache[x]
return helper
@memolize
def fib(n):
if n == 0:
return 1
elif n == 1:
return 1
return fib(n - 1) + fib(n - 2)
n = int(input())
print(fib(n))
| File "/tmp/tmpw1c2scqd/tmp2tzi8bgd.py", line 7
return cache[x]
^
IndentationError: unindent does not match any outer indentation level
| |
s063773623 | p02233 | u623996423 | 1540977011 | Python | Python3 | py | Runtime Error | 0 | 0 | 159 | def fib(n):
l = [0] * (n+1)
l[0] = 1
l[1] = 1
for i in range(2,n+1):
l[i] = l[i-2] + l[i-1]
return l[i]
print(fib(int(input())))
| Traceback (most recent call last):
File "/tmp/tmp0k26ni2c/tmpkjdf3w5w.py", line 9, in <module>
print(fib(int(input())))
^^^^^^^
EOFError: EOF when reading a line
| |
s202926197 | p02233 | u623996423 | 1540977057 | Python | Python3 | py | Runtime Error | 0 | 0 | 159 | def fib(n):
l = [0] * (n+1)
l[0] = 1
l[1] = 1
for i in range(2,n+1):
l[i] = l[i-2] + l[i-1]
return l[i]
print(fib(int(input())))
| Traceback (most recent call last):
File "/tmp/tmpoej5mse3/tmpiagxzjxo.py", line 9, in <module>
print(fib(int(input())))
^^^^^^^
EOFError: EOF when reading a line
| |
s065858507 | p02233 | u580607517 | 1421150404 | Python | Python | py | Runtime Error | 20 | 4200 | 181 | cache = []
def fib(x):
if x in cache:
return cache[x]
elif x == 0 or x == 1:
return 1
else:
v = fib(x - 1) + fib(x - 2)
cache[x] = v
return v
x = input()
print fib(x) | File "/tmp/tmp3cixwvmc/tmpz8e9s8xv.py", line 14
print fib(x)
^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s833222732 | p02233 | u567380442 | 1422184827 | Python | Python3 | py | Runtime Error | 0 | 0 | 313 | def memoize(f):
cache = {}
def helper(x):
if x not in cache:
cache[x] = f(x)
return cache[x]
return helper
@memoize
def fib(n):
if n in (0, 1):
return 1
else:
return fib(n - 1) + fib(n - 2)
pritn(fib(int(input()))) | Traceback (most recent call last):
File "/tmp/tmpxkdgx51z/tmp1bis_gru.py", line 16, in <module>
pritn(fib(int(input())))
^^^^^
NameError: name 'pritn' is not defined. Did you mean: 'print'?
| |
s534812897 | p02233 | u619765879 | 1453256980 | Python | Python | py | Runtime Error | 0 | 0 | 159 | def fib(n):
if F[n] != 0:
return F[n]
elif n==0 or n==1:
F[n] = 1
else:
F[n] = fib(n-1) + fib(n-2)
return F[n]
n = input()
print fib(n) | File "/tmp/tmpflq4c2h1/tmpkd33fdw6.py", line 14
print fib(n)
^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s125018867 | p02233 | u619765879 | 1453257022 | Python | Python | py | Runtime Error | 0 | 0 | 166 | def fib(n):
if F[n] != 0:
return F[n]
elif n==0 or n==1:
F[n] = 1
else:
F[n] = fib(n-1) + fib(n-2)
return F[n]
n = input()
F = []
print fib(n) | File "/tmp/tmp0lnt3t50/tmphgfvchci.py", line 15
print fib(n)
^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s506235782 | p02233 | u619765879 | 1453257040 | Python | Python | py | Runtime Error | 0 | 0 | 169 | def fib(n):
if F[n] != 0:
return F[n]
elif n==0 or n==1:
F[n] = 1
else:
F[n] = fib(n-1) + fib(n-2)
return F[n]
n = input()
F = []*44
print fib(n) | File "/tmp/tmpdk9z3vop/tmpfrxe4gab.py", line 15
print fib(n)
^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s266080684 | p02233 | u731976921 | 1453257065 | Python | Python | py | Runtime Error | 0 | 0 | 216 | memo = {}
def fib_memo(n):
if n <= 1:
return n
if n in memo: # 動的計画法とも
return memo[n]
memo[n] = fib_memo(n - 1) + fib_memo(n - 2)
return memo[n]
n = int(raw_input())
print fib_memo(n) | File "/tmp/tmp68059nde/tmpztpbsf9e.py", line 13
print fib_memo(n)
^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s692338174 | p02233 | u619765879 | 1453257087 | Python | Python | py | Runtime Error | 0 | 0 | 168 | def fib(n):
if F[n] != 0:
return F[n]
elif n==0 or n==1:
F[n] = 1
else:
F[n] = fib(n-1) + fib(n-2)
return F[n]
n = input()
F = [44]
print fib(n) | File "/tmp/tmpovib7rii/tmp_5_y5kc9.py", line 15
print fib(n)
^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s785211783 | p02233 | u619765879 | 1453257210 | Python | Python | py | Runtime Error | 0 | 0 | 168 | def fib(n):
if F[n] != 0:
return F[n]
elif n==0 or n==1:
F[n] = 1
else:
F[n] = fib(n-1) + fib(n-2)
return F[n]
n = input()
F = [45]
print fib(n) | File "/tmp/tmpi4im1fcc/tmp0vlykecr.py", line 15
print fib(n)
^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s096703009 | p02233 | u731976921 | 1453257641 | Python | Python | py | Runtime Error | 0 | 0 | 216 | memo = {}
def fib_memo(n):
if n <= 1:
return 1
if n in memo: # 動的計画法とも
return memo[n]
memo[n] = fib_memo(n - 1) + fib_memo(n - 2)
return memo[n]
x = int(raw_input())
print fib_memo(x) | File "/tmp/tmp1x7qg0ff/tmp763sfvgl.py", line 13
print fib_memo(x)
^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s217396416 | p02233 | u731710433 | 1456989812 | Python | Python3 | py | Runtime Error | 0 | 0 | 142 | def fib(n):
n1 = n2 = 1
for _ in range(n - 1):
tmp = n1 + n2
n1, n2 = n2, tmp
return tmp
print(fib(int(input()))) | Traceback (most recent call last):
File "/tmp/tmpaeqzogog/tmpw23ok55x.py", line 8, in <module>
print(fib(int(input())))
^^^^^^^
EOFError: EOF when reading a line
| |
s640637230 | p02233 | u648595404 | 1458826805 | Python | Python3 | py | Runtime Error | 0 | 0 | 59 | n = int(input())
for i in range(n):
a,b = b,a+b
print(a) | Traceback (most recent call last):
File "/tmp/tmph0he2v6i/tmpow2vulws.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s383009680 | p02233 | u224288634 | 1458981400 | Python | Python3 | py | Runtime Error | 0 | 0 | 183 | def fibo(n):
S=[1,1]
s=1
if n>1:
for i in range(2,n+1):
S.append(S[i-1]+S[i-2])
s=S[i]
return s
def main():
if __name__=="__main__":
n=input()
print(fibo(n))
main() | Traceback (most recent call last):
File "/tmp/tmppg7byx9u/tmp6zrkaqhs.py", line 15, in <module>
main()
File "/tmp/tmppg7byx9u/tmp6zrkaqhs.py", line 12, in main
n=input()
^^^^^^^
EOFError: EOF when reading a line
| |
s729689597 | p02233 | u072053884 | 1460173729 | Python | Python3 | py | Runtime Error | 0 | 0 | 219 | answer_list = [1, 1] + [None] * 43
def fib(num):
ans = answer_list[num]
if ans:
return ans
ans = fib(num - 1) + fib(num - 2)
answer_list[num] = ans
return ans
n = int(input)
print(fib(n)) | Traceback (most recent call last):
File "/tmp/tmpy54olhs4/tmpnsbggfxf.py", line 12, in <module>
n = int(input)
^^^^^^^^^^
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'builtin_function_or_method'
| |
s364537971 | p02233 | u661326643 | 1467728583 | Python | Python3 | py | Runtime Error | 0 | 0 | 183 | if __name__ == "__main__":
n = input()
F = []
F.append(1)
F.append(1)
for i in range(2,n+1):
F.append(F[i-1] + F[i-2])
print(F[i])
print(F[n]) | Traceback (most recent call last):
File "/tmp/tmpak4vse60/tmplwwsa1wl.py", line 2, in <module>
n = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s733122771 | p02233 | u811733736 | 1480476856 | Python | Python3 | py | Runtime Error | 20 | 7712 | 589 | class Fibonacci(object):
memo = [1, 1]
def __init__(self):
pass
def get_nth(self, n):
if n <= len(Fibonacci.memo):
return Fibonacci.memo[n]
for i in range(len(Fibonacci.memo), n+1):
result = Fibonacci.memo[i-1] + Fibonacci.memo[i-2]
Fibonacci.memo... | Traceback (most recent call last):
File "/tmp/tmpbihso0k0/tmpyrtx3cfh.py", line 17, in <module>
num = int(input())
^^^^^^^
EOFError: EOF when reading a line
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.