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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s132140557 | p00222 | u633068244 | 1399123833 | Python | Python | py | Runtime Error | 0 | 0 | 48 | while 1:
n = input()
if n == 0: break
print n | File "/tmp/tmpptz_ogyl/tmplb7pxtzj.py", line 4
print n
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s023287060 | p00222 | u633068244 | 1399123881 | Python | Python | py | Runtime Error | 0 | 0 | 49 | while 1:
n = input()
if n == 0: break
print(n) | Traceback (most recent call last):
File "/tmp/tmpubl__nqh/tmp6zrcup4j.py", line 2, in <module>
n = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s188736605 | p00222 | u633068244 | 1400422175 | Python | Python | py | Runtime Error | 0 | 0 | 233 | r =10000001
p = [1]*r
p[0]= p[1] = 0
for i in range(int(r**0.5)):
if p[i]:
p[2*i::i] = [0 for j in range(2*i,r,i)]
while 1:
n = input()
if n == 0: break
n -= 1-n%2
while any(not p[n-i] for i in [0,2,6,8]):
n -= 2
print n | File "/tmp/tmpjymk1lfx/tmpkrq4h6op.py", line 14
print n
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s747637393 | p00223 | u319725914 | 1535894637 | Python | Python3 | py | Runtime Error | 0 | 0 | 1884 | from line_profiler import LineProfiler
from collections import deque
def main():
while(True):
W, H = map(int, input().split())
# print(W,H)
if not W: break
tx,ty = map(int, input().split())
kx,ky = map(int, input().split())
ma = [[False]*(W+2) for _ in range(H+2)]
for i in range(1,H+1):
for j,a in enumerate(input().split()):
ma[i][j+1] = bool(1-int(a))
from pprint import pprint
que = deque([[tx,ty,kx,ky,0]])
# pa = [[[[False]*(W+2) for ii in range(H+2)] for jj in range(W+2)] for kk in range(H+2)]
pas = []
ans = "NA"
while(que):
# if len(que)>10:break
# pprint(que)
tx,ty,kx,ky,c = que.popleft()
# import copy
# toprint = copy.deepcopy(ma)
# toprint[ty][tx] = "tt"
# toprint[ky][kx] = "kk"
# for i in range(H+2):
# print("".join(( toprint[i][j] if toprint[i][j] in ["tt","kk"] else " ") if toprint[i][j] else "**" for j in range(W+2)))
if c > 100: break
if tx == kx and ty == ky:
ans = c
break
for dx,dy in [[-1,0],[0,-1],[1,0],[0,1]]:
tdx, tdy = [ dx, dy] if ma[ty+dy][tx+dx] else [0,0]
kdx, kdy = [-dx,-dy] if ma[ky-dy][kx-dx] else [0,0]
# if pa[tx+tdx][ty+tdy][kx+kdx][ky+kdy]: continue
if [tx+tdx,ty+tdy,kx+kdx,ky+kdy] in pas: continue
que.append([tx+tdx,ty+tdy,kx+kdx,ky+kdy,c+1])
# pa[tx+tdx][ty+tdy][kx+kdx][ky+kdy] = True
pas.append([tx+tdx,ty+tdy,kx+kdx,ky+kdy])
print(ans)
# pprint(ma)
if __name__ == "__main__":
prf = LineProfiler()
prf.add_function(main)
prf.runcall(main)
prf.print_stats()
# main()
| Traceback (most recent call last):
File "/tmp/tmpbun7fvoj/tmpwxfiey5p.py", line 1, in <module>
from line_profiler import LineProfiler
ModuleNotFoundError: No module named 'line_profiler'
| |
s707834581 | p00223 | u319725914 | 1535895877 | Python | Python3 | py | Runtime Error | 0 | 0 | 1252 | # from line_profiler import LineProfiler
from collections import deque
from sys import stdin
def main():
while(True):
W, H = map(int, sys.stdin().split())
if not W: break
tx,ty = map(int, sys.stdin().split())
kx,ky = map(int, sys.stdin().split())
ma = [[False]*(W+2) for _ in range(H+2)]
for i in range(1,H+1):
for j,a in enumerate(sys.stdin().split()):
ma[i][j+1] = bool(1-int(a))
que = deque([[tx,ty,kx,ky,0]])
pas = set()
ans = "NA"
while(que):
tx,ty,kx,ky,c = que.popleft()
if c > 100: break
if tx == kx and ty == ky:
ans = c
break
for dx,dy in [[-1,0],[0,-1],[1,0],[0,1]]:
tdx, tdy = [ dx, dy] if ma[ty+dy][tx+dx] else [0,0]
kdx, kdy = [-dx,-dy] if ma[ky-dy][kx-dx] else [0,0]
if (tx+tdx,ty+tdy,kx+kdx,ky+kdy) in pas: continue
que.append([tx+tdx,ty+tdy,kx+kdx,ky+kdy,c+1])
pas.add((tx+tdx,ty+tdy,kx+kdx,ky+kdy))
print(ans)
if __name__ == "__main__":
# prf = LineProfiler()
# prf.add_function(main)
# prf.runcall(main)
# prf.print_stats()
main()
| Traceback (most recent call last):
File "/tmp/tmptby54m62/tmp3321ngjr.py", line 37, in <module>
main()
File "/tmp/tmptby54m62/tmp3321ngjr.py", line 7, in main
W, H = map(int, sys.stdin().split())
^^^
NameError: name 'sys' is not defined
| |
s669080304 | p00223 | u319725914 | 1535896094 | Python | Python3 | py | Runtime Error | 0 | 0 | 1273 | from line_profiler import LineProfiler
from collections import deque
from sys import stdin
def main():
while(True):
W, H = map(int, stdin.readline().split())
if not W: break
tx,ty = map(int, stdin.readline().split())
kx,ky = map(int, stdin.readline().split())
ma = [[False]*(W+2) for _ in range(H+2)]
for i in range(1,H+1):
for j,a in enumerate(stdin.readline().split()):
ma[i][j+1] = bool(1-int(a))
que = deque([[tx,ty,kx,ky,0]])
pas = set()
ans = "NA"
while(que):
tx,ty,kx,ky,c = que.popleft()
if tx == kx and ty == ky:
ans = c
break
for dx,dy in [[-1,0],[0,-1],[1,0],[0,1]]:
tdx, tdy = [ dx, dy] if ma[ty+dy][tx+dx] else [0,0]
kdx, kdy = [-dx,-dy] if ma[ky-dy][kx-dx] else [0,0]
if (tx+tdx,ty+tdy,kx+kdx,ky+kdy) in pas: continue
if c+1 > 100: continue
que.append([tx+tdx,ty+tdy,kx+kdx,ky+kdy,c+1])
pas.add((tx+tdx,ty+tdy,kx+kdx,ky+kdy))
print(ans)
if __name__ == "__main__":
prf = LineProfiler()
prf.add_function(main)
prf.runcall(main)
prf.print_stats()
# main()
| Traceback (most recent call last):
File "/tmp/tmpx114ab4v/tmp9z05svym.py", line 1, in <module>
from line_profiler import LineProfiler
ModuleNotFoundError: No module named 'line_profiler'
| |
s604727891 | p00223 | u319725914 | 1535896715 | Python | Python3 | py | Runtime Error | 0 | 0 | 1299 | from line_profiler import LineProfiler
from collections import deque
from sys import stdin
def main():
while(True):
W, H = map(int, stdin.readline().split())
if not W: break
tx,ty = map(int, stdin.readline().split())
kx,ky = map(int, stdin.readline().split())
ma = [[False]*(W+2) for _ in range(H+2)]
for i in range(1,H+1):
for j,a in enumerate(stdin.readline().split()):
ma[i][j+1] = bool(1-int(a))
que = deque([[tx,ty,kx,ky,0]])
pas = set()
ans = "NA"
while(que):
tx,ty,kx,ky,c = que.popleft()
if tx == kx and ty == ky:
ans = c
break
for dx,dy in [[-1,0],[0,-1],[1,0],[0,1]]:
tdx, tdy = ( dx, dy) if ma[ty+dy][tx+dx] else (0,0)
kdx, kdy = (-dx,-dy) if ma[ky-dy][kx-dx] else (0,0)
ttx,tty,kkx,kky = tx+tdx,ty+tdy,kx+kdx,ky+kdy
if (ttx,tty,kkx,kky) in pas: continue
if c+1 > 100: continue
que.append([ttx,tty,kkx,kky,c+1])
pas.add((ttx,tty,kkx,kky))
print(ans)
if __name__ == "__main__":
prf = LineProfiler()
prf.add_function(main)
prf.runcall(main)
prf.print_stats()
# main()
| Traceback (most recent call last):
File "/tmp/tmpnjamj72y/tmpox94aq3g.py", line 1, in <module>
from line_profiler import LineProfiler
ModuleNotFoundError: No module named 'line_profiler'
| |
s052862371 | p00223 | u766477342 | 1419778453 | Python | Python3 | py | Runtime Error | 0 | 0 | 1663 | direc = ((1,0),(-1,0),(0,1),(0,-1))
#d = [[[[0 for i in range(Y+1)] for i in range(X+1)] for i in range(Y+1)] for i in range(X+1)]
#d[1][1][2][2]=3
# print(d)
while 1:
X, Y = list(map(int,input().split()))
if X == 0: break
ftx, fty = list(map(lambda x: x-1, map(int, input().split())))
fkx, fky = list(map(lambda x: x-1, map(int, input().split())))
m = [list(map(int, input().split())) for i in range(Y)]
d = {(ftx, fty, fkx, fky): 0}
s = [[0, (ftx, fty, fkx, fky)]]
res = 'NA'
while len(s) > 0:
spm = s.pop(0)
cnt = spm[0] + 1
if cnt > 100:
break
def search_move():
for i in range(4):
tx = spm[1][0]+direc[i][0]
ty = spm[1][1]+direc[i][1]
kx = spm[1][2]-direc[i][0]
ky = spm[1][3]-direc[i][1]
hm = 0
if tx < 0 or tx >= X or ty < 0 or ty >= Y or m[ty][tx] == 1:
tx = ftx
ty = fty
hm += 1
if kx < 0 or kx >= X or ky < 0 or ky >= Y or m[ky][kx] == 1:
kx = fkx
ky = fky
hm += 1
hm == 2: continue
tpl = (tx,ty,kx,ky)
if tpl in d and d[tpl] <= cnt:
continue
if tx == kx and ty == ky:
return True
else:
s.append([cnt,tpl])
d[tpl] = cnt
# print(tpl)
return False
if search_move():
res = str(cnt)
break
print(res) | File "/tmp/tmp1agsvxc7/tmpe0iagelu.py", line 44
hm == 2: continue
^
SyntaxError: invalid syntax
| |
s872824467 | p00224 | u811434779 | 1438695705 | Python | Python | py | Runtime Error | 0 | 0 | 1602 | import Queue
INF = 1 << 29
class Edge:
def __init__(self, _v, _cost):
self.v = _v
self.cost = _cost
def parse(s, m, n):
if(s[0]=="C"): return int(s.translate(None, "C")) - 1
elif(s[0]=="L"): return int(s.translate(None, "L")) - 1 + m
elif(s[0]=="H"): return m + n
else: return m + n + 1
while True:
m, n, k, d = map(int, raw_input().split())
if m==0 and n==0 and k==0 and d==0: break
cake = map(int, raw_input().split())
G = [[]*(m + n + 2) for i in range((m + n + 2))]
for i in range(d):
dist = raw_input().split()
u = parse(dist[0], m, n)
v = parse(dist[1], m ,n)
G[v].append(Edge(u, int(dist[2])))
G[u].append(Edge(v, int(dist[2])))
D = [[0 for col in range(108)] for row in range(1<<6)]
for i in range(m + n + 2):
for j in range(1 << m):
D[i][j] = INF
D[m + n][0] = 0
ans = INF
que = Queue.PriorityQueue()
que.put([0, [m + n, 0]])
while not que.empty():
item = que.get()
d_now = -item[0]
u = item[1][0]
s = item[1][1]
if D[u][s] < d_now: continue
if u == m + n + 1: ans = min(ans, d_now)
for i in range(len(G[u])):
v = G[u][i].v
if v < m:
if s&1 << v != 0: continue
s2 = s | 1 << v
d2 = d_now + k * G[u][i].cost - cake[v]
else :
s2 = s
d2 = d_now + k * G[u][i].cost
if d2 < D[v][s2]:
D[v][s2] = d2
que.put([-d2, [v, s2]])
print ans | File "/tmp/tmp2r9kp2j3/tmpkhzdvt7e.py", line 50
print ans
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s484103854 | p00224 | u811434779 | 1438696218 | Python | Python | py | Runtime Error | 0 | 0 | 1590 | import Queue
INF = 1 << 29
class Edge:
def __init__(self, _v, _cost):
self.v = _v
self.cost = _cost
def parse(s, m, n):
if(s[0]=="C"): return int(s.translate(None, "C")) - 1
elif(s[0]=="L"): return int(s.translate(None, "L")) - 1 + m
elif(s[0]=="H"): return m + n
else: return m + n + 1
while True:
m, n, k, d = map(int, raw_input().split())
if m==0 and n==0 and k==0 and d==0: break
cake = map(int, raw_input().split())
G = [[] for i in range((m + n + 2))]
for i in range(d):
dist = raw_input().split()
u = parse(dist[0], m, n)
v = parse(dist[1], m ,n)
G[v].append(Edge(u, int(dist[2])))
G[u].append(Edge(v, int(dist[2])))
D = [[0 for col in range(108)] for row in range(1<<6)]
for i in range(m + n + 2):
for j in range(1 << m):
D[i][j] = INF
D[m + n][0] = 0
ans = INF
que = Queue.PriorityQueue()
que.put([0, [m + n, 0]])
while not que.empty():
item = que.get()
d_now = -item[0]
u = item[1][0]
s = item[1][1]
if D[u][s] < d_now: continue
if u == m + n + 1: ans = min(ans, d_now)
for i in range(len(G[u])):
v = G[u][i].v
if v < m:
if s&1 << v != 0: continue
s2 = s | 1 << v
d2 = d_now + k * G[u][i].cost - cake[v]
else :
s2 = s
d2 = d_now + k * G[u][i].cost
if d2 < D[v][s2]:
D[v][s2] = d2
que.put([-d2, [v, s2]])
print ans | File "/tmp/tmpxed3tmf_/tmpb5yo78dh.py", line 50
print ans
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s309301895 | p00224 | u811434779 | 1438697216 | Python | Python | py | Runtime Error | 39870 | 5384 | 1588 | import Queue
INF = 1 << 29
class Edge:
def __init__(self, _v, _cost):
self.v = _v
self.cost = _cost
def parse(s, m, n):
if(s[0]=="C"): return int(s.translate(None, "C")) - 1
elif(s[0]=="L"): return int(s.translate(None, "L")) - 1 + m
elif(s[0]=="H"): return m + n
else: return m + n + 1
while True:
m, n, k, d = map(int, raw_input().split())
if m==0 and n==0 and k==0 and d==0: break
cake = map(int, raw_input().split())
G = [[] for i in range(m + n + 2)]
for i in range(d):
dist = raw_input().split()
u = parse(dist[0], m, n)
v = parse(dist[1], m ,n)
G[v].append(Edge(u, int(dist[2])))
G[u].append(Edge(v, int(dist[2])))
D = [[0 for col in range(1<<6)] for row in range(108)]
for i in range(m + n + 2):
for j in range(1 << m):
D[i][j] = INF
D[m + n][0] = 0
ans = INF
que = Queue.PriorityQueue()
que.put([0, [m + n, 0]])
while not que.empty():
item = que.get()
d_now = -item[0]
u = item[1][0]
s = item[1][1]
if D[u][s] < d_now: continue
if u == m + n + 1: ans = min(ans, d_now)
for i in range(len(G[u])):
v = G[u][i].v
if v < m:
if s&1 << v != 0: continue
s2 = s | 1 << v
d2 = d_now + k * G[u][i].cost - cake[v]
else :
s2 = s
d2 = d_now + k * G[u][i].cost
if d2 < D[v][s2]:
D[v][s2] = d2
que.put([-d2, [v, s2]])
print ans | File "/tmp/tmpk7kyipy_/tmpk3p7f8q2.py", line 50
print ans
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s247479102 | p00224 | u352394527 | 1530035047 | Python | Python3 | py | Runtime Error | 0 | 0 | 2122 | from itertools import combinations
from heapq import heappop, heappush
INF = 10 ** 20
def convert(s, m, n):
if s == "H":
return 0
if s == "D":
return 1
if s[0] == "C":
return int(s[1]) + 1
if s[0] == "L":
return int(s[1]) + m + 1
def get_cost(start, m, n, edges):
cost = [INF] * (m + n + 2)
cost[start] = 0
que = []
heappush(que, (0, start))
while que:
total, point = heappop(que)
for dist, to in edges[point]:
if cost[to] > total + dist:
cost[to] = total + dist
if not (2 <= to <= m + 1):
heappush(que, (total + dist, to))
return cost
def shortest_path(start, goal, rest, cakes_dist, dic):
if not rest:
return cakes_dist[start][goal]
if (start, rest) in dic:
return dic[(now, rest)]
ret = INF
for to in rest:
ret = min(ret, shortest_path(to, goal, tuple((i for i in rest if i != to)), cakes_dist, dic) + cakes_dist[start][to])
dic[(start, rest)] = ret
return ret
while True:
m, n, k, d = map(int, input().split())
if m == 0:
break
clst = list(map(int, input().split()))
"""
Home ... 0
D ... 1
Cake ... 2, 3, ... m + 1
Land ... m + 2, m + 3, ... m + n + 1
"""
edges = [[] for _ in range(m + n + 2)]
for _ in range(d):
s, t, e = input().split()
e = int(e)
s = convert(s, m, n)
t = convert(t, m, n)
edges[s].append((e, t))
edges[t].append((e, s))
cakes_dist = [[INF] * (m + 2) for _ in range(m + 2)]
for start in range(m + 2):
cost = get_cost(start, m, n, edges)
for to in range(m + 2):
if to != start:
cakes_dist[start][to] = cost[to]
dic = {}
"""
now ... ็พๅจใใ็น
rest ... ๆฎใใฎใใใ็น
dic[(now, rest)] ... ็พๅจใใ็นใๆฎใใฎ็นใใพใใๆใฎๆๅฐ่ท้ข
dic[(now, rest)] = min(cakes_dist[now][to] + dic[(to, rest - to)] for to in rest)
"""
ans = INF
cakes = [i for i in range(2, m + 2)]
for num in range(m + 1):
for rest in combinations(cakes, num):
cal = sum([clst[i - 2] for i in rest])
ans = min(ans, shortest_path(0, 1, rest, cakes_dist, dic) * k - cal)
print(ans)
| Traceback (most recent call last):
File "/tmp/tmp6vsv_f2p/tmpi3f3rnl2.py", line 43, in <module>
m, n, k, d = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s746751127 | p00224 | u352394527 | 1530035110 | Python | Python3 | py | Runtime Error | 0 | 0 | 2164 | from itertools import combinations
from heapq import heappop, heappush
import sys
sys.setrecursionlimit(1000000)
INF = 10 ** 20
def convert(s, m, n):
if s == "H":
return 0
if s == "D":
return 1
if s[0] == "C":
return int(s[1]) + 1
if s[0] == "L":
return int(s[1]) + m + 1
def get_cost(start, m, n, edges):
cost = [INF] * (m + n + 2)
cost[start] = 0
que = []
heappush(que, (0, start))
while que:
total, point = heappop(que)
for dist, to in edges[point]:
if cost[to] > total + dist:
cost[to] = total + dist
if not (2 <= to <= m + 1):
heappush(que, (total + dist, to))
return cost
def shortest_path(start, goal, rest, cakes_dist, dic):
if not rest:
return cakes_dist[start][goal]
if (start, rest) in dic:
return dic[(now, rest)]
ret = INF
for to in rest:
ret = min(ret, shortest_path(to, goal, tuple((i for i in rest if i != to)), cakes_dist, dic) + cakes_dist[start][to])
dic[(start, rest)] = ret
return ret
while True:
m, n, k, d = map(int, input().split())
if m == 0:
break
clst = list(map(int, input().split()))
"""
Home ... 0
D ... 1
Cake ... 2, 3, ... m + 1
Land ... m + 2, m + 3, ... m + n + 1
"""
edges = [[] for _ in range(m + n + 2)]
for _ in range(d):
s, t, e = input().split()
e = int(e)
s = convert(s, m, n)
t = convert(t, m, n)
edges[s].append((e, t))
edges[t].append((e, s))
cakes_dist = [[INF] * (m + 2) for _ in range(m + 2)]
for start in range(m + 2):
cost = get_cost(start, m, n, edges)
for to in range(m + 2):
if to != start:
cakes_dist[start][to] = cost[to]
dic = {}
"""
now ... ็พๅจใใ็น
rest ... ๆฎใใฎใใใ็น
dic[(now, rest)] ... ็พๅจใใ็นใๆฎใใฎ็นใใพใใๆใฎๆๅฐ่ท้ข
dic[(now, rest)] = min(cakes_dist[now][to] + dic[(to, rest - to)] for to in rest)
"""
ans = INF
cakes = [i for i in range(2, m + 2)]
for num in range(m + 1):
for rest in combinations(cakes, num):
cal = sum([clst[i - 2] for i in rest])
ans = min(ans, shortest_path(0, 1, rest, cakes_dist, dic) * k - cal)
print(ans)
| Traceback (most recent call last):
File "/tmp/tmpmg9mvd0h/tmpieuihii2.py", line 45, in <module>
m, n, k, d = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s063425437 | p00224 | u352394527 | 1530036198 | Python | Python3 | py | Runtime Error | 0 | 0 | 2186 | from itertools import combinations
from heapq import heappop, heappush
import sys
sys.setrecursionlimit(1000000)
INF = 10 ** 20
def convert(s, m, n):
if s == "H":
return 0
if s == "D":
return 1
if s[0] == "C":
return int(s[1]) + 1
if s[0] == "L":
return int(s[1]) + m + 1
def get_cost(start, m, n, edges):
cost = [INF] * (m + n + 2)
cost[start] = 0
que = []
heappush(que, (0, start))
while que:
total, node = heappop(que)
for dist, to in edges[node]:
if cost[to] > total + dist:
cost[to] = total + dist
if not (2 <= to <= m + 1):
heappush(que, (total + dist, to))
return cost
def shortest_path(start, goal, rest, cakes_dist, dic):
if not rest:
return cakes_dist[start][goal]
if (start, rest) in dic:
return dic[(now, rest)]
ret = INF
for to in rest:
ret = min(ret, shortest_path(to, goal, tuple((i for i in rest if i != to)), cakes_dist, dic) + cakes_dist[start][to])
dic[(start, rest)] = ret
return ret
while True:
m, n, k, d = map(int, input().split())
if m == 0:
break
clst = list(map(int, input().split()))
"""
Home ... 0
D ... 1
Cake ... 2, 3, ... m + 1
Land ... m + 2, m + 3, ... m + n + 1
"""
edges = [[] for _ in range(m + n + 2)]
for _ in range(d):
s, t, e = input().split()
e = int(e)
s = convert(s, m, n)
t = convert(t, m, n)
edges[s].append((e, t))
edges[t].append((e, s))
cakes_dist = [[INF] * (m + 2) for _ in range(m + 2)]
for start in range(m + 2):
cost = get_cost(start, m, n, edges)
for to in range(m + 2):
if to != start:
cakes_dist[start][to] = cost[to]
print(cakes_dist)
dic = {}
"""
now ... ็พๅจใใ็น
rest ... ๆฎใใฎใใใ็น
dic[(now, rest)] ... ็พๅจใใ็นใๆฎใใฎ็นใใพใใๆใฎๆๅฐ่ท้ข
dic[(now, rest)] = min(cakes_dist[now][to] + dic[(to, rest - to)] for to in rest)
"""
ans = INF
cakes = [i for i in range(2, m + 2)]
for num in range(m + 1):
for rest in combinations(cakes, num):
cal = sum([clst[i - 2] for i in rest])
ans = min(ans, shortest_path(0, 1, rest, cakes_dist, dic) * k - cal)
print(ans)
| Traceback (most recent call last):
File "/tmp/tmpxiuimwd7/tmps361rdu2.py", line 46, in <module>
m, n, k, d = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s615590780 | p00224 | u352394527 | 1530036224 | Python | Python3 | py | Runtime Error | 0 | 0 | 2194 | from itertools import combinations
from heapq import heappop, heappush
import sys
sys.setrecursionlimit(1000000)
INF = 10 ** 20
def convert(s, m, n):
if s == "H":
return 0
if s == "D":
return 1
if s[0] == "C":
return int(s[1]) + 1
if s[0] == "L":
return int(s[1]) + m + 1
def get_cost(start, m, n, edges):
cost = [INF] * (m + n + 2)
cost[start] = 0
que = []
heappush(que, (0, start))
while que:
total, node = heappop(que)
for dist, to in edges[node]:
if cost[to] > total + dist:
cost[to] = total + dist
if not (2 <= to <= m + 1):
heappush(que, (total + dist, to))
return cost
def shortest_path(start, goal, rest, cakes_dist, dic):
if not rest:
return cakes_dist[start][goal]
if (start, rest) in dic:
return dic[(now, rest)]
ret = INF
for to in rest:
ret = min(ret, shortest_path(to, goal, tuple((i for i in rest if i != to)), cakes_dist, dic) + cakes_dist[start][to])
dic[(start, rest)] = ret
return ret
print(0)
while True:
m, n, k, d = map(int, input().split())
if m == 0:
break
clst = list(map(int, input().split()))
"""
Home ... 0
D ... 1
Cake ... 2, 3, ... m + 1
Land ... m + 2, m + 3, ... m + n + 1
"""
edges = [[] for _ in range(m + n + 2)]
for _ in range(d):
s, t, e = input().split()
e = int(e)
s = convert(s, m, n)
t = convert(t, m, n)
edges[s].append((e, t))
edges[t].append((e, s))
cakes_dist = [[INF] * (m + 2) for _ in range(m + 2)]
for start in range(m + 2):
cost = get_cost(start, m, n, edges)
for to in range(m + 2):
if to != start:
cakes_dist[start][to] = cost[to]
print(cakes_dist)
dic = {}
"""
now ... ็พๅจใใ็น
rest ... ๆฎใใฎใใใ็น
dic[(now, rest)] ... ็พๅจใใ็นใๆฎใใฎ็นใใพใใๆใฎๆๅฐ่ท้ข
dic[(now, rest)] = min(cakes_dist[now][to] + dic[(to, rest - to)] for to in rest)
"""
ans = INF
cakes = [i for i in range(2, m + 2)]
for num in range(m + 1):
for rest in combinations(cakes, num):
cal = sum([clst[i - 2] for i in rest])
ans = min(ans, shortest_path(0, 1, rest, cakes_dist, dic) * k - cal)
print(ans)
| Traceback (most recent call last):
File "/tmp/tmp6uk9kzrq/tmp7dwrejdb.py", line 46, in <module>
m, n, k, d = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| 0
|
s471459494 | p00225 | u779627195 | 1355233095 | Python | Python | py | Runtime Error | 0 | 0 | 935 | import sys
R = lambda:map(int,raw_input().split())
def eulerPath(graph):
odd = [x for x in graph.keys() if len(graph[x])&1]
if len(odd) > 2: return -1
stack = [graph.keys()[0]]
path = []
while stack:
#print stack
v = stack[-1]
if graph[v]:
u = graph[v].pop(0)
stack.append(u)
graph[u].remove(v)
#print graph, stack
else:
path.append(stack.pop())
return path
graph = {}
while 1:
n = int(raw_input())
if not n: break
graph = {}
for i in xrange(n):
a = raw_input()
if not a[0] in graph.keys():
graph[a[0]] = [a[-1]]
else:
graph[a[0]].append(a[-1])
if not a[-1] in graph.keys():
graph[a[-1]] = [a[0]]
else:
graph[a[-1]].append(a[0])
path = eulerPath(graph)
if path is -1: print 'NG'
else: print 'OK' | File "/tmp/tmp7b9ulgzr/tmp0yilqrtk.py", line 42
if path is -1: print 'NG'
^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s009510059 | p00225 | u104911888 | 1369314986 | Python | Python | py | Runtime Error | 0 | 0 | 274 | from collections import defaultdict
while True:
n=input()
if n==0:break
dic=defaultdict(int)
for i in range(n):
w=raw_input()
dic[w[0]]+=1
dic[w[-1]]+=1
if len(set(dic.values()))==1:
print "OK"
else:
print "NG" | File "/tmp/tmputlv8vxq/tmppqaatoq7.py", line 11
print "OK"
^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s005456132 | p00225 | u104911888 | 1369315096 | Python | Python | py | Runtime Error | 0 | 0 | 324 | from collections import defaultdict
while True:
try:
n=input()
except SyntaxError:
pass
if n==0:break
dic=defaultdict(int)
for i in range(n):
w=raw_input()
dic[w[0]]+=1
dic[w[-1]]+=1
if len(set(dic.values()))==1:
print "OK"
else:
print "NG" | File "/tmp/tmp3g_h6f1n/tmp_gyll761.py", line 14
print "OK"
^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s867449336 | p00225 | u794549850 | 1372093840 | Python | Python | py | Runtime Error | 0 | 0 | 1676 | alphabets = {}
alphabets_num = {}
vartexs = []
fail_check = {}
class Vartex():
def __init__(self, string):
global alphabets
self.ID = string
self.link = []
self.arrival = 0
alphabets[string[0]].append(self)
alphabets_num[string[0]] += 1
return
def register(self, new_vartex):
self.link.append(new_vartex)
return
def check_all(vartexs):
for content in vartexs:
if not content.arrival:
return False
return True
def dfs(start_vartex):
global vartexs
start_vartex.arrival = 1
for link_vartex in start_vartex.link:
if link_vartex.arrival:
if check_all(vartexs):
return True
else :
continue
else:
if dfs(link_vartex):
return True
else:
continue
start_vartex.arrival = 0
return False
while True:
alphabets = {}
alphabets_num = {}
vartexs = []
fail_check = {}
for al in range(ord("a"), ord("z")+1):
alphabets[chr(al)] = []
alphabets_num[chr(al)] = 0
fail_check[chr(al)] = 0
n = int(raw_input())
if not n:
break
for x in range(n):
vartexs.append(Vartex(raw_input()))
for x in range(n):
vartex = vartexs[x]
string = vartex.ID
fail_check[string[-1]] += 1
for content in alphabets[string[-1]]:
vartex.register(content)
if alphabets_num != fail_check:
print "NG"
else :
start = vartexs[0]
if dfs(start):
print "OK"
else:
print "NG" | File "/tmp/tmpc9oiuxjz/tmpl_ro4e3g.py", line 69
print "NG"
^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s717453326 | p00225 | u794549850 | 1372094044 | Python | Python | py | Runtime Error | 0 | 0 | 1677 | alphabets = {}
alphabets_num = {}
vartexs = []
fail_check = {}
class Vartex():
def __init__(self, string):
global alphabets
self.ID = string
self.link = []
self.arrival = 0
alphabets[string[0]].append(self)
alphabets_num[string[0]] += 1
return
def register(self, new_vartex):
self.link.append(new_vartex)
return
def check_all(vartexs):
for content in vartexs:
if not content.arrival:
return False
return True
def dfs(start_vartex):
global vartexs
start_vartex.arrival = 1
for link_vartex in start_vartex.link:
if link_vartex.arrival:
if check_all(vartexs):
return True
else :
continue
else:
if dfs(link_vartex):
return True
else:
continue
start_vartex.arrival = 0
return False
while True:
alphabets = {}
alphabets_num = {}
vartexs = []
fail_check = {}
for al in range(ord("a"), ord("z")+1):
alphabets[chr(al)] = []
alphabets_num[chr(al)] = 0
fail_check[chr(al)] = 0
n = int(raw_input())
if n == 0:
break
for x in range(n):
vartexs.append(Vartex(raw_input()))
for x in range(n):
vartex = vartexs[x]
string = vartex.ID
fail_check[string[-1]] += 1
for content in alphabets[string[-1]]:
vartex.register(content)
if alphabets_num != fail_check:
print "NG"
else :
start = vartexs[0]
if dfs(start):
print "OK"
else:
print "NG" | File "/tmp/tmpbw2310eh/tmp0xo7f4ty.py", line 69
print "NG"
^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s691385727 | p00225 | u104911888 | 1372169288 | Python | Python | py | Runtime Error | 0 | 0 | 319 | while True:
n=input()
if n==0:break
inWd=[0]*26
outWd=[0]*26
for i in range(n):
s=raw_input()
inWd[ord(s[0])-ord("a")]+=1
outWd[ord(s[-1])-ord("a")]+=1
for i in range(26):
if inWd[i]!=outWd[i]:
print "NG"
break
else:
print "OK" | File "/tmp/tmpkmdnb08v/tmpzi2w7wd2.py", line 12
print "NG"
^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s668386026 | p00225 | u104911888 | 1375079105 | Python | Python | py | Runtime Error | 0 | 0 | 727 | def dfs(u):
visited[u]=True
for v in range(26):
if (not visited[v]) and G[u][v]:
dfs(v)
def getNComponent():
nc=0
for i in range(26):
if head[i]==0 and tail[i]==0:
continue
if not visited[i]:
nc+=1
dfs(i)
return nc
while True:
n=input()
if n==0:break
head=[0]*26
tail=[0]*26
visited=[False]*26
G=[[0]*26 for i in range(26)]
for i in range(n):
s=raw_input()
head[ord(s[0])-ord("a")]+=1
tail[ord(s[-1])-ord("a")]+=1
G[ord(s[0])-ord("a")][ord(s[-1])-ord("a")]=1
G[ord(s[-1])-ord("a")][ord(s[0])-ord("a")]=1
print "OK" if head==tail and getNComponent()==1 else "NG" | File "/tmp/tmpxynxwx1j/tmpws8izo0y.py", line 30
print "OK" if head==tail and getNComponent()==1 else "NG"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s685326134 | p00225 | u104911888 | 1375080904 | Python | Python | py | Runtime Error | 0 | 0 | 667 | def dfs(u):
visited[u]=True
f=False
for v in range(26):
if G[u][v]:
f=True
if not visited[v]:
dfs(v)
return f
def getNComponent():
nc=0
for i in range(26):
if (not visited[i]) and dfs(i):
nc+=1
return nc
while True:
n=input()
if n==0:break
head=[0]*26
tail=[0]*26
visited=[False]*26
G=[[False]*26 for i in range(26)]
for i in range(n):
s=raw_input()
a,b=ord(s[0])-ord("a"),ord(s[-1])-ord("a")
head[a]+=1
tail[b]+=1
G[a][b]=G[b][a]=True
print "OK" if head==tail and getNComponent()==1 else "NG" | File "/tmp/tmporwuyqcx/tmpm07as2p3.py", line 31
print "OK" if head==tail and getNComponent()==1 else "NG"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s885828355 | p00225 | u104911888 | 1385220428 | Python | Python | py | Runtime Error | 0 | 0 | 1127 | def dfs(current_node):
for next_node in range(26):
if L[current_node][next_node]:
L[current_node][next_node] = 0
visited[current_node] = True
dfs(next_node)
def getNComponent():
count = 0
for i in range(26):
if inWd[i]==0 and outWd[i]==0:
continue
if not visited[i]:
count += 1
dfs(i)
return count
def check():
for i in range(26):
if inWd[i]!=outWd[i]:
return False
return True
while True:
"""
try:
n = input()
except SyntaxError:
break
"""
n = input()
if n==0:break
inWd = [0]*26
outWd = [0]*26
visited = [False]*26
L = [[0]*26 for i in range(26)]
for i in range(n):
s = raw_input()
first_char_num = ord(s[0])-ord("a")
last_char_num = ord(s[-1])-ord("a")
inWd[first_char_num] += 1
outWd[last_char_num] += 1
L[first_char_num][last_char_num] = 1
L[last_char_num][first_char_num] = 1
if check() and getNComponent()==1:
print "OK"
else:
print "NG" | File "/tmp/tmp8atyp1ts/tmphm9z6t5b.py", line 46
print "OK"
^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s857163919 | p00225 | u104911888 | 1385221579 | Python | Python | py | Runtime Error | 0 | 0 | 1012 | def check():
for i in range(26):
if inWd[i] != outWd[i]:
return False
return True
def dfs(current_node):
visited[current_node] = True
for next_node in range(26):
if not visited[next_node] and L[current_node][next_node]:
dfs(next_node)
def getNComponent():
nc = 0
for i in range(26):
if inWd[i] == 0 and outWd[i] == 0:
continue
if not visited[i]:
nc += 1
dfs(i)
return nc
while True:
try:
n = input()
except SyntaxError:
break
n = input()
if n==0:break
inWd = [0]*26
outWd = [0]*26
visited = [False]*26
L = [[0]*26 for i in range(26)]
for i in range(n):
s = raw_input()
first = ord(s[0])-ord("a")
last = ord(s[-1])-ord("a")
inWd[first] += 1
outWd[last] += 1
L[first][last] = 1
L[last][first] = 1
if check() and getNComponent()==1:
print "OK"
else:
print "NG" | File "/tmp/tmpxqs5en4_/tmpmwv1_x9x.py", line 43
print "OK"
^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s856247717 | p00225 | u104911888 | 1385221735 | Python | Python | py | Runtime Error | 0 | 0 | 947 | def check():
for i in range(26):
if inWd[i] != outWd[i]:
return False
return True
def dfs(current_node):
visited[current_node] = True
for next_node in range(26):
if not visited[next_node] and L[current_node][next_node]:
dfs(next_node)
def getNComponent():
nc = 0
for i in range(26):
if inWd[i] == 0 and outWd[i] == 0:
continue
if not visited[i]:
nc += 1
dfs(i)
return nc
while True:
n = input()
if n == 0:break
inWd = [0]*26
outWd = [0]*26
visited = [False]*26
L = [[0]*26 for i in range(26)]
for i in range(n):
s = raw_input()
first = ord(s[0])-ord("a")
last = ord(s[-1])-ord("a")
inWd[first] += 1
outWd[last] += 1
L[first][last] = 1
L[last][first] = 1
if check() and getNComponent()==1:
print "OK"
else:
print "NG" | File "/tmp/tmp9o95slge/tmpj03gyhke.py", line 39
print "OK"
^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s329244365 | p00225 | u633068244 | 1397003831 | Python | Python | py | Runtime Error | 0 | 0 | 312 | while 1:
n=input()
if n==0: break
ini,end={},{}
for i in range(n):
word=raw_input()
try:ini[word[0]]+=1
except:ini[word[0]]=1
try:end[word[-1]]+=1
except:end[word[-1]]=1
for k,v in ini.items():
if k not in end or end[k]!=v:
print "NG"
break
else:
print "OK" | File "/tmp/tmpskls1tqv/tmptyh2cchp.py", line 6
word=raw_input()
TabError: inconsistent use of tabs and spaces in indentation
| |
s344996129 | p00225 | u633068244 | 1397003874 | Python | Python | py | Runtime Error | 0 | 0 | 314 | while 1:
n=input()
if n==0: break
ini,end={},{}
for i in range(n):
word=raw_input()
try:ini[word[0]]+=1
except:ini[word[0]]=1
try:end[word[-1]]+=1
except:end[word[-1]]=1
for k,v in ini.items():
if k not in end or end[k]!=v:
print "NG"
break
else:
print "OK" | File "/tmp/tmpfpbwm97s/tmpzk8m1qr2.py", line 6
word=raw_input()
TabError: inconsistent use of tabs and spaces in indentation
| |
s255080505 | p00225 | u633068244 | 1397003951 | Python | Python | py | Runtime Error | 0 | 0 | 283 | while 1:
n=input()
if n==0: break
ini,end={},{}
for i in range(n):
word=raw_input()
try:ini[word[0]]+=1
except:ini[word[0]]=1
try:end[word[-1]]+=1
except:end[word[-1]]=1
for k,v in ini.items():
if k not in end or end[k]!=v:
print "NG"
break
else:
print "OK" | File "/tmp/tmpdjx5x9yv/tmp9n66jxjj.py", line 13
print "NG"
^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s611647651 | p00225 | u633068244 | 1397004519 | Python | Python | py | Runtime Error | 0 | 0 | 340 | while 1:
n=input()
if n==0: break
ini,end={},{}
for i in range(n):
word=raw_input()
if word[0]==word[-1]:
continue
try:ini[word[0]]+=1
except:ini[word[0]]=1
try:end[word[-1]]+=1
except:end[word[-1]]=1
for k,v in ini.items():
if k not in end or end[k]!=v:
print "NG"
break
else:
print "OK" | File "/tmp/tmpnv5xrkf1/tmpt72oytk1.py", line 15
print "NG"
^
IndentationError: unindent does not match any outer indentation level
| |
s530566176 | p00225 | u633068244 | 1397004557 | Python | Python | py | Runtime Error | 0 | 0 | 380 | while 1:
try:
n=input()
if n==0: break
ini,end={},{}
for i in range(n):
word=raw_input()
if word[0]==word[-1]:
continue
try:ini[word[0]]+=1
except:ini[word[0]]=1
try:end[word[-1]]+=1
except:end[word[-1]]=1
for k,v in ini.items():
if k not in end or end[k]!=v:
print "NG"
break
else:
print "OK"
except:
break | File "/tmp/tmpxh86b6_7/tmpke4_dexe.py", line 16
print "NG"
^
IndentationError: unindent does not match any outer indentation level
| |
s209450030 | p00226 | u873482706 | 1437728665 | Python | Python | py | Runtime Error | 0 | 0 | 287 | while True:
r, a = raw_input().split()
if r == a == 0: break
h = 0
_r = []
_a = []
for i in range(4):
if a[i] == r[i]:
h += 1
else:
_r.append(r[i])
_a.append(a[i])
else:
print h, len(set(_r)&set(_a)) | File "/tmp/tmppfdnenv0/tmp3p29u7u8.py", line 14
print h, len(set(_r)&set(_a))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s606870645 | p00226 | u546285759 | 1484201427 | Python | Python3 | py | Runtime Error | 0 | 0 | 184 | while True:
r, a= input().split()
if r==a==0: break
print(sum(1 for i, j in zip(r, a) if i==j), sum(1 for i in range(len(r)) for j in range(len(a)) if r[i]==a[j] and i!=j)) | Traceback (most recent call last):
File "/tmp/tmp_2j2_dht/tmpfmeo024v.py", line 2, in <module>
r, a= input().split()
^^^^^^^
EOFError: EOF when reading a line
| |
s799176987 | p00226 | u071693485 | 1509107452 | Python | Python3 | py | Runtime Error | 0 | 0 | 421 | for q in range(12000):
a = tuple(map(int, input().split()))
b = input()
if a[0] == 0 and b[0] == '0':
break
hit = 0
for i in range(4):
if a[i] == int(b[i]):
hit = hit + 1
blow = 0
for j in range(4):
for i in range(4):
if (int(b[j]) == a[i]) and (a[i] != int(b[i])) and (a[j] != int(b[j])):
blow = blow + 1
print(hit, blow) | Traceback (most recent call last):
File "/tmp/tmpqco0qyls/tmpzrpbgn7c.py", line 2, in <module>
a = tuple(map(int, input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s107172751 | p00226 | u460331583 | 1346528889 | Python | Python | py | Runtime Error | 0 | 0 | 341 | while True:
aw=[]
ar = raw_input()
if ar[0] ==0 and ar[1] ==0 and ar[2] ==0: break
else:
hit=0
blo=0
for t in range(5,9):
aw.append(ar[t])
for t in range(0,4):
if ar[t] == aw[t]: hit+=1
for t in range(0,4):
for y in range(0,4):
if ar[t] == aw[y]:
if t == y: break
else: blo +=1
print hit,blo | File "/tmp/tmpw8wn_w1i/tmpigy3furu.py", line 17
print hit,blo
^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s217644249 | p00226 | u350508326 | 1382632159 | Python | Python | py | Runtime Error | 0 | 0 | 442 | if __name__ == '__main__':
while True:
a,b = map(str,raw_input().split(' '))
if a == 0 and b == 0:
break
a = list(a)
b = list(b)
# print a
br = 0
hit = 0
for i,data in enumerate(b):
if data in a:
if a[i] == data:
hit += 1
else:
br += 1
print hit,br | File "/tmp/tmp06j4_ia2/tmpw2rf3737.py", line 27
print hit,br
^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s254109919 | p00227 | u766477342 | 1414673959 | Python | Python3 | py | Runtime Error | 0 | 0 | 340 | while True:
n,m = list(map(int,input().split()))
if n == 0 and m == 0:
break
amari = n % m
yasai = list(map(int,input().split()))
yasai.sort()
s = 0
if amari > 0:
s = sum(yasai[0:amari])
i = 0
for y in yasai[amari:]:
if i % m > 0:
s += y
i+=1
print(s) | Traceback (most recent call last):
File "/tmp/tmp2e4ge4ti/tmpimc3jmth.py", line 2, in <module>
n,m = list(map(int,input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s440319197 | p00227 | u766477342 | 1414674172 | Python | Python3 | py | Runtime Error | 0 | 0 | 299 | while True:
n,m = list(map(int,input().split()))
if n == 0 and m == 0:
break
amari = n % m
yasai = list(map(int,input().split()))
yasai.sort()
s = 0
if amari > 0:
s = sum(yasai[0:amari])
i = 0
for y in yasai[amari:]:
pass
print(s) | Traceback (most recent call last):
File "/tmp/tmpd7s2ca4f/tmpu7jdgojc.py", line 2, in <module>
n,m = list(map(int,input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s788391393 | p00227 | u766477342 | 1414674288 | Python | Python3 | py | Runtime Error | 0 | 0 | 358 | while True:
n,m = list(map(int,input().split()))
if n == 0 and m == 0:
break
amari = int(n % m)
yasai = list(map(int,input().split()))
yasai.sort()
s = 0
if amari > 0:
s = sum(yasai[0:amari])
i = 0
for y in yasai[amari:]:
pass
if i % m > 0:
s += y
i+=1
print(s) | Traceback (most recent call last):
File "/tmp/tmpbkd7utc_/tmp9erjz11v.py", line 2, in <module>
n,m = list(map(int,input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s494687397 | p00227 | u766477342 | 1414674346 | Python | Python3 | py | Runtime Error | 0 | 0 | 177 | while True:
n,m = list(map(int,input().split()))
if n == 0 and m == 0:
break
amari = int(n % m)
yasai = list(map(int,input().split()))
print(amari) | Traceback (most recent call last):
File "/tmp/tmpvye7hzb9/tmplv7js2e8.py", line 2, in <module>
n,m = list(map(int,input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s460424976 | p00227 | u766477342 | 1414674397 | Python | Python3 | py | Runtime Error | 0 | 0 | 69 | while True:
n,m = list(map(int,input().split()))
print(amari) | Traceback (most recent call last):
File "/tmp/tmp0zrthvrc/tmpw13mysa3.py", line 2, in <module>
n,m = list(map(int,input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s416311223 | p00227 | u766477342 | 1414674531 | Python | Python3 | py | Runtime Error | 0 | 0 | 177 | while True:
#n,m = list(map(int,input().split()))
spam = input().split()
n = int(spam[0])
m = int(spam[1])
if n == 0 and m == 0:
break
print(1) | Traceback (most recent call last):
File "/tmp/tmp6mcio2m1/tmplfpcj4ug.py", line 3, in <module>
spam = input().split()
^^^^^^^
EOFError: EOF when reading a line
| |
s551817601 | p00227 | u766477342 | 1414674597 | Python | Python3 | py | Runtime Error | 0 | 0 | 95 | while True:
#n,m = list(map(int,input().split()))
spam = input().split()
print(1) | Traceback (most recent call last):
File "/tmp/tmp4o6ebmwc/tmpskyl388u.py", line 3, in <module>
spam = input().split()
^^^^^^^
EOFError: EOF when reading a line
| |
s355205329 | p00227 | u766477342 | 1414674673 | Python | Python3 | py | Runtime Error | 0 | 0 | 87 | while True:
#n,m = list(map(int,input().split()))
spam = input()
print(1) | Traceback (most recent call last):
File "/tmp/tmpv7qqa3_o/tmpz0zbd7x2.py", line 3, in <module>
spam = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s954737843 | p00227 | u766477342 | 1414675077 | Python | Python | py | Runtime Error | 0 | 0 | 335 | while True:
n,m = map(int,raw_input().split())
if n == 0 and m == 0:
break
amari = n % m
yasai = map(int,raw_input().split())
yasai.sort()
s = 0
if amari > 0:
s = sum(yasai[0:amari])
i = 0
for y in yasai[amari:]:
if i % m > 0:
s += y
i+=1
print(s) | Traceback (most recent call last):
File "/tmp/tmp77nhjp7z/tmpgg344741.py", line 2, in <module>
n,m = map(int,raw_input().split())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s619657621 | p00227 | u766477342 | 1414675094 | Python | Python3 | py | Runtime Error | 0 | 0 | 335 | while True:
n,m = map(int,raw_input().split())
if n == 0 and m == 0:
break
amari = n % m
yasai = map(int,raw_input().split())
yasai.sort()
s = 0
if amari > 0:
s = sum(yasai[0:amari])
i = 0
for y in yasai[amari:]:
if i % m > 0:
s += y
i+=1
print(s) | Traceback (most recent call last):
File "/tmp/tmpj0qbcuso/tmpupcu22t7.py", line 2, in <module>
n,m = map(int,raw_input().split())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s385523379 | p00227 | u766477342 | 1414675158 | Python | Python3 | py | Runtime Error | 0 | 0 | 54 | while True:
n,m = map(int,raw_input().split())
| Traceback (most recent call last):
File "/tmp/tmp9hzzmizc/tmp8s_qyig0.py", line 2, in <module>
n,m = map(int,raw_input().split())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s194227838 | p00227 | u766477342 | 1414675183 | Python | Python | py | Runtime Error | 0 | 0 | 53 | while True:
n,m = map(int,raw_input().split(' ')) | Traceback (most recent call last):
File "/tmp/tmptfaep7pb/tmp343s6ehq.py", line 2, in <module>
n,m = map(int,raw_input().split(' '))
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s005069079 | p00227 | u766477342 | 1414675337 | Python | Python | py | Runtime Error | 0 | 0 | 45 | while True:
a = raw_input()
print 'a' | File "/tmp/tmp_lpr4w41/tmpm2g1rn6f.py", line 3
print 'a'
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s103292306 | p00227 | u766477342 | 1414675394 | Python | Python3 | py | Runtime Error | 0 | 0 | 42 | while True:
a = input()
print('a') | Traceback (most recent call last):
File "/tmp/tmpinlt5d5j/tmppe1wjbay.py", line 2, in <module>
a = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s177266676 | p00227 | u766477342 | 1414675449 | Python | Python | py | Runtime Error | 0 | 0 | 43 |
while True:
a = input()
print('a') | Traceback (most recent call last):
File "/tmp/tmp3p7tflq5/tmptk7vrm3o.py", line 3, in <module>
a = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s204162965 | p00227 | u104911888 | 1368319849 | Python | Python | py | Runtime Error | 0 | 0 | 177 | while True:
n,m=map(int,raw_input().split())
if n==m==0:break
L=sorted(map(int,raw_input().split()),reverse=True)
print sum(L[i] for i in range(n) if (i+1)%m<>0) | File "/tmp/tmpwvenjo6s/tmp0w8ele4w.py", line 5
print sum(L[i] for i in range(n) if (i+1)%m<>0)
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s389234039 | p00227 | u104911888 | 1368319949 | Python | Python | py | Runtime Error | 0 | 0 | 226 | while True:
try:
n,m=map(int,raw_input().split())
except ValueError:
pass
if n==m==0:break
L=sorted(map(int,raw_input().split()),reverse=True)
print sum(L[i] for i in range(n) if (i+1)%m<>0) | File "/tmp/tmp3_efyfxi/tmpg0a9ix6e.py", line 8
print sum(L[i] for i in range(n) if (i+1)%m<>0)
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s764113418 | p00227 | u104911888 | 1368320041 | Python | Python | py | Runtime Error | 0 | 0 | 193 | while True:
A=map(int,raw_input().split())
n,m=A[0],A[1]
if n==m==0:break
L=sorted(map(int,raw_input().split()),reverse=True)
print sum(L[i] for i in range(n) if (i+1)%m<>0) | File "/tmp/tmpqqevjj39/tmpfxjscjx7.py", line 6
print sum(L[i] for i in range(n) if (i+1)%m<>0)
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s455721485 | p00227 | u104911888 | 1368320194 | Python | Python | py | Runtime Error | 0 | 0 | 164 | while True:
n,m=input(),input()
if n==m==0:break
L=sorted(map(int,raw_input().split()),reverse=True)
print sum(L[i] for i in range(n) if (i+1)%m<>0) | File "/tmp/tmpysd0ue5k/tmpy3vyb4p3.py", line 5
print sum(L[i] for i in range(n) if (i+1)%m<>0)
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s991901228 | p00227 | u260980560 | 1384356845 | Python | Python | py | Runtime Error | 0 | 0 | 205 | while 1:
n,m = map(int, raw_input().split())
if n==m==0: break
s = 0
p = map(int, raw_input().split())
p.sort(reverse=True)
s = sum([p[i] for i in range(n) if i%m!=m-1])
print s | File "/tmp/tmpyqf33nq5/tmpwxyyp9f2.py", line 8
print s
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s398909532 | p00227 | u260980560 | 1384357169 | Python | Python | py | Runtime Error | 0 | 0 | 221 | while 1:
n,m = map(int, raw_input().split())
if n==m==0: break
p = map(int, raw_input().split())
p.sort(reverse=True)
s = 0
for i in range(n):
if i%m!=m-1:
s += p[i]
print s | File "/tmp/tmp6xin4r0t/tmpq36mr7jy.py", line 10
print s
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s123756566 | p00227 | u260980560 | 1384357259 | Python | Python | py | Runtime Error | 0 | 0 | 234 | while 1:
n,m = map(int, raw_input().split())
if n==m==0: break
p = map(int, raw_input().split())
p.sort(reverse=True)
s = 0
for i in range(n):
if i%m!=m-1:
s += p[i]
del p[:]
print s | File "/tmp/tmp4bqaa8v7/tmpxxuxe_b8.py", line 11
print s
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s147867888 | p00227 | u647766105 | 1388619306 | Python | Python | py | Runtime Error | 0 | 0 | 169 | while True:
n, m = map(int, raw_input().split())
if n|m == 0:
break
p = sorted(map(int, raw_input().split()))[::-1]
print sum(p) - sum(p[m-1::m]) | File "/tmp/tmpy8cyj0pt/tmpxjqkymoi.py", line 6
print sum(p) - sum(p[m-1::m])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s942655342 | p00227 | u647766105 | 1388619398 | Python | Python | py | Runtime Error | 0 | 0 | 186 | while True:
n, m = map(int, raw_input().split())
if n|m == 0:
break
p = sorted(map(int, raw_input().split()))[::-1]
print sum(p) - sum(p[m-1::m]) if n >= m else 0 | File "/tmp/tmpmtcbxztz/tmpronuu3y4.py", line 6
print sum(p) - sum(p[m-1::m]) if n >= m else 0
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s653479535 | p00227 | u647766105 | 1388619510 | Python | Python | py | Runtime Error | 0 | 0 | 186 | while True:
n, m = map(int, raw_input().split())
if n == 0:
break
p = sorted(map(int, raw_input().split()))[::-1]
print sum(p) - (sum(p[m-1::m]) if n >= m else 0) | File "/tmp/tmpec2bh3zb/tmpfartx1q3.py", line 6
print sum(p) - (sum(p[m-1::m]) if n >= m else 0)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s130028557 | p00227 | u350508326 | 1392480128 | Python | Python | py | Runtime Error | 0 | 0 | 330 | while True:
n = map(int, raw_input().split())
if n[0] == 0 and n[1] == 0:
break
# print(n)
data = sorted(map(int, raw_input().split()), reverse = True)
# print(data)
sum = 0
for i in xrange(n[0]):
if (i + 1) % n[1] != 0:
sum += data[i]
# print(i)
print(sum) | Traceback (most recent call last):
File "/tmp/tmpfh9ztc3l/tmpdujedxmj.py", line 2, in <module>
n = map(int, raw_input().split())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s975531439 | p00227 | u350508326 | 1392480247 | Python | Python | py | Runtime Error | 0 | 0 | 275 | while True:
n = map(int, raw_input().split())
if n[0] == 0 and n[1] == 0:
break
data = sorted(map(int, raw_input().split()), reverse = True)
sum = 0
for i in xrange(n[0]):
if (i + 1) % n[1] != 0:
sum += data[i]
print(sum) | Traceback (most recent call last):
File "/tmp/tmpddzo2zh2/tmpn048knqr.py", line 2, in <module>
n = map(int, raw_input().split())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s749110384 | p00227 | u350508326 | 1392480402 | Python | Python | py | Runtime Error | 0 | 0 | 329 | while True:
n = map(int, raw_input().split())
if n[0] == 0 and n[1] == 0:
break
# print(n)
data = sorted(map(int, raw_input().split()), reverse = True)
# print(data)
sum = 0
for i in range(n[0]):
if (i + 1) % n[1] != 0:
sum += data[i]
# print(i)
print(sum) | Traceback (most recent call last):
File "/tmp/tmpul9m8x8p/tmpxo15kxwe.py", line 2, in <module>
n = map(int, raw_input().split())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s758750575 | p00227 | u350508326 | 1392480996 | Python | Python | py | Runtime Error | 0 | 0 | 459 | def main():
while True:
n = map(int, raw_input().split())
if n[0] == 0 and n[1] == 0:
break
# print(n)
data = sorted(map(int, raw_input().split()), reverse = True)
# print(data)
sum = 0
for i in range(len(data)):
if (i + 1 ) % n[1] != 0:
sum += data[i]
# print(i)
print(sum)
if __name__ == '__main__':
main() | Traceback (most recent call last):
File "/tmp/tmpdwbrwymr/tmpi_1o3av4.py", line 20, in <module>
main()
File "/tmp/tmpdwbrwymr/tmpi_1o3av4.py", line 4, in main
n = map(int, raw_input().split())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s678720799 | p00227 | u633068244 | 1396279625 | Python | Python | py | Runtime Error | 0 | 0 | 321 | def signal(a,e):
s=""
for i in range(7):
s+="0" if a[i]==e[i] else "1"
return s
ref=["0111111","0000110","1011011","1001111","1100110","1101101","1111101","0100111","1111111","1101111"]
while 1:
n=int(raw_input())
if n==-1:break
e="0000000"
for i in range(n):
a=ref[int(raw_input())]
print signal(a,e)
e=a | File "/tmp/tmp9uh21ynq/tmpj762egj_.py", line 14
print signal(a,e)
^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s303140216 | p00227 | u633068244 | 1396284009 | Python | Python | py | Runtime Error | 0 | 0 | 161 | while 1:
n,m=map(int, raw_input().split())
if n==0:break
c=sorted(map(int,raw_input().split()))[::-1]
c[m-1::m] = [0 for i in range(m-1,n,m)]
print sum(c)
| File "/tmp/tmpnmxsq2_w/tmp8tfa_faw.py", line 6
print sum(c)
^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s265989563 | p00227 | u633068244 | 1396284109 | Python | Python | py | Runtime Error | 0 | 0 | 196 | while 1:
n,m=map(int, raw_input().split())
if n==0:break
c=sorted(map(int,raw_input().split()))[::-1]
if m > n:
print sum(c)
else:
c[m-1::m] = [0 for i in range(m-1,n,m)]
print sum(c)
| File "/tmp/tmp01fhs887/tmp84j41k9n.py", line 6
print sum(c)
^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s086260804 | p00227 | u633068244 | 1396284160 | Python | Python | py | Runtime Error | 0 | 0 | 202 | while 1:
n,m=map(int, raw_input().split())
if n==0:break
# c=sorted(map(int,raw_input().split()))[::-1]
# if m > n:
# print sum(c)
# else:
# c[m-1::m] = [0 for i in range(m-1,n,m)]
# print sum(c)
| Traceback (most recent call last):
File "/tmp/tmpoq9ws4yl/tmp8elpad27.py", line 2, in <module>
n,m=map(int, raw_input().split())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s324898080 | p00227 | u633068244 | 1396284175 | Python | Python | py | Runtime Error | 0 | 0 | 205 | while True:
n,m=map(int, raw_input().split())
if n==0:break
# c=sorted(map(int,raw_input().split()))[::-1]
# if m > n:
# print sum(c)
# else:
# c[m-1::m] = [0 for i in range(m-1,n,m)]
# print sum(c)
| Traceback (most recent call last):
File "/tmp/tmphm3ojw0v/tmpbzft3go5.py", line 2, in <module>
n,m=map(int, raw_input().split())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s885584542 | p00227 | u633068244 | 1396284208 | Python | Python | py | Runtime Error | 0 | 0 | 204 | while True:
n,m=map(int, raw_input().split())
if n==0:break
c=sorted(map(int,raw_input().split()))[::-1]
# if m > n:
# print sum(c)
# else:
# c[m-1::m] = [0 for i in range(m-1,n,m)]
# print sum(c)
| Traceback (most recent call last):
File "/tmp/tmpb0q6lfp_/tmp1ld0x52a.py", line 2, in <module>
n,m=map(int, raw_input().split())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s543493715 | p00227 | u633068244 | 1396284314 | Python | Python | py | Runtime Error | 0 | 0 | 228 | while 1:
n=map(int, raw_input().split())
if n[0]==0:break
# c=sorted(map(int,raw_input().split()))[::-1]
# if m > n:
# print sum(c)
# else:
# c[m-1::m] = [0 for i in range(m-1,n,m)]
# print sum(c) | Traceback (most recent call last):
File "/tmp/tmpsk54cxc_/tmp8il76bsc.py", line 2, in <module>
n=map(int, raw_input().split())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s333649595 | p00227 | u633068244 | 1396719686 | Python | Python | py | Runtime Error | 0 | 0 | 152 | while 1:
n,m=map(int,raw_input().split())
if n==0:break
v=sorted(map(int,raw_input().split()))[::-1]
for i in range(m-1,n,m):
v[i]=0
print sum(v) | File "/tmp/tmpivuq__1p/tmpxs0xzray.py", line 7
print sum(v)
^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s885249519 | p00227 | u759949288 | 1398140430 | Python | Python | py | Runtime Error | 0 | 0 | 210 | while True:
n, m = (int(x) for x in raw_input().split(" "))
if n == 0 and m == 0: break
p = [int(x) for x in raw_input().split(" ")]
s = sum(p)
p.sort(reverse=True)
for x in p[m - 1::m]:
s -= x
print s | File "/tmp/tmp60d1ez1j/tmp7f7tly9u.py", line 9
print s
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s958954438 | p00227 | u759949288 | 1398140461 | Python | Python | py | Runtime Error | 0 | 0 | 204 | while True:
n, m = (int(x) for x in raw_input().split())
if n == 0 and m == 0: break
p = [int(x) for x in raw_input().split()]
s = sum(p)
p.sort(reverse=True)
for x in p[m - 1::m]:
s -= x
print s | File "/tmp/tmp2s_dykwd/tmpk1iiyft2.py", line 9
print s
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s007878210 | p00227 | u759949288 | 1398140597 | Python | Python | py | Runtime Error | 0 | 0 | 220 | while True:
n, m = (int(x.strip()) for x in raw_input().split())
if n == 0 and m == 0: break
p = [int(x.strip()) for x in raw_input().split()]
s = sum(p)
p.sort(reverse=True)
for x in p[m - 1::m]:
s -= x
print s | File "/tmp/tmpashgxhbb/tmp6j1m4dcw.py", line 9
print s
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s820969147 | p00227 | u772196646 | 1400298832 | Python | Python | py | Runtime Error | 0 | 0 | 269 | while 1:
nm = map(int, raw_input().split())
if nm == [0, 0]:
break
n = nm[0]
m = nm[1]
p = map(int, raw_input().split())
p_sorted = sorted(p)
sum = 0
for i in range(n):
if (i+1) % m != 0:
sum += p_sorted[-1-i]
print sum | File "/tmp/tmp88fc7376/tmp0afktohj.py", line 4
break
TabError: inconsistent use of tabs and spaces in indentation
| |
s379066907 | p00227 | u772196646 | 1400299998 | Python | Python | py | Runtime Error | 0 | 0 | 283 | while 1:
nm = map(int, raw_input().split())
if nm == [0, 0]:
break
n = nm[0]
m = nm[1]
p = map(int, raw_input().split())
p_sorted = sorted(p)
sum = 0
for i in range(n):
if (i+1) % m != 0:
sum += p_sorted[-1-i]
print sum | File "/tmp/tmplcnyg8_o/tmpt72fgc_u.py", line 13
print sum
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s352384406 | p00228 | u104911888 | 1367759647 | Python | Python | py | Runtime Error | 0 | 0 | 309 | L=[
"0111111",
"0000110",
"1011011",
"1001111",
"1100110",
"1101101",
"1111101",
"0100111",
"1111111",
"1111110"]
while True:
n=input()
if n==-1:break
t="0000000"
for i in range(n):
a=input()
print "".join("1" if L[a][i]<>t[i] else "0" for i in range(len(L[a])))
t=L[a] | File "/tmp/tmp111m6k7p/tmpt5_bqnby.py", line 18
print "".join("1" if L[a][i]<>t[i] else "0" for i in range(len(L[a])))
^^^^^^^^^^^^^^
SyntaxError: expected 'else' after 'if' expression
| |
s684161431 | p00228 | u104911888 | 1367759839 | Python | Python | py | Runtime Error | 0 | 0 | 297 | L=[
"0111111",
"0000110",
"1011011",
"1001111",
"1100110",
"1101101",
"1111101",
"0100111",
"1111111",
"1111110"]
while True:
n=input()
if n==-1:break
t="0000000"
for i in range(n):
a=input()
print "".join("1" if i<>j else "0" for i,j in zip(L[a],t))
t=L[a] | File "/tmp/tmpux6x470a/tmppvy7y3xr.py", line 18
print "".join("1" if i<>j else "0" for i,j in zip(L[a],t))
^^^^^^^^
SyntaxError: expected 'else' after 'if' expression
| |
s995084822 | p00228 | u104911888 | 1367760691 | Python | Python | py | Runtime Error | 0 | 0 | 395 | L=[
"0111111",
"0000110",
"1011011",
"1001111",
"1100110",
"1101101",
"1111101",
"0100111",
"1111111",
"1111110"]
while True:
n=input()
if n==-1:break
t="0000000"
for i in range(n):
a=input()
# print "".join("1" if i<>j else "0" for i,j in zip(L[a],t))
f=""
for j,k in zip(L[a],t):
f+="1" if j<>k else "0"
print f
t=L[a] | File "/tmp/tmpyv188f40/tmpic0v44m3.py", line 21
f+="1" if j<>k else "0"
^^^^^^^^
SyntaxError: expected 'else' after 'if' expression
| |
s863228657 | p00228 | u104911888 | 1367760868 | Python | Python | py | Runtime Error | 0 | 0 | 289 | L=["0111111","0000110","1011011","1001111","1100110","1101101","1111101","0100111","1111111","1111110"]
while True:
n=input()
if n==-1:break
t="0000000"
for i in range(n):
a=input()
print "".join(["1" if i<>j else "0" for i,j in zip(L[a],t)])
t=L[a] | File "/tmp/tmp8dq3hrv7/tmpaq6y1n2s.py", line 8
print "".join(["1" if i<>j else "0" for i,j in zip(L[a],t)])
^^^^^^^^
SyntaxError: expected 'else' after 'if' expression
| |
s850300572 | p00228 | u104911888 | 1367761028 | Python | Python | py | Runtime Error | 0 | 0 | 330 | D={0: '0111111', 1: '0000110', 2: '1011011', 3: '1001111', 4: '1100110', 5: '1101101', 6: '1111101', 7: '0100111', 8: '1111111\
', 9: '1111110'}
while True:
n=input()
if n==-1:break
t="0000000"
for i in range(n):
a=input()
print "".join(["1" if i<>j else "0" for i,j in zip(D[a],t)])
t=D[a] | File "/tmp/tmpfktym4x1/tmp8mpnc3ih.py", line 9
print "".join(["1" if i<>j else "0" for i,j in zip(D[a],t)])
^^^^^^^^
SyntaxError: expected 'else' after 'if' expression
| |
s345629500 | p00228 | u260980560 | 1384360097 | Python | Python | py | Runtime Error | 0 | 0 | 430 | dig = ["0111111","0000110","1011011","1001111","1100110","1101101","1111101","0100111","1111111","1101111"]
dc = [ ["".join(str(int(dig[i][k])^int(dig[j][k])) for k in range(7)) for j in range(10)] for i in range(10)]
while 1:
n = input()
if n==-1: break
buf = -1
for i in range(n):
num = input()
if buf==-1:
print dig[num]
else:
print dc[buf][num]
buf = num | File "/tmp/tmpo7f4nmcb/tmp4t1_fr3x.py", line 10
print dig[num]
^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s276288875 | p00228 | u633068244 | 1396279356 | Python | Python | py | Runtime Error | 0 | 0 | 315 | def signal(a,e):
s=""
for i in range(7):
s+="0" if a[i]==e[i] else "1"
return s
ref=["0111111","0000110","1011011","1001111","1100110","1101101","1111101","0100111","1111111","1101111"]
while 1:
n=input()
if n==-1:break
e="0000000"
for i in range(n):
a=ref[int(raw_input())]
print signal(a,e)
e=a | File "/tmp/tmp4joq2e15/tmpno1vzc_b.py", line 15
print signal(a,e)
^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s640766719 | p00228 | u633068244 | 1396279409 | Python | Python | py | Runtime Error | 0 | 0 | 315 | def signal(a,e):
s=""
for i in range(7):
s+="0" if a[i]==e[i] else "1"
return s
ref=["0111111","0000110","1011011","1001111","1100110","1101101","1111101","0100111","1111111","1101111"]
while 1:
n=input()
if n==-1:break
e="0000000"
for i in range(n):
a=ref[int(raw_input())]
print signal(a,e)
e=a | File "/tmp/tmpjc3b9pri/tmpcrkkjmkn.py", line 15
print signal(a,e)
^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s844740018 | p00228 | u633068244 | 1396279638 | Python | Python | py | Runtime Error | 0 | 0 | 321 | def signal(a,e):
s=""
for i in range(7):
s+="0" if a[i]==e[i] else "1"
return s
ref=["0111111","0000110","1011011","1001111","1100110","1101101","1111101","0100111","1111111","1101111"]
while 1:
n=int(raw_input())
if n==-1:break
e="0000000"
for i in range(n):
a=ref[int(raw_input())]
print signal(a,e)
e=a | File "/tmp/tmpmpj3orym/tmp2xqcs0pz.py", line 14
print signal(a,e)
^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s353463796 | p00228 | u633068244 | 1396280491 | Python | Python | py | Runtime Error | 0 | 0 | 161 | ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
n=input()
if n==-1:break
e=0
for i in range(n):
a=ref[int(raw_input())]
print "{:07b}".format(a^e)
e=a | File "/tmp/tmp_uqc6hxn/tmpimmsxjlj.py", line 8
print "{:07b}".format(a^e)
^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s200628801 | p00228 | u633068244 | 1396280792 | Python | Python | py | Runtime Error | 0 | 0 | 165 | ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
n=input()
if n==-1:break
e=0
#for i in range(n):
# a=ref[int(raw_input())]
# print "{:07b}".format(a^e)
# e=a | Traceback (most recent call last):
File "/tmp/tmpel502sxt/tmpnbptl1ni.py", line 3, in <module>
n=input()
^^^^^^^
EOFError: EOF when reading a line
| |
s713732193 | p00228 | u633068244 | 1396280838 | Python | Python | py | Runtime Error | 0 | 0 | 174 | ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
n=int(raw_input())
if n==-1:break
e=0
#for i in range(n):
# a=ref[int(raw_input())]
# print "{:07b}".format(a^e)
# e=a | Traceback (most recent call last):
File "/tmp/tmpl04kpqph/tmpqxy1wr0f.py", line 3, in <module>
n=int(raw_input())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s990154099 | p00228 | u633068244 | 1396280917 | Python | Python | py | Runtime Error | 0 | 0 | 174 | ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
n=int(raw_input())
if n==10:break
e=0
#for i in range(n):
# a=ref[int(raw_input())]
# print "{:07b}".format(a^e)
# e=a | Traceback (most recent call last):
File "/tmp/tmp7swevdlu/tmpfrtm87v8.py", line 3, in <module>
n=int(raw_input())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s600838689 | p00228 | u633068244 | 1396280937 | Python | Python | py | Runtime Error | 0 | 0 | 172 | ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
n=int(raw_input())
if n<0:break
e=0
#for i in range(n):
# a=ref[int(raw_input())]
# print "{:07b}".format(a^e)
# e=a | Traceback (most recent call last):
File "/tmp/tmp9ip72x3q/tmp704cynsy.py", line 3, in <module>
n=int(raw_input())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s982625473 | p00228 | u633068244 | 1396281042 | Python | Python | py | Runtime Error | 0 | 0 | 174 | ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
n=int(raw_input())
if n==-1:break
e=0
#for i in range(n):
# a=ref[int(raw_input())]
# print "{:07b}".format(a^e)
# e=a | Traceback (most recent call last):
File "/tmp/tmp_az7odmw/tmpud8b9fu1.py", line 3, in <module>
n=int(raw_input())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s800629757 | p00228 | u633068244 | 1396281074 | Python | Python | py | Runtime Error | 0 | 0 | 175 | ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
n=int(raw_input())
if n+1==0:break
e=0
#for i in range(n):
# a=ref[int(raw_input())]
# print "{:07b}".format(a^e)
# e=a | Traceback (most recent call last):
File "/tmp/tmp9t0bm9x8/tmpziyhycnj.py", line 3, in <module>
n=int(raw_input())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s321486791 | p00228 | u633068244 | 1396281157 | Python | Python | py | Runtime Error | 0 | 0 | 169 | ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
n=int(raw_input())
if n==0:break
e=0
for i in range(n):
a=ref[int(raw_input())]
print "{:07b}".format(a^e)
e=a | File "/tmp/tmpc3z_6a7u/tmp9zc1lddl.py", line 8
print "{:07b}".format(a^e)
^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s077928784 | p00228 | u633068244 | 1396281172 | Python | Python | py | Runtime Error | 0 | 0 | 169 | ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
n=int(raw_input())
if n<=0:break
e=0
for i in range(n):
a=ref[int(raw_input())]
print "{:07b}".format(a^e)
e=a | File "/tmp/tmpqd_f2l8q/tmppajiy1uo.py", line 8
print "{:07b}".format(a^e)
^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s580933026 | p00228 | u633068244 | 1396281389 | Python | Python | py | Runtime Error | 0 | 0 | 43 | loop do
n =gets.to_i
break if n==-1
end | File "/tmp/tmpven5r0z3/tmpqbh6n1y2.py", line 1
loop do
^^
SyntaxError: invalid syntax
| |
s763557903 | p00228 | u633068244 | 1396281446 | Python | Python | py | Runtime Error | 0 | 0 | 175 | ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
n=int(raw_input())
if n==-1:
break
e=0
for i in range(n):
a=ref[int(raw_input())]
print ("{:07b}".format(a^e))
e=a | Traceback (most recent call last):
File "/tmp/tmpnawezj3a/tmpfyj4xee7.py", line 3, in <module>
n=int(raw_input())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s675588476 | p00228 | u633068244 | 1396283097 | Python | Python | py | Runtime Error | 0 | 0 | 170 | ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
n=int(raw_input())
if n==-1:break
e=0
for i in range(n):
a=ref[int(raw_input())]
print "{:07b}".format(a^e)
e=a | File "/tmp/tmplf0phi_m/tmp4o9tracg.py", line 8
print "{:07b}".format(a^e)
^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s212889432 | p00228 | u633068244 | 1396443490 | Python | Python | py | Runtime Error | 0 | 0 | 170 | ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
n=int(raw_input())
if n==-1:break
e=0
for i in range(n):
a=ref[int(raw_input())]
print "{:07b}".format(a^e)
e=a | File "/tmp/tmpvypoqois/tmpin3f77km.py", line 8
print "{:07b}".format(a^e)
^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.