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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s911576273 | p00514 | u611853667 | 1374438640 | Python | Python | py | Runtime Error | 0 | 0 | 229 | def comb(a, b):
if(a < b or b < 0):return 0
if(b == 0):return 1
if(b > a - b):return comb(a, a - b)
return comb(a, b - 1) * (a - b + 1) / b
a, b, c = map(int, raw_input().split())
c -= a * b
print comb(c + a - 1, c) | File "/tmp/tmpyj3bb0vq/tmpjo5pgj34.py", line 3
if(b == 0):return 1
TabError: inconsistent use of tabs and spaces in indentation
| |
s113879747 | p00514 | u611853667 | 1374438678 | Python | Python | py | Runtime Error | 20 | 4224 | 232 | def comb(a, b):
if(a < b or b < 0):return 0
if(b == 0):return 1
if(b > a - b):return comb(a, a - b)
return comb(a, b - 1) * (a - b + 1) / b
a, b, c = map(int, raw_input().split())
c -= a * b
print comb(c + a - 1, c) | File "/tmp/tmpbypjdxm0/tmp5o8jvg4o.py", line 9
print comb(c + a - 1, c)
^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s241323673 | p00514 | u514537648 | 1388501296 | Python | Python | py | Runtime Error | 0 | 0 | 230 | def kaijou(n):
res=1
for i in xrange(1,x+1):
res*=i
return res
def comb(a,b):
if(a<b or b<0):return 0
if(b==0):return 1
return kaijou(a)/kaijou(b)/kaijou(a-b)
a,b,c=map(int,raw_input().split())
c-=a*b
print comb(c+a-1,c) | File "/tmp/tmpy1jy_cbi/tmpiyrk2uzr.py", line 14
print comb(c+a-1,c)
^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s272531633 | p00516 | u126478680 | 1546084898 | Python | Python3 | py | Runtime Error | 0 | 0 | 327 | # coding: utf-8
import numpy as np
N, M = list(map(int, input().split(' ')))
A = [int(input()) for _ in range(N)]
B = [int(input()) for _ in range(M)]
scores = [0 for _ in range(N)]
for j in range(M):
for i in range(N):
if A[i] <= B[j]:
scores[i] += 1
break
print(np.argmax(scores... | Traceback (most recent call last):
File "/tmp/tmp4_wqt_00/tmpe9k_l433.py", line 5, in <module>
N, M = list(map(int, input().split(' ')))
^^^^^^^
EOFError: EOF when reading a line
| |
s453799187 | p00516 | u811733736 | 1509451238 | Python | Python3 | py | Runtime Error | 0 | 0 | 2622 | # -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0593
"""
import sys
from sys import stdin
from collections import namedtuple, Counter
input = stdin.readline
class RMQ(object):
INT_MAX = 2**31 - 1
def __init__(self, nn, init_val=0):
self.n = 1
while self.n... | File "/tmp/tmpfrrs5__v/tmpr837qj1w.py", line 61
result = rq.find(0, v) # ?????????v?????§???????????????????????§??????????????¢????????¶????????????
^
IndentationError: unindent does not match any outer i... | |
s668649323 | p00516 | u660774699 | 1398870789 | Python | Python | py | Runtime Error | 0 | 0 | 339 | n, m = map(int, input().split())
a = [int(input()) for i in range(n)]
b = [int(input()) for i in range(m)]
no = [114514] * 1919
for i, t in enumerate(a):
no[t] = i + 1
for i in range(1145):
no[i + 1] = min(no[i + 1], no[i])
from collections import Counter
c = Counter()
for t in b:
c[no[t]] += 1
print(c.mo... | Traceback (most recent call last):
File "/tmp/tmp0ux8klbq/tmp5luz_h9k.py", line 1, in <module>
n, m = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s482515124 | p00519 | u894114233 | 1472798104 | Python | Python | py | Runtime Error | 40000 | 1113836 | 1114 | from collections import deque
import heapq
def dijkstra(s,g,m):
color=[0]*n
dis=[float('inf')]*n
dis[s]=0
heapq.heappush(pq,[0,s])
while len(pq)!=0:
t,u=heapq.heappop(pq)
color[u]=2
if dis[u]<t:
continue
for v in g[u]:
if color[v]!=2:
... | Traceback (most recent call last):
File "/tmp/tmpmow7w1gm/tmpkh302gbc.py", line 22, in <module>
n,k=map(int,raw_input().split())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s206700026 | p00519 | u724548524 | 1526002307 | Python | Python3 | py | Runtime Error | 30 | 5628 | 829 | def calcm(x):
gone = [set([x])]
for _ in range(a[x][1]):
gone.append(set())
for i in gone[-2]:
for j in link[i]:
for k in gone:
if j in k:
break
else:
gone[-1].add(j)
minq = []
for... | Traceback (most recent call last):
File "/tmp/tmpsur0zzw0/tmp00jjidph.py", line 23, in <module>
n, m = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s202890958 | p00519 | u352394527 | 1526967080 | Python | Python3 | py | Runtime Error | 20 | 5668 | 1073 | from heapq import heappop as pop
from heapq import heappush as push
INF = 10 ** 20
n, k = map(int, input().split())
clst = []
rlst = []
for i in range(n):
c, r = map(int, input().split())
clst.append(c)
rlst.append(r)
edges = [[0] * n for i in range(n)]
for i in range(k):
a, b = map(int, input().split())
... | Traceback (most recent call last):
File "/tmp/tmpea5f743z/tmpvqjfiiti.py", line 4, in <module>
n, k = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s787480195 | p00521 | u121563294 | 1412267610 | Python | Python3 | py | Runtime Error | 19930 | 24688 | 1308 | from copy import deepcopy
M,N=map(int,input().split())
flag=[]
for i in range(M):
flag.append(list(input()))
fchange=deepcopy(flag)
sym=[]
for i in range(2):
sym.append(list(input()))
nmatch=0
for i in range(M-1):
for j in range(N-1):
ism=True
for k in range(2):
for l in range(2... | Traceback (most recent call last):
File "/tmp/tmp2kkuubez/tmp4_m4tthj.py", line 3, in <module>
M,N=map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s430435844 | p00522 | u352394527 | 1526895389 | Python | Python3 | py | Runtime Error | 20 | 5620 | 856 | INF = 10 ** 20
m, n = map(int, input().split())
manju_lst = [int(input()) for i in range(m)]
manju_lst.sort(reverse=True)
acc = 0
cum_sum = [0]
for manju in manju_lst:
acc += manju
cum_sum.append(acc)
clst = []
elst = []
for i in range(n):
c, e = map(int, input().split())
clst.append(c)
elst.append(e)
dp... | Traceback (most recent call last):
File "/tmp/tmp_kxp6z8n/tmpqmrv7re0.py", line 3, in <module>
m, n = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s583104117 | p00523 | u296492699 | 1409246620 | Python | Python | py | Runtime Error | 0 | 0 | 344 | n=input()
for i in range(n):
a[i]=input()
tmp_out=0
for i in range(1, n-2):
b=[0,0,0]
for ii in range(i):
b[0] += a[ii]
for j in range(i+1, n-1):
for jj in range(i, j):
b[1] += a[jj]
for jj in range(j+1, n):
b[2] += a[jj]
tmp_out=max(tmp_out, min(b))... | File "/tmp/tmpqvkwjaxg/tmp6gfou5wu.py", line 18
print tmp_out
^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s989759233 | p00523 | u296492699 | 1409246733 | Python | Python | py | Runtime Error | 0 | 0 | 407 | while True:
n=input()
for i in range(n):
a[i]=input()
tmp_out=0
for i in range(1, n-2):
b=[0,0,0]
for ii in range(i):
b[0] += a[ii]
for j in range(i+1, n-1):
for jj in range(i, j):
b[1] += a[jj]
for jj in range(j+1, n):... | File "/tmp/tmp3_da1234/tmp6schxslo.py", line 19
print tmp_out
^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s171786988 | p00523 | u296492699 | 1409246832 | Python | Python | py | Runtime Error | 0 | 0 | 416 | while True:
n=input()
a=[]
for i in range(n):
a[i]=input()
tmp_out=0
for i in range(1, n-2):
b=[0,0,0]
for ii in range(i):
b[0] += a[ii]
for j in range(i+1, n-1):
for jj in range(i, j):
b[1] += a[jj]
for jj in range... | File "/tmp/tmplr39koev/tmphm1udzpz.py", line 20
print tmp_out
^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s743162383 | p00523 | u296492699 | 1409247995 | Python | Python | py | Runtime Error | 0 | 0 | 421 | while True:
n=input()
a=[]
for i in range(n):
a.append(input())
tmp_out=0
for i in range(1, n-2):
b=[0,0,0]
for ii in range(i):
b[0] += a[ii]
for j in range(i+1, n-1):
for jj in range(i, j):
b[1] += a[jj]
for jj in ... | File "/tmp/tmpgp2q4frd/tmp2cr_xksh.py", line 20
print tmp_out
^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s621684027 | p00523 | u296492699 | 1409253656 | Python | Python | py | Runtime Error | 39870 | 4272 | 476 | n=input()
a=[]
for i in range(n):
a.append(input())
tmp_out=0
for i in range(n-2):
for j in range(i+1,n-1):
for k in range(j+1,n):
b=[0,0,0]
for ai in range(i,j):
b[0]+=a[ai]
for ai in range(j,k):
b[1]+=a[ai]
for ai in range... | File "/tmp/tmpz4r7l7bh/tmp8xg__7k1.py", line 20
print tmp_out
^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s140650513 | p00523 | u317901693 | 1417182850 | Python | Python | py | Runtime Error | 19930 | 8156 | 1098 | # coding: utf-8
import math as m
import cmath as c
import numbers
#ラジアンを度に変換
def rad_deg(rad):
if rad >= 0:
return m.degrees(rad)
else:
return m.degrees(2*pi-abs(rad))
input_lines = []
#f = open("input2.txt")
input_lines.append(raw_input())
N = int(input_lines[0])
pi = c.pi
#A_1〜A_Nまでインデックス付きで格納
data = {... | File "/tmp/tmp6mcg8rgz/tmp4riorgdk.py", line 48
print int(round((min_arg/360)*SUM))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s241119318 | p00523 | u317901693 | 1417200014 | Python | Python | py | Runtime Error | 0 | 0 | 1232 | # coding: utf-8
import math as m
import cmath as c
import numbers
def rad_deg(rad):
if rad >= 0:
return m.degrees(rad)
else:
return m.degrees(2*pi-abs(rad))
input_lines = []
input_lines.append(raw_input())
N = int(input_lines[0])
pi = c.pi
data = {i+1:0 for i in range(N)}
polar = {i+1:0+0j for i in range(N)}
SU... | File "/tmp/tmpi92ypum7/tmpm7mkh2f9.py", line 35
print i
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s369632826 | p00523 | u317901693 | 1417200069 | Python | Python | py | Runtime Error | 0 | 0 | 1223 | # coding: utf-8
import math as m
import cmath as c
import numbers
def rad_deg(rad):
if rad >= 0:
return m.degrees(rad)
else:
return m.degrees(2*pi-abs(rad))
input_lines = []
input_lines.append(raw_input())
N = int(input_lines[0])
pi = c.pi
data = {i+1:0 for i in range(N)}
polar = {i+1:0+0j for i in range(N)}
SU... | File "/tmp/tmp1swhptrq/tmpf86ion5k.py", line 56
print int(round((min_arg/360)*SUM))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s228669460 | p00523 | u317901693 | 1417200185 | Python | Python | py | Runtime Error | 19930 | 7468 | 1211 | # coding: utf-8
import math as m
import cmath as c
import numbers
def rad_deg(rad):
if rad >= 0:
return m.degrees(rad)
else:
return m.degrees(2*pi-abs(rad))
input_lines = []
input_lines.append(raw_input())
N = int(input_lines[0])
pi = c.pi
data = {i+1:0 for i in range(N)}
polar = {i+1:0+0j for i in range(N)}
SU... | File "/tmp/tmp4xsrd96g/tmp6b7dlzpv.py", line 56
print int(round((min_arg/360)*SUM))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s411264687 | p00523 | u317901693 | 1417506545 | Python | Python | py | Runtime Error | 19930 | 7932 | 2632 | # coding: utf-8
import math as m
import cmath as c
import numbers
def rad_deg(rad):
if rad >= 0:
return m.degrees(rad)
else:
return m.degrees(2*pi-abs(rad))
input_lines = []
input_lines.append(raw_input())
N = int(input_lines[0])
pi = c.pi
data = {i+1:0 for i in range(N)}
polar = {i+1:0+0j for i in range(N)}
SU... | File "/tmp/tmp6enqef11/tmpuydjzklc.py", line 116
print int(round((min_arg/360)*SUM))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s170173449 | p00523 | u317901693 | 1417542326 | Python | Python | py | Runtime Error | 19930 | 7956 | 2052 | # coding: utf-8
import math as m
import cmath as c
import numbers
def rad_deg(rad):
if rad >= 0:
return m.degrees(rad)
else:
return m.degrees(2*pi-abs(rad))
input_lines = []
input_lines.append(raw_input())
N = int(input_lines[0])
pi = c.pi
data = {i+1:0 for i in range(N)}
polar = {i+1:0+0j for i in range(N)}
SU... | File "/tmp/tmpr5vs4_og/tmpbm5i_qnp.py", line 87
print int(round((min_arg/360)*SUM))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s453300070 | p00523 | u317901693 | 1417542513 | Python | Python | py | Runtime Error | 19920 | 7720 | 2056 | # coding: utf-8
import math as m
import cmath as c
import numbers
def rad_deg(rad):
if rad >= 0:
return m.degrees(rad)
else:
return m.degrees(2*pi-abs(rad))
input_lines = []
input_lines.append(raw_input())
N = int(input_lines[0])
pi = c.pi
data = {i+1:0 for i in xrange(N)}
polar = {i+1:0+0j for i in xrange(N)}
... | File "/tmp/tmpytc3wzav/tmpnhqjy5lu.py", line 87
print int(round((min_arg/360)*SUM))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s606458967 | p00523 | u567380442 | 1425199092 | Python | Python3 | py | Runtime Error | 0 | 0 | 717 | import sys
import bisect
f = sys.stdin
#n = int(f.readline())
a = list(map(int,f))
a[0] = 0
for i in range(1,len(a)):
a[i] += a[i - 1]
sum_a = a[-1]
third = sum_a // 3
ret = []
for i in range(bisect.bisect_left(a, third)):
nick1 = bisect.bisect_left(a, a[i] + third,lo=i)
for ni1 in (nick1-1,nick1)... | Traceback (most recent call last):
File "/tmp/tmpyuyhywd8/tmp7ntop04o.py", line 8, in <module>
a[0] = 0
~^^^
IndexError: list assignment index out of range
| |
s614828786 | p00523 | u266872031 | 1431440982 | Python | Python | py | Runtime Error | 19930 | 5208 | 997 | def checksmallest(edi,Clist,partS):
#rotate Alist so that sti is 0
Blist=Clist[edi:]
m=len(Blist)
BS=sum(Blist)
head=0
tail=m
body=m/2
while(head!=body and tail!=body):
left=sum(Blist[0:body])
right=sum(Blist[body:m])
#print partS,left,right
if min(right,l... | File "/tmp/tmpy3i8o5j6/tmp0vkpzhks.py", line 43
print smallest
^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s067349514 | p00523 | u266872031 | 1431441065 | Python | Python | py | Runtime Error | 19920 | 5184 | 1042 | def checksmallest(edi,Clist,partS):
#rotate Alist so that sti is 0
Blist=Clist[edi:]
m=len(Blist)
BS=sum(Blist)
head=0
tail=m
body=m/2
while(head!=body and tail!=body):
left=sum(Blist[0:body])
right=sum(Blist[body:m])
#print partS,left,right
if min(right,l... | File "/tmp/tmpnxk_enrs/tmprp9gm2q1.py", line 45
print smallest
^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s899503543 | p00523 | u266872031 | 1431442578 | Python | Python | py | Runtime Error | 19920 | 5036 | 1097 | def checksmallest(edi,Clist,partS):
#rotate Alist so that sti is 0
Blist=Clist[edi:]
m=len(Blist)
BS=sum(Blist)
head=0
tail=m
body=m/2
while(head!=body and tail!=body):
left=sum(Blist[0:body])
right=sum(Blist[body:m])
#print partS,left,right
if min(right,l... | File "/tmp/tmpbijcx3ot/tmpdg_md4_q.py", line 48
print smallest
^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s819828861 | p00523 | u266872031 | 1431443644 | Python | Python | py | Runtime Error | 19930 | 5052 | 1175 | def checksmallest(edi,Clist,partS):
#rotate Alist so that sti is 0
Blist=Clist[edi:]
m=len(Blist)
BS=sum(Blist)
head=0
tail=m
body=m/2
while(head!=body and tail!=body):
left=sum(Blist[0:body])
right=sum(Blist[body:m])
#print partS,left,right
if min(right,l... | File "/tmp/tmpdm2_ac7a/tmp_cff4x32.py", line 52
print smallest
^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s369478217 | p00523 | u073685357 | 1456816081 | Python | Python | py | Runtime Error | 0 | 0 | 734 | __Author__ = 'Anomino'
# coding:UTF-8
import numpy as np
def AskUser() :
number = int(raw_input())
baum = []
for value in range(number) :
baum.append(int(raw_input()))
return baum
def CutBaum(baum, cuts) :
ideal = sum(baum) / cuts
piece_of_baum = []
tmp_baum = 0
for value in range(len(baum)) :... | File "/tmp/tmpqkvg88nn/tmps30zf7np.py", line 35
print min_baum
^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s139921075 | p00523 | u711765449 | 1484671922 | Python | Python3 | py | Runtime Error | 40000 | 7756 | 947 | n = int(input())
a = [0]*n
for i in range(n):
a[i] = int(input())
m = 0
opt = [0,0,0]
count = 0
for i in range(n-1):
for j in range(i+1,n):
for k in range(j+1,n):
g1,g2,g3 = 0,0,0
#print(i,j,k)
if i != 0:
for x in range(i+1,j):
g1 ... | Traceback (most recent call last):
File "/tmp/tmpeu22zxql/tmpd29i_yar.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s527964559 | p00523 | u371539389 | 1491823394 | Python | Python3 | py | Runtime Error | 40000 | 8228 | 602 | from itertools import combinations
def min(a,b,c):
if a<=b and a<=c:
return a
elif b<=c:
return b
else:
return c
N=int(input())
list=[int(input())]
for i in range(1,N):
list.append(int(input())+list[-1])
a=combinations(range(0,N),3)
max_of_minimumsize=0
for i in a:
cut1... | Traceback (most recent call last):
File "/tmp/tmpd91pg9ta/tmpgkqzlro1.py", line 11, in <module>
N=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s476248381 | p00523 | u371539389 | 1491823842 | Python | Python3 | py | Runtime Error | 40000 | 7896 | 624 | def min(a,b,c):
if a<=b and a<=c:
return a
elif b<=c:
return b
else:
return c
N=int(input())
list=[int(input())]
for i in range(1,N):
list.append(int(input())+list[-1])
max_of_minimumsize=0
for cut1 in range(N-2):
for cut2 in range(cut1,N-1):
for cut3 in range(c... | Traceback (most recent call last):
File "/tmp/tmp1xr8x8uy/tmpx2p66q1o.py", line 9, in <module>
N=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s622918076 | p00523 | u589276934 | 1496758941 | Python | Python3 | py | Runtime Error | 40000 | 7704 | 2717 | # coding: utf-8
numberOfLines = int(input())
cuttingPoints = [0 for _ in range(numberOfLines)]
for readLine in range(numberOfLines):
cuttingPoints[readLine] = int(input())
def selectMaxDifference(sumOfFirst, sumOfSecond, sumOfThird):
differenceBetween1And2 = abs(sumOfFirst - sumOfSecond)
differenceBetween... | Traceback (most recent call last):
File "/tmp/tmpz0e5aahx/tmpl64bks3c.py", line 3, in <module>
numberOfLines = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s530672876 | p00523 | u142321256 | 1503154948 | Python | Python3 | py | Runtime Error | 0 | 0 | 283 | #??\???
N = input()
A = [int(input()) for i in range(N)]
s = sum(A)#?????????????????????????????????
min_max = 0
for i in range(1,N+1):
for j in range(i+1,N+1):
for k in range(k+1,N+1):
m=min(sum(A[1:i]),sum(A[i+1:j]),sum(A)-N)
if(m>min_max):
min_max=m
print(min_max) | Traceback (most recent call last):
File "/tmp/tmpdftes8zh/tmpsmsp4n10.py", line 2, in <module>
N = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s801573819 | p00523 | u334667251 | 1504168389 | Python | Python3 | py | Runtime Error | 0 | 0 | 1089 | def d(p, q):
return pos[p] - pos[q]
def solve():
p0, p1, p2 = 0, 0, 0
best = 0
fail = False
while p0 < N:
if fail:
p0 += 1
# p2????±???????
while d(p2, p1) > d(p1, p0) and p2 > p1:
p2 -= 1
fail = False
# p1????±???????
... | Traceback (most recent call last):
File "/tmp/tmps47z3uum/tmpqb1no0j5.py", line 38, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s717690210 | p00523 | u901080241 | 1506485238 | Python | Python3 | py | Runtime Error | 0 | 0 | 1591 | def main():
n = int(input())
a = [int(input()) for _ in range(n)]
sm = sum(a)
tgt = sm/3
i = 0
ans = 0
llow = 0
lmid = 0
lhigh = 0
ltemp = 0
rlow = 0
rmid = 0
rhigh = 0
rtemp = 1
tempsum = 0
while rmid <= tgt:
rmid += a[rtemp]
rtemp += 1
... | Traceback (most recent call last):
File "/tmp/tmp3cd6wkom/tmp4hv90mdh.py", line 66, in <module>
main()
File "/tmp/tmp3cd6wkom/tmp4hv90mdh.py", line 2, in main
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s320323584 | p00523 | u901080241 | 1506485301 | Python | Python3 | py | Runtime Error | 0 | 0 | 1364 |
n = int(input())
a = [int(input()) for _ in range(n)]
sm = sum(a)
tgt = sm/3
i = 0
ans = 0
llow = 0
lmid = 0
lhigh = 0
ltemp = 0
rlow = 0
rmid = 0
rhigh = 0
rtemp = 1
tempsum = 0
while rmid <= tgt:
rmid += a[rtemp]
rtemp += 1
rlow = rmid - a[rtemp-1]
rhigh = rmid + a[rtemp]
while lmid <= tgt:
lmid += a[... | Traceback (most recent call last):
File "/tmp/tmpg0t23lpv/tmpwu234jsw.py", line 2, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s616665548 | p00523 | u901080241 | 1506485510 | Python | Python3 | py | Runtime Error | 0 | 0 | 1363 | n = int(input())
a = [int(input()) for _ in range(n)]
sm = sum(a)
tgt = sm/3
i = 0
ans = 0
llow = 0
lmid = 0
lhigh = 0
ltemp = 0
rlow = 0
rmid = 0
rhigh = 0
rtemp = 1
tempsum = 0
while rmid <= tgt:
rmid += a[rtemp]
rtemp += 1
rlow = rmid - a[rtemp-1]
rhigh = rmid + a[rtemp]
while lmid <= tgt:
lmid += a[l... | Traceback (most recent call last):
File "/tmp/tmp3robvubi/tmpnfnllmys.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s558261687 | p00523 | u901080241 | 1506485719 | Python | Python3 | py | Runtime Error | 0 | 0 | 1364 | n = int(input())
a = [int(input()) for _ in range(n)]
sm = sum(a)
tgt = sm//3
i = 0
ans = 0
llow = 0
lmid = 0
lhigh = 0
ltemp = 0
rlow = 0
rmid = 0
rhigh = 0
rtemp = 1
tempsum = 0
while rmid <= tgt:
rmid += a[rtemp]
rtemp += 1
rlow = rmid - a[rtemp-1]
rhigh = rmid + a[rtemp]
while lmid <= tgt:
lmid += a[... | Traceback (most recent call last):
File "/tmp/tmpi9tggvy1/tmp3ik0debd.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s643673624 | p00523 | u901080241 | 1506485785 | Python | Python3 | py | Runtime Error | 0 | 0 | 1342 | n = int(input())
a = [int(input()) for _ in range(n)]
sm = sum(a)
tgt = sm//3
i = 0
ans = 0
llow = 0
lmid = 0
lhigh = 0
ltemp = 0
rlow = 0
rmid = 0
rhigh = 0
rtemp = 1
tempsum = 0
while rmid <= tgt:
rmid += a[rtemp]
rtemp += 1
rlow = rmid - a[rtemp-1]
rhigh = rmid + a[rtemp]
while lmid <= tgt:
lmid += a[... | Traceback (most recent call last):
File "/tmp/tmph66iiyia/tmpyd5mhlwl.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s645363859 | p00524 | u567380442 | 1425214034 | Python | Python3 | py | Runtime Error | 19930 | 111632 | 1332 | import sys
f = sys.stdin
n,m,x = map(int,f.readline().split())
h = [None] + [int(f.readline()) for _ in range(n)]
tuple_abt = [tuple(map(int, line.split())) for line in f]
dict_abt = {}
for ai,bi,ti in tuple_abt:
try:
if ti <= h[ai]:
dict_abt[ai][bi] = ti
except KeyError:
dict_abt... | Traceback (most recent call last):
File "/tmp/tmpl9jl64sz/tmpfy7b4wds.py", line 5, in <module>
n,m,x = map(int,f.readline().split())
^^^^^
ValueError: not enough values to unpack (expected 3, got 0)
| |
s606042808 | p00525 | u567380442 | 1425600922 | Python | Python3 | py | Runtime Error | 19930 | 84420 | 4235 | import math
class seg_tree:
def __init__(self, n):
self.depth = math.ceil(math.log(n, 2))
self.size = 1 << self.depth
self.bit = [0] * 2 * self.size
self.renew = [0] * 2 * self.size
def add(self, p, v):
p += self.size;
while p:
self.bit[p] += v
... | Traceback (most recent call last):
File "/tmp/tmpu5b1_8p2/tmpp5w0mdc_.py", line 166, in <module>
main(f)
File "/tmp/tmpu5b1_8p2/tmpp5w0mdc_.py", line 107, in main
w,h,n = map(int,f.readline().split())
^^^^^
ValueError: not enough values to unpack (expected 3, got 0)
| |
s775378115 | p00525 | u567380442 | 1425713732 | Python | Python3 | py | Runtime Error | 0 | 0 | 4246 | import math
class seg_tree:
def __init__(self, n):
self.depth = math.ceil(math.log(n, 2))
self.size = 1 << self.depth
self.bit = [0] * 2 * self.size
self.renew = [0] * 2 * self.size
def add(self, p, v):
p += self.size;
while p:
self.bit[p] += v
... | Traceback (most recent call last):
File "/tmp/tmpln5o91o6/tmp77502oqv.py", line 110, in <module>
@profile
^^^^^^^
NameError: name 'profile' is not defined
| |
s723718506 | p00531 | u529013669 | 1476888989 | Python | Python3 | py | Runtime Error | 0 | 0 | 802 | # solve problem
def solve(n, m, targets, games):
counter = [0 for i in range(n+1)]
for i in range(m):
for j in range(n):
if games[i][j] == targets[i]:
counter[j+1] += 1
else:
counter[targets[i]] += 1
return counter
# main function
if __name... | Traceback (most recent call last):
File "/tmp/tmp1zsdsqla/tmpgyzy_hld.py", line 17, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s071217397 | p00531 | u546285759 | 1503374336 | Python | Python3 | py | Runtime Error | 0 | 0 | 127 | A = int(input())
B = int(input())
C = int(input())
D = int(input())
P = int(input())
print(min(P*A, B if C <= P else B+(P-C)*D) | File "/tmp/tmpmjienb5m/tmp_3m8_kss.py", line 6
print(min(P*A, B if C <= P else B+(P-C)*D)
^
SyntaxError: '(' was never closed
| |
s772267706 | p00534 | u035108350 | 1440483197 | Python | Python3 | py | Runtime Error | 20 | 7848 | 739 |
def sl(dn,cn):
global f,tenkou,dist
if dn>cn or dn<0:
return False
if f[dn][cn]==-1:
a=sl(dn-1,cn-1)+dist[dn]*tenkou[cn]
b=sl(dn,cn-1)
c=min(a,b)
f[dn][cn]=c
return c
else:
return f[dn][cn]
#dn??\?????§???tenkou????????´???
def cost(dn,tenkou):... | Traceback (most recent call last):
File "/tmp/tmplqmw7txo/tmpj_nbx3re.py", line 25, in <module>
dd=input()
^^^^^^^
EOFError: EOF when reading a line
| |
s117408870 | p00534 | u035108350 | 1440483216 | Python | Python3 | py | Runtime Error | 30 | 7816 | 739 |
def sl(dn,cn):
global f,tenkou,dist
if dn>cn or dn<0:
return False
if f[dn][cn]==-1:
a=sl(dn-1,cn-1)+dist[dn]*tenkou[cn]
b=sl(dn,cn-1)
c=min(a,b)
f[dn][cn]=c
return c
else:
return f[dn][cn]
#dn??\?????§???tenkou????????´???
def cost(dn,tenkou):... | Traceback (most recent call last):
File "/tmp/tmpkcjx020u/tmphpub7mc1.py", line 25, in <module>
dd=input()
^^^^^^^
EOFError: EOF when reading a line
| |
s001517890 | p00534 | u260980560 | 1512798761 | Python | Python3 | py | Runtime Error | 20 | 5720 | 347 | N, M = map(int, input().split())
D = [int(input()) for i in range(N)]
C = [int(input()) for i in range(M)]
memo = {}
def dfs(i, j):
if i == N:
return 0
if j == M:
return 10**9
if (i, j) in memo:
return memo[i, j]
memo[i, j] = res = min(dfs(i+1, j+1) + D[i]*C[j], dfs(i, j+1))
... | Traceback (most recent call last):
File "/tmp/tmpqht8u9en/tmpam1k5dnq.py", line 1, in <module>
N, M = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s557947894 | p00534 | u889593139 | 1513936600 | Python | Python3 | py | Runtime Error | 1920 | 68932 | 422 | from copy import deepcopy
N, M = map(int, input().split(' '))
D = [int(input()) for i in range(N)]
C = [int(input()) for i in range(M)]
can_stop = N - M
memo = [[] for i in range(N + 1)]
memo[0].append(0)
memo[1].append(D[0] * C[0])
for day in range(1, M):
tmp = deepcopy(memo)
for town in range(N):
fo... | Traceback (most recent call last):
File "/tmp/tmp3cq4m_4w/tmp7urolv_h.py", line 2, in <module>
N, M = map(int, input().split(' '))
^^^^^^^
EOFError: EOF when reading a line
| |
s796546128 | p00534 | u724548524 | 1525725331 | Python | Python3 | py | Runtime Error | 100 | 5816 | 560 | n, m = map(int, input().split())
d = [int(input()) for _ in range(n)]
c = [int(input()) for _ in range(m)]
h = [[10e10 for _ in range(m)] for _ in range(n)]
q = [[0, 0, 0]]
while True:
nq = []
for i in q:
dn = i[2] + d[i[0]] * c[i[1]]
if dn < min(h[i[0]][:i[1] + 1]):
if i[0] < n - 1... | Traceback (most recent call last):
File "/tmp/tmpyh0jivh1/tmphywq2s0c.py", line 1, in <module>
n, m = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s153281684 | p00535 | u894114233 | 1468758764 | Python | Python | py | Runtime Error | 40000 | 23220 | 859 | import copy
def check(y,x):
if 0<=y<=h-1 and 0<=x<=w-1:
return True
return False
h,w=map(int,raw_input().split())
field=[raw_input() for _ in xrange(h)]
dx=(1,1,1,0,0,-1,-1,-1)
dy=(1,0,-1,1,-1,1,0,-1)
before_field=copy.deepcopy(field)
ans=-1
while 1:
ans+=1
cnt=[[0]*w for _ in xrange(h)]
f... | Traceback (most recent call last):
File "/tmp/tmp4985n6yk/tmps1_i1ott.py", line 8, in <module>
h,w=map(int,raw_input().split())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s786968461 | p00535 | u260980560 | 1512799810 | Python | Python3 | py | Runtime Error | 8000 | 5608 | 750 | H, W = map(int, input().split())
S = []
for i in range(H):
tmp = []
s = input()
for j in range(W):
if s[j] == '.':
tmp.append(-1)
else:
tmp.append(int(s[j]))
S.append(tmp)
D = [0, 1, -1, -1, 0, -1, 1, 1, 0]
update = 1; ans = 0
while update:
update = 0; ans += ... | Traceback (most recent call last):
File "/tmp/tmpndha4pdn/tmp16ogvfub.py", line 1, in <module>
H, W = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s178510081 | p00535 | u724548524 | 1525727754 | Python | Python3 | py | Runtime Error | 8140 | 5792 | 768 | h, w = map(int, input().split())
a = []
c = set()
def check(c):
global a
s = sum(a[c[0] + i][c[1] + j] == 0 for i in range(-1, 2) for j in range(-1, 2))
if s >= a[c[0]][c[1]]:
return True
else:
return False
for _ in range(h):
a.append(list(input()))
for i in range(h):
... | Traceback (most recent call last):
File "/tmp/tmptev5aw45/tmpogmm97j0.py", line 1, in <module>
h, w = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s205744253 | p00536 | u886119481 | 1509861199 | Python | Python3 | py | Runtime Error | 40000 | 7744 | 1867 | #Some of grobal args
COMMANDS = ["Anna", "trush", "Bruno"]
MARKETSUM = 0
answer = 0
#List for rare, market value
tre_list = []
class Thieves():
#This holds two thieves market and rare value.
def __init__(self, parent=None):
if parent is None:
self.Anna = [0, 0]
self.Bruno = [0,... | Traceback (most recent call last):
File "/tmp/tmp5nuvvxag/tmp07efaqph.py", line 57, in <module>
N, D = list(map(int, input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s916421896 | p00537 | u894114233 | 1472129432 | Python | Python | py | Runtime Error | 40000 | 30784 | 460 | n,m=map(int,raw_input().split())
p=map(int,raw_input().split())
abc=[map(int,raw_input().split()) for _ in xrange(n-1)]
cnt=[0]*(n-1)
for i in xrange(m-1):
p[i]-=1
p[i+1]-=1
if p[i]<p[i+1]:
for j in xrange(p[i],p[i+1]):
cnt[j]+=1
else:
for j in xrange(p[i],p[i+1],-1):
... | Traceback (most recent call last):
File "/tmp/tmpu4s85e_g/tmpwyzys2ee.py", line 1, in <module>
n,m=map(int,raw_input().split())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s904768495 | p00538 | u352394527 | 1524206907 | Python | Python3 | py | Runtime Error | 670 | 18956 | 556 | n = int(input())
A = [int(input()) for i in range(n)] * 2
dp = [[-1 for i in range(n * 2)] for j in range(n * 2)]
def dfs(i,j):
#if (j - i > n - 1):undefined
if dp[i][j] != -1:
pass
elif (j - i == n - 1):
dp[i][j] = 0
elif (j - i) % 2 == 0:
if A[i - 1] > A[j + 1]:
dp[i][j] = dfs(i - 1, j)
... | Traceback (most recent call last):
File "/tmp/tmpaazk_v_5/tmpooq45aan.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s703311315 | p00538 | u352394527 | 1524206968 | Python | Python3 | py | Runtime Error | 390 | 18964 | 527 | n = int(input())
A = [int(input()) for i in range(n)] * 3
dp = [[-1 for i in range(n * 2)] for j in range(n * 2)]
def dfs(i,j):
#if (j - i > n - 1):undefined
if dp[i][j] != -1:
pass
elif (j - i == n - 1):
dp[i][j] = 0
elif (j - i) % 2 == 0:
if A[i - 1] > A[j + 1]:
dp[i][j] = dfs(i - 1, j)
... | Traceback (most recent call last):
File "/tmp/tmpncj850g6/tmpf2ey6rp5.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s058067938 | p00539 | u894114233 | 1472802199 | Python | Python | py | Runtime Error | 30 | 6964 | 1063 | from collections import deque
import heapq
def dijkstra(s,g,m):
color=[0]*n
dis={}
for i in xrange(n):
dis[i]=float('inf')
dis[s]=0
heapq.heappush(pq,[0,s])
while len(pq)!=0:
t,u=heapq.heappop(pq)
color[u]=2
if dis[u]<t:
continue
for v in g[u]... | File "/tmp/tmpth5iy2r2/tmps85p8d_2.py", line 48
print ans
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s517926167 | p00539 | u894114233 | 1472803110 | Python | Python | py | Runtime Error | 0 | 0 | 972 | from collections import deque
import heapq
def dijkstra(s,g):
color=[0]*n
dis={}
for i in xrange(n):
dis[i]=float('inf')
dis[s]=0
heapq.heappush(pq,[0,s])
while len(pq)!=0:
t,u=heapq.heappop(pq)
color[u]=2
if dis[u]<t:
continue
for v,c in g[u]... | File "/tmp/tmps1ciuw8_/tmpc971yv2o.py", line 45
print ans
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s858231869 | p00542 | u452212317 | 1494813837 | Python | Python3 | py | Runtime Error | 0 | 0 | 166 | a,b,c,d,e,f = map(int, input().split())
x = a + b + c + d + e + f
y = 100000
for i in (a,b,c,d):
if y > i : y = i
z = 0
if e < f : z = f
else z = e
print (x - y - z) | File "/tmp/tmpg2627tum/tmphor59ecv.py", line 8
else z = e
^
SyntaxError: expected ':'
| |
s246063356 | p00542 | u452212317 | 1494813909 | Python | Python3 | py | Runtime Error | 0 | 0 | 168 | a,b,c,d,e,f = map(int, input().split())
x = a + b + c + d + e + f
y = 100000
for i in (a,b,c,d):
if y > i : y = i
z = 0
if e < f : z = f
else : z = e
print (x - y - z) | Traceback (most recent call last):
File "/tmp/tmpvuj_9n4u/tmpcic_uro6.py", line 1, in <module>
a,b,c,d,e,f = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s057869772 | p00542 | u889593139 | 1522029746 | Python | Python3 | py | Runtime Error | 0 | 0 | 107 | points = []
for _ in range(6):
points.append(int(input())
print(sum(sorted(points, reverse=True)[:3]))
| File "/tmp/tmpwrhedn44/tmpwiaugy9v.py", line 3
points.append(int(input())
^
SyntaxError: '(' was never closed
| |
s590733105 | p00542 | u889593139 | 1522029787 | Python | Python3 | py | Runtime Error | 0 | 0 | 107 | points = []
for i in range(6):
points.append(int(input())
print(sum(sorted(points, reverse=True)[:3]))
| File "/tmp/tmph5i9qdgo/tmpsnn059bc.py", line 3
points.append(int(input())
^
SyntaxError: '(' was never closed
| |
s954839582 | p00543 | u221679506 | 1467997365 | Python | Python3 | py | Runtime Error | 0 | 0 | 261 | n,k = map(int,input().split())
d={}
for i in range(n):
d[i+1] = int(input())
for i in range(n):
j = i+1
if j == n:
break
if d[i]%k > d[i+1]%k:
t = d[i]
d[i] = d[i+1]
d[i+1] = t
for i in range(n):
print(d[i+1]) | Traceback (most recent call last):
File "/tmp/tmp3i3mh06h/tmp2gf2vjzp.py", line 1, in <module>
n,k = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s393203057 | p00545 | u724548524 | 1525719694 | Python | Python3 | py | Runtime Error | 0 | 0 | 523 | n, t, q = map(int, input().split())
x = [[0, 0, 0] for _ in range(n)]
s = -10e10
for i in range(n):
x[i] = list(map(long, input().split())) + [0]
x[i][2] = x[i][0] + (1 if x[i][1] == 1 else -1) * t
if x[i - 1][1] == 1 and x[i][1] == 2:
s = int((x[i - 1][0] + x[i][0]) / 2)
j = 1
while... | Traceback (most recent call last):
File "/tmp/tmpt52borhb/tmp8olg8gg8.py", line 1, in <module>
n, t, q = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s282258934 | p00550 | u894114233 | 1490594770 | Python | Python | py | Runtime Error | 2590 | 101236 | 1768 | from copy import deepcopy
from collections import deque
n,m,q=map(int,raw_input().split())
e=[]
g1=[[] for _ in xrange(n)]
for i in xrange(m):
u,v=map(int,raw_input().split())
u-=1;v-=1
g1[u].append(v)
g1[v].append(u)
e.append((u,v))
d1=[10**9]*n
d1[0]=0
dq=deque([0])
while len(dq)>0:
now=dq.po... | File "/tmp/tmpphm955z3/tmpstgpe7ma.py", line 89
print ans[i]
^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s061943091 | p00550 | u894114233 | 1490594863 | Python | Python | py | Runtime Error | 2620 | 106628 | 1828 | from copy import deepcopy
from collections import deque
from sys import setrecursionlimit
n,m,q=map(int,raw_input().split())
e=[]
g1=[[] for _ in xrange(n)]
for i in xrange(m):
u,v=map(int,raw_input().split())
u-=1;v-=1
g1[u].append(v)
g1[v].append(u)
e.append((u,v))
d1=[10**9]*n
d1[0]=0
dq=deque(... | File "/tmp/tmpp0qz18xk/tmpfuly83ma.py", line 92
print ans[i]
^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s082223817 | p00551 | u150984829 | 1517065084 | Python | Python3 | py | Runtime Error | 0 | 0 | 327 | k=int(input().split()[1])
p=input()
x=y=d=e=f=g=0
a=[(0,0)]
for _ in[0]*k:
for s in p:
if'E'==s:x+=1;g=[g,x][g<x]
if'N'==s:y+=1;e=[e,y][e<y]
if'W'==s:x-=1;f=[f,x][f>x]
if'S'==s:y-=1;d=[d,y][d>y]
a+=[(x,y)]
print(sum([1 for y in range(d,e)for x in range(f,g)if all((x,y)in a,(x+1,y)in a,(x,y+1)in a,(x+1,y+1)in... | Traceback (most recent call last):
File "/tmp/tmpouhl9x2a/tmpb2hss6sb.py", line 1, in <module>
k=int(input().split()[1])
^^^^^^^
EOFError: EOF when reading a line
| |
s810431221 | p00551 | u150984829 | 1517065318 | Python | Python3 | py | Runtime Error | 0 | 0 | 329 | k=int(input().split()[1])
p=input()
x=y=d=e=f=g=0
a=[(0,0)]
for _ in[0]*k:
for s in p:
if'E'==s:x+=1;g=[g,x][g<x]
if'N'==s:y+=1;e=[e,y][e<y]
if'W'==s:x-=1;f=[f,x][f>x]
if'S'==s:y-=1;d=[d,y][d>y]
a+=[(x,y)]
s=set(a)
print(sum([1 for y in range(d,e)for x in range(f,g)if not set([(x,y),(x+1,y),(x,y+1),(x+1,y+1)... | File "/tmp/tmp7he1_u85/tmpw9sa9jus.py", line 13
print(sum([1 for y in range(d,e)for x in range(f,g)if not set([(x,y),(x+1,y),(x,y+1),(x+1,y+1)])-s)]))
^
SyntaxError: closing parenthesis ')' does not match opening... | |
s868917735 | p00551 | u150984829 | 1517065336 | Python | Python3 | py | Runtime Error | 0 | 0 | 328 | k=int(input().split()[1])
p=input()
x=y=d=e=f=g=0
a=[(0,0)]
for _ in[0]*k:
for s in p:
if'E'==s:x+=1;g=[g,x][g<x]
if'N'==s:y+=1;e=[e,y][e<y]
if'W'==s:x-=1;f=[f,x][f>x]
if'S'==s:y-=1;d=[d,y][d>y]
a+=[(x,y)]
s=set(a)
print(sum([1 for y in range(d,e)for x in range(f,g)if not set([(x,y),(x+1,y),(x,y+1),(x+1,y+1)... | File "/tmp/tmprk4ob8l9/tmppc8fg0oa.py", line 13
print(sum([1 for y in range(d,e)for x in range(f,g)if not set([(x,y),(x+1,y),(x,y+1),(x+1,y+1)])-s)])
^
SyntaxError: closing parenthesis ')' does not match opening ... | |
s540569740 | p00551 | u150984829 | 1517066978 | Python | Python3 | py | Runtime Error | 0 | 0 | 478 | import collections
k=int(input().split()[1])-1
p=input()
x=y=d=e=f=g=0
a=collections.deque([(0,0)])
for s in p:
if'E'==s:x+=1;g=[g,x][g<x]
if'N'==s:y+=1;e=[e,y][e<y]
if'W'==s:x-=1;f=[f,x][f>x]
if'S'==s:y-=1;d=[d,y][d>y]
a.append((x,y))
g+=x*k if x>0 else f+=x*k
if y>0:e+=y*k
else:d+=y*k
for t in set(a):
for i in ... | File "/tmp/tmpbb4p1c4j/tmp7nbu9yt8.py", line 12
g+=x*k if x>0 else f+=x*k
^^
SyntaxError: invalid syntax
| |
s132550386 | p00551 | u150984829 | 1517394412 | Python | Python3 | py | Runtime Error | 0 | 0 | 239 | k=int(input().split()[1])
p=input()
x=y=0
a=[(0,0)]
for _ in[0]*k:
for s in p:
if'E'==s:x+=1
if'N'==s:y+=1
if'W'==s:x-=1
if'S'==s:y-=1
a+=[(x,y)]
s=set(a)
print(sum([1 for x,y in a if set([(x,y),(x+1,y),(x,y+1),(x+1,y+1)])<a]))
| Traceback (most recent call last):
File "/tmp/tmp4tp550mt/tmpjfq62w06.py", line 1, in <module>
k=int(input().split()[1])
^^^^^^^
EOFError: EOF when reading a line
| |
s800673838 | p00551 | u150984829 | 1517394628 | Python | Python3 | py | Runtime Error | 230 | 20112 | 236 | k=int(input().split()[1])
x=y=0
a=set([(0,0)])
for _ in[0]*k:
for s in input():
if'E'==s:x+=1
if'N'==s:y+=1
if'W'==s:x-=1
if'S'==s:y-=1
a|=set([(x,y)])
print(sum([1 for x,y in a if set([(x,y),(x+1,y),(x,y+1),(x+1,y+1)])<a]))
| Traceback (most recent call last):
File "/tmp/tmp4vhb8f8a/tmphd7llt0i.py", line 1, in <module>
k=int(input().split()[1])
^^^^^^^
EOFError: EOF when reading a line
| |
s113414027 | p00551 | u150984829 | 1517394962 | Python | Python3 | py | Runtime Error | 0 | 0 | 329 | from multiprocessing import *
k=int(input().split()[1])
p=input()
x=y=0
a=[(0,0)]
for _ in[0]*k:
for s in p:
if'E'==s:x+=1
if'N'==s:y+=1
if'W'==s:x-=1
if'S'==s:y-=1
a+=[(x,y)]
a=set(a)
with Pool(9)as p:
for s in p.map(q,range(1,k+1)):a|=set(s)
print(sum([1 for x,y in a if set([(x,y),(x+1,y),(x,y+1),(x+1,y+1... | Traceback (most recent call last):
File "/tmp/tmpmpwtv5uc/tmpvvp0h2h4.py", line 2, in <module>
k=int(input().split()[1])
^^^^^^^
EOFError: EOF when reading a line
| |
s985111240 | p00551 | u150984829 | 1517395760 | Python | Python3 | py | Runtime Error | 270 | 20108 | 275 | k=int(input().split()[1])
p=input()
x=y=0
a=set([(0,0)])
for s in p:
if'E'==s:x+=1
if'N'==s:y+=1
if'W'==s:x-=1
if'S'==s:y-=1
a|=set([(x,y)])
for u,v in a:a|=set([(u+x*i,v+y*i)for i in range(1,k)])
print(sum([1 for x,y in a if set([(x,y),(x+1,y),(x,y+1),(x+1,y+1)])<a]))
| Traceback (most recent call last):
File "/tmp/tmp3h0s2enn/tmpp66blmle.py", line 1, in <module>
k=int(input().split()[1])
^^^^^^^
EOFError: EOF when reading a line
| |
s431036261 | p00551 | u150984829 | 1517398921 | Python | Python3 | py | Runtime Error | 0 | 0 | 241 | k=int(input().split()[1])
x=y=0
a={(0,0)}
for s in input():
if'E'==s:x+=1
if'N'==s:y+=1
if'W'==s:x-=1
if'S'==s:y-=1
a|=[(x,y)]
a={(u+x*i,v+y*i)for u,v in a for i in range(k)}
print(sum({(x,y),(x+1,y),(x,y+1),(x+1,y+1)}<a for x,y in a))
| Traceback (most recent call last):
File "/tmp/tmpnz6xw3e_/tmp8mh0ddtx.py", line 1, in <module>
k=int(input().split()[1])
^^^^^^^
EOFError: EOF when reading a line
| |
s610828919 | p00551 | u150984829 | 1517399093 | Python | Python3 | py | Runtime Error | 0 | 0 | 242 | k=int(input().split()[1])
x=y=0
a={(0,0)}
for s in input():
if'E'==s:x+=1
elif'N'==s:y+=1
elif'W'==s:x-=1
elses:y-=1
a|={(x,y)}
a={(u+x*i,v+y*i)for u,v in a for i in range(k)}
print(sum({(x,y),(x+1,y),(x,y+1),(x+1,y+1)}<a for x,y in a))
| File "/tmp/tmpre6dt3qs/tmpmjm7ifqy.py", line 8
elses:y-=1
^^
SyntaxError: invalid syntax
| |
s081691355 | p00553 | u814278309 | 1559284881 | Python | Python3 | py | Runtime Error | 0 | 0 | 183 | for i in range(5):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
if a<0:
x=abs(a)*c+d+b*e
print(x)
else:
y=(b-a)*e
print(y)
| Traceback (most recent call last):
File "/tmp/tmpbkrju7ue/tmprihglt5f.py", line 2, in <module>
a=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s657139622 | p00553 | u814278309 | 1559285040 | Python | Python3 | py | Runtime Error | 0 | 0 | 205 | for i in range(5):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
if a<0:
x=abs(a)*c+d+b*e
print(x)
elif a>=0:
y=(b-a)*e
print(y)
else:
pass
| Traceback (most recent call last):
File "/tmp/tmpa1t68ry9/tmpg89v2el0.py", line 2, in <module>
a=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s483342501 | p00553 | u814278309 | 1559382040 | Python | Python3 | py | Runtime Error | 0 | 0 | 183 | for i in range(5):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
if a<0:
x=abs(a)*c+d+b*e
print(x)
else:
y=(b-a)*e
print(y)
| Traceback (most recent call last):
File "/tmp/tmppwnzhs_5/tmpeiyl8tsc.py", line 2, in <module>
a=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s787780051 | p00553 | u814278309 | 1559382492 | Python | Python3 | py | Runtime Error | 0 | 0 | 220 | for i in range(5):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
if a<0 and a<b:
x=abs(a)*c+d+b*e
print(x)
elif a>0 and a<b:
y=(b-a)*e
print(y)
else:
pass
| Traceback (most recent call last):
File "/tmp/tmpu_xo91vh/tmpmrj9ikua.py", line 2, in <module>
a=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s945909442 | p00553 | u814278309 | 1559382767 | Python | Python3 | py | Runtime Error | 0 | 0 | 221 | for i in range(5):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
if a<0 and a<b:
x=abs(a)*c+d+b*e
print(x)
elif a>0 and a<b:
y=(b-a)*e
print(y)
else:
break
| Traceback (most recent call last):
File "/tmp/tmpy7bbves1/tmpzao064i4.py", line 2, in <module>
a=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s927570878 | p00553 | u584110575 | 1484021416 | Python | Python3 | py | Runtime Error | 0 | 0 | 168 | a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
>>> import time
>>> time.sleep(1)
if(a>=0):
print ((b-a)*e);
else:
print(a*-c+d+b*e); | File "/tmp/tmprfelgx_p/tmp2z1v69xk.py", line 6
>>> import time
^^
SyntaxError: invalid syntax
| |
s519429963 | p00553 | u220324665 | 1484391624 | Python | Python3 | py | Runtime Error | 40000 | 7416 | 149 | import time
s=time.time()
while time.time()-s<39.99:pass
i=input;a,b,c,d,e=map(int,[i(),i(),i(),i(),i()])
print(c*-a+d+b*e)if a<0 else print((b-a)*e) | ||
s311123586 | p00553 | u220324665 | 1484391845 | Python | Python3 | py | Runtime Error | 40000 | 7264 | 149 | import time
s=time.time()
while time.time()-s<39.99:pass
i=input;a,b,c,d,e=map(int,[i(),i(),i(),i(),i()])
print(c*-a+d+b*e)if a<0 else print((b-a)*e) | Traceback (most recent call last):
File "/tmp/tmpbyny1h9n/tmpol_00w64.py", line 4, in <module>
i=input;a,b,c,d,e=map(int,[i(),i(),i(),i(),i()])
^^^
EOFError: EOF when reading a line
| |
s159956843 | p00553 | u220324665 | 1484391966 | Python | Python3 | py | Runtime Error | 40000 | 7420 | 149 | import time
s=time.time()
while time.time()-s<39.99:pass
i=input
a,b,c,d,e=map(int,[i(),i(),i(),i(),i()])
print(c*-a+d+b*e)if a<0 else print((b-a)*e) | ||
s079592596 | p00553 | u220324665 | 1484392084 | Python | Python3 | py | Runtime Error | 40000 | 7356 | 150 | import time
s=time.time()
while time.time()-s<39.99:pass
i=input;a,b,c,d,e=map(int,[i(),i(),i(),i(),i()])
if a<0:print(c*-a+d+b*e)
else:print((b-a)*e) | ||
s642100078 | p00553 | u220324665 | 1484392187 | Python | Python3 | py | Runtime Error | 40000 | 7336 | 150 | import time
s=time.time()
while time.time()-s<39.99:pass
i=input
a,b,c,d,e=map(int,[i(),i(),i(),i(),i()])
if a<0:print(c*-a+d+b*e)
else:print((b-a)*e) | ||
s698498716 | p00553 | u503263570 | 1501160730 | Python | Python3 | py | Runtime Error | 0 | 0 | 351 | A=?????¨?????¨??????????????? = int(input())
B=??????????????? = int(input())
C=?????£????????????????????????????????????????????? = int(input())
D=?????£??????????§£?????????????????????????????? = int(input())
E=?????£?????????????????????????????????????????????????????? = int(input())
if A>0:
print((B-A)*E)
else... | File "/tmp/tmp6_oujv5r/tmpieg3t7ou.py", line 1
A=?????¨?????¨??????????????? = int(input())
^
SyntaxError: invalid character '¨' (U+00A8)
| |
s893833079 | p00556 | u352394527 | 1531233486 | Python | Python3 | py | Runtime Error | 13760 | 115236 | 612 | INF = 10 ** 20
def minimum_cost(rest, init, dic):
if rest in dic:
return dic[rest]
if rest == ():
return 0
ret = INF
for nex in rest:
nex_init = init + acc[nex]
ret = min(ret, minimum_cost(tuple(i for i in rest if i != nex), nex_init, dic) +\
acc[nex] - (cums[nex][nex_init] ... | Traceback (most recent call last):
File "/tmp/tmppebd4x8z/tmpphyev_ir.py", line 17, in <module>
n, m = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s689681787 | p00556 | u352394527 | 1531234122 | Python | Python3 | py | Runtime Error | 9790 | 108596 | 757 | def main():
INF = 10 ** 20
def minimum_cost(rest, init, dic):
if rest in dic:
return dic[rest]
if rest == ():
return 0
ret = INF
for nex in rest:
accnex = acc[nex]
cumsnex = cums[nex]
nex_init = init + accnex
tmp = minimum_cost(tuple([i for i in rest if i !... | Traceback (most recent call last):
File "/tmp/tmpvv21t5_q/tmprfspslvi.py", line 33, in <module>
main()
File "/tmp/tmpvv21t5_q/tmprfspslvi.py", line 22, in main
n, m = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s334471858 | p00556 | u450407555 | 1485517743 | Python | Python | py | Runtime Error | 40000 | 135000 | 634 | import sys
n, m = map(int, raw_input().split())
cnt = [0 for _ in range(n)]
cntS = [[0 for _ in range(n)] for _ in range(m)]
for i in range(n):
k = input()-1
cnt[k] += 1
cntS[k][i] = 1
for k in range(m):
for i in range(n-1):
cntS[k][i+1] += cntS[k][i]
dp = [sys.maxint/4 for _ in range(1<<m)]
dp[0] = 0
... | File "/tmp/tmp1f3w766y/tmpnplgvnvq.py", line 30
print dp[(1<<m)-1]
^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s824360433 | p00556 | u260980560 | 1512764354 | Python | Python3 | py | Runtime Error | 18420 | 59844 | 736 | N, M = map(int, input().split())
N2 = 2**N.bit_length()
D = [[0]*(N2+1) for i in range(M)]
def get(i, k):
data = D[i]
s = 0
while k:
s += data[k]
k -= k & -k
return s
def add(i, k, x):
data = D[i]
while k <= N2:
data[k] += x
k += k & -k
cnts = [0]*M
for i in range... | Traceback (most recent call last):
File "/tmp/tmpatud80ei/tmp6guq499p.py", line 1, in <module>
N, M = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s122388488 | p00565 | u881891940 | 1530105750 | Python | Python3 | py | Runtime Error | 0 | 0 | 132 | n = int(input())
a = list(map(int,input()(split()))
for i in range(1,n):
if a[i] > 0:
a[i] += a[i-1]
print(max(a[i])+1)
| File "/tmp/tmp28lhe23l/tmp2bw633p9.py", line 2
a = list(map(int,input()(split()))
^
SyntaxError: '(' was never closed
| |
s141343012 | p00565 | u881891940 | 1530105847 | Python | Python3 | py | Runtime Error | 0 | 0 | 131 | n = int(input())
a = list(map(int,input().split())
for i in range(1,n):
if a[i] > 0:
a[i] += a[i-1]
print(max(a[i])+1)
| File "/tmp/tmptwk47k00/tmp8xaxco_9.py", line 2
a = list(map(int,input().split())
^
SyntaxError: '(' was never closed
| |
s154122236 | p00570 | u363745648 | 1530284290 | Python | Python3 | py | Runtime Error | 0 | 0 | 1037 | n,k = map(int,input().split())
numbers = []
times = []
for i in range(n):
numbers.append(i)
times.append(int(input()))
candidates = [ [0] + x for x in gen_kcombination(numbers[1:],k-1)]
bestTime = times[-1] + 1
for i in range(len(candidates)):
candidate = candidates[i]
time = 0
for j in range(k-1):
ig... | File "/tmp/tmpxya9ozz0/tmphg8qp73y.py", line 23
return time
^^^^^^^^^^^
SyntaxError: 'return' outside function
| |
s618003503 | p00570 | u363745648 | 1530284395 | Python | Python3 | py | Runtime Error | 0 | 0 | 1037 | n,k = map(int,input().split())
numbers = []
times = []
for i in range(n):
numbers.append(i)
times.append(int(input()))
candidates = [ [0] + x for x in gen_kcombination(numbers[1:],k-1)]
bestTime = times[-1] + 1
for i in range(len(candidates)):
candidate = candidates[i]
time = 0
for j in range(k-1):
ig... | File "/tmp/tmpaneqhsla/tmpzajo26mv.py", line 23
return time
^^^^^^^^^^^
SyntaxError: 'return' outside function
| |
s823908106 | p00570 | u363745648 | 1530284800 | Python | Python3 | py | Runtime Error | 20 | 5616 | 1036 | def gen_kcombination(lis,k):
if k >= len(lis):
return [lis]
kcombs = []
if k == 1:
return [[x] for x in lis]
for i in range(len(lis... | Traceback (most recent call last):
File "/tmp/tmp7n0ggu5q/tmpspceu0je.py", line 11, in <module>
n,k = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s922677830 | p00574 | u002193969 | 1522546708 | Python | Python3 | py | Runtime Error | 0 | 0 | 740 | L, Q = [int(x) for x in input().split()]
poison = [int(x) for x in list(input())]
i = 0
while i < Q:
ans = 0
snakelist = []
newsnakelist = []
snakelist.append(input())
for x in range(0,L):
for snake in snakelist:
if snake[x] == "?":
a = snake[:x] + "0" + snake[x+1... | Traceback (most recent call last):
File "/tmp/tmpv2c6d0s0/tmp2rywxzdb.py", line 1, in <module>
L, Q = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s177393492 | p00574 | u002193969 | 1522546786 | Python | Python3 | py | Runtime Error | 0 | 0 | 719 | L, Q = [int(x) for x in input().split()]
poison = [int(x) for x in list(input())]
i = 0
while i < Q:
ans = 0
snakelist = []
newsnakelist = []
snakelist.append(input())
for x in range(0,L):
for snake in snakelist:
if snake[x] == "?":
a = snake[:x] + "0" + snake[x+1... | Traceback (most recent call last):
File "/tmp/tmprxv9z4c_/tmpga5ozjaa.py", line 1, in <module>
L, Q = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.