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
s285623623
p00114
u462831976
1494417081
Python
Python3
py
Runtime Error
0
0
672
# -*- coding: utf-8 -*- import sys import os import math def lcm(a, b): return (a * b) // math.gcd(a, b) for s in sys.stdin: a1, m1, a2, m2, a3, m3 = map(int, s.split()) if a1 == m1 == a2 == m2 == a3 == m3 == 0: break x = 1 y = 1 z = 1 x_num = 0 while True: x = (a1 * x) % m1 x_num += 1 if x == 1: break y_num = 0 while True: y = (a2 * y) % m2 y_num += 1 if y == 1: break z_num = 0 while True: z = (a3 * z) % m3 z_num += 1 if z == 1: break a = lcm(x_num, y_num) b = lcm(a, z_num) print(b)
s327677388
p00114
u462831976
1494417514
Python
Python3
py
Runtime Error
0
0
529
# -*- coding: utf-8 -*- import sys import os import math def lcm(a, b): return (a * b) // math.gcd(a, b) def interval(a, m): cnt = 0 x = 1 while True: x = (a * x) % m cnt += 1 if x == 1: return cnt for s in sys.stdin: a1, m1, a2, m2, a3, m3 = map(int, s.split()) if sum([a1, m1, a2, m2, a3, m3]) == 0: break x_num = interval(a1, m1) y_num = interval(a2, m2) z_num = interval(a3, m3) a = lcm(x_num, y_num) b = lcm(a, z_num) print(b)
s209755795
p00114
u960312159
1509522495
Python
Python3
py
Runtime Error
0
0
458
from math import gcd while True: a = list(map(int, input().split())) if a.count(0) == 6: break x = a[0] % a[1] ix = 1 while x != 1: x = a[0] * x % a[1] ix += 1 y = a[2] % a[3] iy = 1 while y != 1: y = a[2] * y % a[3] iy += 1 z = a[4] % a[5] iz = 1 while z != 1: z = a[4] * z % a[5] iz += 1 ixy = ix * iy // gcd(ix, iy) print(ixy * iz // gcd(ixy, iz))
Traceback (most recent call last): File "/tmp/tmpnvs7w61s/tmpfdi33d4u.py", line 3, in <module> a = list(map(int, input().split())) ^^^^^^^ EOFError: EOF when reading a line
s358269672
p00115
u260980560
1437215843
Python
Python
py
Runtime Error
20
4356
927
def solve(A, b): for i in xrange(3): if A[i][i] == 0.0: for j in xrange(i+1, 3): if A[j][i]!=0.0: A[i], A[j] = A[j], A[i] b[i], b[j] = b[j], b[i] for j in xrange(3): if i==j: continue a = A[j][i] / A[i][i] for k in xrange(3): A[j][k] -= a * A[i][k] b[j] -= a * b[i] for i in xrange(3): b[i] /= A[i][i] A[i][i] /= A[i][i] u = map(float, raw_input().split()) e = map(float, raw_input().split()) o = map(float, raw_input().split()) p = map(float, raw_input().split()) q = map(float, raw_input().split()) A = [[p[i]-o[i], q[i]-o[i], e[i]-u[i]] for i in xrange(3)] b = [e[i] - o[i] for i in xrange(3)] solve(A, b) s, t, x = b j = lambda x: -0.0000001 < x < 1.0000001 if j(s) and j(t) and j(s+t) and j(x): print "MISS" else: print "HIT"
File "/tmp/tmpy4uq6ry6/tmpnsvrllh4.py", line 30 print "MISS" ^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s406740749
p00115
u619785977
1471417408
Python
Python3
py
Runtime Error
0
0
72
hdhafsdlqshflahsfhjs afjahflka fhajkfaslkdfa fjajkfhajkh djhfjaseafaf xz
Traceback (most recent call last): File "/tmp/tmpqjiiihsw/tmpvptvcdru.py", line 1, in <module> hdhafsdlqshflahsfhjs NameError: name 'hdhafsdlqshflahsfhjs' is not defined
s246910115
p00115
u462831976
1494522912
Python
Python3
py
Runtime Error
0
0
818
# -*- coding: utf-8 -*- import sys import os import math import numpy as np # refs # https://shikousakugo.wordpress.com/2012/06/27/ray-intersection-2/ def length(v): return math.sqrt(v[0] ** 2 + v[1] ** 2 + v[2] ** 2) def dist(p0, p1): return math.sqrt( (p0[0] - p1[0]) ** 2 + (p0[1] - p1[1]) ** 2 + (p0[2] - p1[2]) ** 2) # me p0 = np.array(list(map(int, input().split()))) # enemy p1 = np.array(list(map(int, input().split()))) # barrier A = np.array(list(map(int, input().split()))) B = np.array(list(map(int, input().split()))) C = np.array(list(map(int, input().split()))) a = p1 - p0 b = A - B c = A - C d = A - p0 M = np.array([a, b, c]).T tuv = np.linalg.solve(M, d) t = tuv[0] u = tuv[1] v = tuv[2] if 0 <= u <= 1 and 0 <= v <= 1 and 0 <= u + v <= 1: print('MISS') else: print('HIT')
Traceback (most recent call last): File "/tmp/tmprs4y5j5q/tmpm4bnewwq.py", line 18, in <module> p0 = np.array(list(map(int, input().split()))) ^^^^^^^ EOFError: EOF when reading a line
s172363378
p00115
u462831976
1494525513
Python
Python3
py
Runtime Error
20
7856
1045
# -*- coding: utf-8 -*- import sys import os import math # refs # https://shikousakugo.wordpress.com/2012/06/27/ray-intersection-2/ def det(a, b, c): return + a[0] * b[1] * c[2] \ + a[2] * b[0] * c[1] \ + a[1] * b[2] * c[0] \ - a[2] * b[1] * c[0] \ - a[1] * b[0] * c[2] \ - a[0] * b[2] * c[1] def sub(v0, v1): # v0 - v1 return (v0[0] - v1[0], v0[1] - v1[1], v0[2] - v1[2]) # me p0 = list(map(int, input().split())) # enemy p1 = list(map(int, input().split())) # barrier A = list(map(int, input().split())) B = list(map(int, input().split())) C = list(map(int, input().split())) a = sub(p1, p0) b = sub(A, B) c = sub(A, C) d = sub(A, p0) denom = det(a, b, c) if denom > -0.0000001: t = det(d, b, c) / denom u = det(a, d, c) / denom v = det(a, b, d) / denom lower = -0.0000001 upper = 1.0000001 if lower <= u <= upper and lower <= v <= upper and lower <= u + v <= upper: print('MISS') else: print('HIT') else: print('HIT')
Traceback (most recent call last): File "/tmp/tmpm4w8i_bw/tmp8rt_yhvq.py", line 23, in <module> p0 = list(map(int, input().split())) ^^^^^^^ EOFError: EOF when reading a line
s195147798
p00115
u462831976
1494525664
Python
Python3
py
Runtime Error
20
7848
1033
# -*- coding: utf-8 -*- import sys import os import math # refs # https://shikousakugo.wordpress.com/2012/06/27/ray-intersection-2/ def det(a, b, c): return + a[0] * b[1] * c[2] \ + a[2] * b[0] * c[1] \ + a[1] * b[2] * c[0] \ - a[2] * b[1] * c[0] \ - a[1] * b[0] * c[2] \ - a[0] * b[2] * c[1] def sub(v0, v1): # v0 - v1 return (v0[0] - v1[0], v0[1] - v1[1], v0[2] - v1[2]) # me p0 = list(map(int, input().split())) # enemy p1 = list(map(int, input().split())) # barrier A = list(map(int, input().split())) B = list(map(int, input().split())) C = list(map(int, input().split())) a = sub(p1, p0) b = sub(A, B) c = sub(A, C) d = sub(A, p0) denom = det(a, b, c) lower = -0.0000001 upper = 1.0000001 if denom > lower: t = det(d, b, c) / denom u = det(a, d, c) / denom v = det(a, b, d) / denom if lower <= u <= upper and lower <= v <= upper and lower <= u + v <= upper: print('MISS') else: print('HIT') else: print('HIT')
Traceback (most recent call last): File "/tmp/tmp32ts5ssm/tmpek_8qnln.py", line 23, in <module> p0 = list(map(int, input().split())) ^^^^^^^ EOFError: EOF when reading a line
s822302832
p00115
u462831976
1494530936
Python
Python3
py
Runtime Error
20
7872
1224
# -*- coding: utf-8 -*- import sys import os import math # refs # https://shikousakugo.wordpress.com/2012/06/27/ray-intersection-2/ def det(a, b, c): return + a[0] * b[1] * c[2] \ + a[2] * b[0] * c[1] \ + a[1] * b[2] * c[0] \ - a[2] * b[1] * c[0] \ - a[1] * b[0] * c[2] \ - a[0] * b[2] * c[1] def sub(v0, v1): # v0 - v1 return (v0[0] - v1[0], v0[1] - v1[1], v0[2] - v1[2]) # me p0 = list(map(int, input().split())) # enemy p1 = list(map(int, input().split())) # barrier A = list(map(int, input().split())) B = list(map(int, input().split())) C = list(map(int, input().split())) a = sub(p1, p0) b = sub(A, B) c = sub(A, C) d = sub(A, p0) EPS = 0.0000001 lower = -EPS upper = 1 + EPS denom = det(a, b, c) if denom > lower: t = det(d, b, c) / denom u = det(a, d, c) / denom v = det(a, b, d) / denom # i am on barrier if -EPS < t < EPS: print('HIT') # barrier is not between ours elif t < 0: print('HIT') # hit barrier elif lower < t < upper and lower <= u <= upper and lower <= v <= upper and lower <= u + v <= upper: print('MISS') else: print('HIT') else: print('HIT')
Traceback (most recent call last): File "/tmp/tmpu39omgh3/tmp4fvov4em.py", line 23, in <module> p0 = list(map(int, input().split())) ^^^^^^^ EOFError: EOF when reading a line
s893059137
p00115
u566872786
1511090200
Python
Python3
py
Runtime Error
0
0
798
dot = lambda a,b:sum([a[i]*b[i] for i in range(3)]) cross = lambda a,b:[a[1]*b[2]-a[2]*b[1],a[2]*b[0]-a[0]*b[2],a[0]*b[1]-a[1]*b[0]] m = lambda a,b:[a[i]-b[i] for i in range(3)] l = lambda a:(a[0]**2+a[1]**2+a[2]**2)** 0.5 c = lambda a,b:[a*b[i] for i in range(3)] def A(): L=[list(map(int,input().split())) for i in range(5)] ab = m(L[1],L[0]) L2 = [m(L[3],L[2]),m(L[4],L[3]),m(L[2],L[4])] n = cross(L2[0],L2[1]) if dot(ab,n) == 0: return 'HIT' xa = m(L[0],L[2]) xb = m(L[1],L[2]) if dot(n,xa) * dot(n,xb) > 0: return 'HIT' da = abs(dot(n,xa))/l(n) db = abs(dot(n,xb))/l(n) a = da / (da + db) X = [c((1-a),xa)[i] + c(a,xb)[i] for i in range(3)] for i in range(1,4): if dot(n,cross(L2[i-1],m(X,L2[2+(i%3)]))) < 0: return 'MISS' return "HIT" print(A())
Traceback (most recent call last): File "/tmp/tmpf8kdt87q/tmpyk4ykuoo.py", line 26, in <module> print(A()) ^^^ File "/tmp/tmpf8kdt87q/tmpyk4ykuoo.py", line 8, in A L=[list(map(int,input().split())) for i in range(5)] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/tmpf8kdt87q/tmpyk4ykuoo.py", line 8, in <listcomp> L=[list(map(int,input().split())) for i in range(5)] ^^^^^^^ EOFError: EOF when reading a line
s944689187
p00115
u300645821
1401883826
Python
Python3
py
Runtime Error
70
14776
939
#!/usr/bin/python from fractions import Fraction import sys if sys.version_info[0]>=3: raw_input=input def gauss(a): if not a or len(a)==0: return None n=len(a) for i in range(n): if a[i][i]==0: for j in range(i+1,n): if a[j][i]!=0: for k in range(i,n+1): a[i][k]+=a[j][k] break for j in range(n): if i!=j: r = Fraction(a[j][i],a[i][i]) for k in range(i,n+1): a[j][k] = a[j][k] - a[i][k]*r for i in range(n): x=Fraction(a[i][i],1) for j in range(len(a[i])): a[i][j] /= x return a uaz=list(map(int,raw_input().split())) enemy=[0]+[-x+y for x,y in zip(map(int,raw_input().split()),uaz)] b0=[1]+[x-y for x,y in zip(map(int,raw_input().split()),uaz)] b1=[1]+[x-y for x,y in zip(map(int,raw_input().split()),uaz)] b2=[1]+[x-y for x,y in zip(map(int,raw_input().split()),uaz)] sol=gauss(list(map(list,zip(b0,b1,b2,enemy,[1,0,0,0])))) print('MISS' if sol and all(0<=e[-1]<=1 for e in sol) else 'HIT')
Traceback (most recent call last): File "/tmp/tmpbq6dhuso/tmpbn5fwaf2.py", line 25, in <module> uaz=list(map(int,raw_input().split())) ^^^^^^^^^^^ EOFError: EOF when reading a line
s972625382
p00116
u912237403
1414939377
Python
Python
py
Runtime Error
0
0
410
while 1: h,w = map(int, raw_input().split()) if h==w==0: break A = [] for i in range(h): A.append(map(int,list(raw_input().replace(".", "1").replace("*", "0")))) B = A[:] C = [] for j in range(1,h): m=[] for i in range(j,h): x=[e1&e2 for e1,e2 in zip(B[i-j],A[i])] B[i-j]=x m.append(max("".join(map(str,x)).split("0"))) C.append(len(max(m))*(j+1)) print max(C)
File "/tmp/tmpxlwvvgjh/tmp7bmizaf7.py", line 16 print max(C) ^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s499357334
p00116
u912237403
1414939661
Python
Python
py
Runtime Error
0
0
420
while 1: h,w = map(int, raw_input().split()) if h==w==0: break A = [] for i in range(h): A.append(map(int, list(raw_input().replace(".", "1").replace("*", "0")))) B = A[:] C = [] for j in range(1,h): m=[] for i in range(j,h): x = [e1 & e2 for e1, e2 in zip(B[i-j], A[i])] B[i-j] = x m.append(max("".join(map(str, x)).split("0"))) C.append(len(max(m))*(j+1)) print max(C)
File "/tmp/tmp3zgnll8p/tmp6_r1qt29.py", line 16 print max(C) ^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s649028099
p00116
u912237403
1414941454
Python
Python
py
Runtime Error
0
0
428
import sys while 1: h,w = map(int, raw_input().split()) if h==w==0: break A = [] for _ in [0]*h: A.append(map(int, list(raw_input().replace(".", "1").replace("*", "0")))) B = A[:] C = [] for j in range(1,h): m=[] for i in range(j,h): x = [e1 & e2 for e1, e2 in zip(B[i-j], A[i])] B[i-j] = x m.append(max("".join(map(str, x)).split("0"))) C.append(len(max(m))*(j+1)) print max(C)
File "/tmp/tmp_adfa_di/tmpe6wt8qkh.py", line 17 print max(C) ^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s744981245
p00116
u912237403
1414966687
Python
Python
py
Runtime Error
0
0
446
while 1: h,w = map(int, raw_input().split()) if h==w==0: break A = [0]*h for i in range(h): x = raw_input().replace(".", "1").replace("*", "0") A[i] = map(int, list(x)) B = A[:] C = [] for j in range(1,h): M = [] for i in range(j,h): x = [e1 & e2 for e1, e2 in zip(B[i-j], A[i])] B[i-j] = x M.append(sorted("".join(map(str, x)).split("0"))[-1]) C.append(len(sorted(M)[-1])*(j+1)) print max(C)
File "/tmp/tmpfs2wnv7y/tmpcot21kz0.py", line 17 print max(C) ^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s639828553
p00116
u912237403
1415008479
Python
Python
py
Runtime Error
0
0
592
def f(j,k): tmp=j-C[k] if tmp>M[k]: M[k] return while 1: h,w = map(int, raw_input().split()) if h==w==0: break M = [0]*(h+1) a=[0]*w for i in range(h): x = raw_input() b=[0]*w sp=-1 C = [-1]*(h+1) for j in range(w): if x[j]=="*": c=0 else: c=a[j]+1 b[j]=c dw=c-sp if dw>0: C[sp+1:c+1]=[j]*dw elif dw<0: for k in range(c+1,sp+1): f(j,k) C[c+1:sp+1]=[-1]*(-dw) sp=c for k in range(1,sp+1): if C[k]>=0: M[k]=max(M[k],w-C[k]) a=b s=max([M[i]*i for i in range(h+1) if M[i]>0]) print s
File "/tmp/tmp6at_a868/tmp8gvmp1jl.py", line 30 print s ^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s184242834
p00116
u912237403
1415008537
Python
Python
py
Runtime Error
0
0
596
def f(j,k): tmp=j-C[k] if tmp>M[k]: M[k]=tmp return while 1: h,w = map(int, raw_input().split()) if h==w==0: break M = [0]*(h+1) a=[0]*w for i in range(h): x = raw_input() b=[0]*w sp=-1 C = [-1]*(h+1) for j in range(w): if x[j]=="*": c=0 else: c=a[j]+1 b[j]=c dw=c-sp if dw>0: C[sp+1:c+1]=[j]*dw elif dw<0: for k in range(c+1,sp+1): f(j,k) C[c+1:sp+1]=[-1]*(-dw) sp=c for k in range(1,sp+1): if C[k]>=0: M[k]=max(M[k],w-C[k]) a=b s=max([M[i]*i for i in range(h+1) if M[i]>0]) print s
File "/tmp/tmp40rki282/tmpcndppvtr.py", line 30 print s ^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s365961694
p00116
u647766105
1381483573
Python
Python
py
Runtime Error
0
0
2559
class Rect(): def __init__(self, x_range, y_range): self.x_range = x_range self.y_range = y_range @property def w(self): return len(self.x_range) @property def h(self): return len(self.y_range) def __str__(self): return "Rect({},{})".format(str(self.x_range),str(self.y_range)) def __contains__(self, pos): x,y = pos left,right = self.x_range[0],self.x_range[-1] buttom,top = self.y_range[0],self.y_range[-1] return left<=x<=right and buttom<=y<=top def divide(self, pos): x,y = pos x_i = self.x_range.index(x) y_i = self.y_range.index(y) rects = [Rect(self.x_range[:x_i],self.y_range), Rect(self.x_range[x_i+1:],self.y_range), Rect(self.x_range,self.y_range[:y_i]), Rect(self.x_range,self.y_range[y_i+1:])] rem_list = [] #TEMP for r in rects: if r.x_range == [] or r.y_range == []: rem_list.append(r) for r in rem_list: rects.remove(r) return rects def ge(H,W): from collections import deque q = deque([(0,0)]) while q: x,y = q.popleft() yield (x,y) if y == 0 and x+1 < W: q.append([x+1,y]) if y+1 < H: q.append([x,y+1]) def solveA(field,H,W): space = [[0]*(W+1) for _ in xrange(H)] for x in xrange(W-1,-1,-1): for y in xrange(H): if field[y][x]==".": space[y][x] = space[y][x+1]+1 ans = 0 x,y = 0,0 for x,y in ((xx,yy) for xx,yy in ge(H,W) if field[yy][xx] == "."): mi = space[y][x] for h in xrange(y,H): if(field[h][x] == "*"): break mi = min(mi, space[h][x]) ans = max(ans, mi*(h-y+1)) if (W-x+1)*(H-y+1) < ans: return ans return ans def solveB(field,H,W): rects = [Rect(range(W),range(H))] for x in xrange(W): for y in (yy for yy in xrange(H) if field[yy][x] == "*"): for r in filter(lambda rr:(x,y) in rr, rects): rects.extend(r.divide((x,y))) rects.remove(r) return max(r.w*r.h for r in rects) while True: H,W = map(int, raw_input().split()) if (H,W) == (0,0): break field = [raw_input() for _ in xrange(H)] count = sum(f.count("*") for f in field) if count > 15: print solveA(field,H,W) else: print solveB(field,H,W)
File "/tmp/tmpvf9h3a9f/tmp79hugaml.py", line 87 print solveA(field,H,W) ^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s398839556
p00116
u104911888
1390903526
Python
Python
py
Runtime Error
0
0
794
def get_rectangle_area(table, w): maxv = 0 stack = [] table.append(0) for i, rect in enumerate(table): if stack == []: stack.append((rect, i)) elif stack[-1][0] < rect: stack.append((rect, i)) elif stack[-1][0] == rect: pass elif stack[-1][0] > rect: while stack != [] and stack[-1][0] >= rect: high, pos = stack.pop() maxv = max(maxv, high*(i-pos)) stack.append((rect, pos)) return maxv while True: h, w = map(int, raw_input().split()) if h == w == 0: break mass = [raw_input() for i in range(h)] table = histgram(mass, h, w) ans = 0 for tab in table: ans = max(ans, get_rectangle_area(tab, w)) print ans
File "/tmp/tmpt67n_i4g/tmpzj1vog4v.py", line 28 print ans ^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s844438818
p00116
u300645821
1392386118
Python
Python
py
Runtime Error
0
0
541
#!/usr/bin/python #http://www.checkio.org/mission/spaceship-landing-strip/ verifier. def checkio(data): y=len(data) x=len(data[0]) m=[[0]*x for i in range(y)] for j in range(y): r=0 for i in range(x): if data[j][i]=='.': r+=1 else: r=0 m[j][i]=r r=0 for i in range(x): for j in range(y): M=9999999 for k in range(j,y): M=min(M,m[k][i]) r=max(r,M*(k-j+1)) return r while True: x,y=[int(e) for e in raw_input().split()] if y==0: break data=[raw_input().rstrip() for i in range(y)] print(checkio(data))
Traceback (most recent call last): File "/tmp/tmpu1_xeno4/tmp7tqhah4h.py", line 24, in <module> x,y=[int(e) for e in raw_input().split()] ^^^^^^^^^ NameError: name 'raw_input' is not defined
s731962099
p00116
u300645821
1392386234
Python
Python
py
Runtime Error
0
0
607
#!/usr/bin/python #http://www.checkio.org/mission/spaceship-landing-strip/ verifier. def checkio(data): y=len(data) x=len(data[0]) m=[[0]*x for i in range(y)] for j in range(y): r=0 for i in range(x): if data[j][i]=='.': r+=1 else: r=0 m[j][i]=r r=0 for i in range(x): for j in range(y): M=9999999 for k in range(j,y): M=min(M,m[k][i]) r=max(r,M*(k-j+1)) return r if __name__=='__main__': try: while True: x,y=[int(e) for e in raw_input().split()] if y==0: break data=[raw_input().rstrip() for i in range(y)] print(checkio(data)) except EOFError: pass
Traceback (most recent call last): File "/tmp/tmpdcecgvt5/tmpwdzqnca5.py", line 26, in <module> x,y=[int(e) for e in raw_input().split()] ^^^^^^^^^ NameError: name 'raw_input' is not defined
s580455807
p00117
u844945939
1420528442
Python
Python3
py
Runtime Error
0
0
712
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0117 INF = 1e12 def dijkstra(graph, source): lg = len(graph) unused = list(range(lg)) d = [INF] * (lg) d[source] = 0 while unused: v = min(unused, key=lambda u: d[u]) unused.remove(v) for u in range(n + 1): d[u] = min(d[u], d[v] + graph[v][u]) return d n = int(input()) m = int(input()) cost = [[INF] * (n + 1) for i in range(n + 1)] for i in range(m): ai, bi, ci, di = map(int, input().split(',')) cost[ai][bi] = ci cost[bi][ai] = di x1, x2, y1, y2 = map(int, input().split(',')) d_go = dijkstra(cost, x1)[x2] d_back = dijkstra(cost, x2)[x1] print(y1 - y2 - d_go - d_back)
File "/tmp/tmp_ur1bsmu/tmpbovw3c9z.py", line 1 http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0117 ^ SyntaxError: leading zeros in decimal integer literals are not permitted; use an 0o prefix for octal integers
s799111889
p00117
u873482706
1435475730
Python
Python
py
Runtime Error
0
0
1234
import copy def discomfort(dic, n): global expenses if expenses != None and sum(p_res) >= expenses: return if n == s_n and g_n in load: expenses = sum(p_res) Pirates.append(r-(sum(p_res)+p)) return for v in dic[n]: p_res.append(p_dic[(n,v)]) c_l_dic = copy.deepcopy(dic) c_l_dic[n].remove(v) c_l_dic[v].remove(n) load.append(v) discomfort(c_l_dic, v) del p_res[-1] del load[-1] if __name__ == '__main__': l_dic = {} p_dic = {} for line in open('s.txt').readlines(): n1, n2, p1, p2 = map(int, line.rstrip().split(',')) if not n1 in l_dic: l_dic[n1] = [n2] if not n2 in l_dic: l_dic[n2] = [n1] else: l_dic[n2].append(n1) else: l_dic[n1].append(n2) if not n2 in l_dic: l_dic[n2] = [n1] else: l_dic[n2].append(n1) p_dic[(n1,n2)] = p1 p_dic[(n2,n1)] = p2 s_n, g_n, r, p = map(int, raw_input().split(',')) p_res = [] load = [2] expenses = None Pirates = [] discomfort(l_dic, s_n) print sorted(Pirates)[-1]
File "/tmp/tmpdgqdj0g0/tmpsv6uevad.py", line 47 print sorted(Pirates)[-1] ^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s344389669
p00117
u542962065
1511273971
Python
Python3
py
Runtime Error
0
0
554
import numpy as np n = int(input()) m = int(input()) road = np.full((n, n), np.inf) for i in range(m): r_in = list(map(int, input().split(","))) road[r_in[0]-1, r_in[1]-1] = r_in[2] road[r_in[1]-1, r_in[0]-1] = r_in[3] s, g, v, p = map(int, input().split(",")) for k in range(n): for i in range(n): for j in range(n): if i == j: road[i, j] = 0 else: road[i, j] = min(road[i, j], road[i, k] + road[k, j]) reward = int(v - road[s-1, g-1] - road[g-1, s-1] - p) print(reward)
Traceback (most recent call last): File "/tmp/tmp2vygucbc/tmp_9qa_hwp.py", line 3, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s711452755
p00117
u542962065
1511273979
Python
Python
py
Runtime Error
0
0
554
import numpy as np n = int(input()) m = int(input()) road = np.full((n, n), np.inf) for i in range(m): r_in = list(map(int, input().split(","))) road[r_in[0]-1, r_in[1]-1] = r_in[2] road[r_in[1]-1, r_in[0]-1] = r_in[3] s, g, v, p = map(int, input().split(",")) for k in range(n): for i in range(n): for j in range(n): if i == j: road[i, j] = 0 else: road[i, j] = min(road[i, j], road[i, k] + road[k, j]) reward = int(v - road[s-1, g-1] - road[g-1, s-1] - p) print(reward)
Traceback (most recent call last): File "/tmp/tmpgvr4hje8/tmpu3osf1g2.py", line 3, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s347709244
p00117
u658913995
1512630085
Python
Python
py
Runtime Error
0
0
772
# The question itself is not diffifult, but the website only # tested my code with two cases, so I am not sure whether the # "accepted" is trustworthy. # Note: math.inf > math.inf -> False import math V = int(input()) E = int(input()) fees = [[math.inf] * V for i in range(V)] for i in range(V): fees[i][i] = 0 for i in range(E): a, b, c, d = map(int, input().split(',')) fees[a-1][b-1] = c fees[b-1][a-1] = d start, end, funding, cost = map(int, input().split(',')) for i in range(V): for j in range(V): for k in range(V): if (fees[j][k] > fees[j][i] + fees[i][k]): fees[j][k] = fees[j][i] + fees[i][k] if (fees[start-1][end-1]==math.inf or fees[end-1][start-1]==math.inf): print(0) else: print(funding-cost-fees[start-1][end-1]-fees[end-1][start-1])
Traceback (most recent call last): File "/tmp/tmpwgypndx1/tmphka5aof8.py", line 8, in <module> V = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s737683851
p00118
u633068244
1414860442
Python
Python
py
Runtime Error
0
0
455
def solve(c,h,w,count): if 0 <= h < H and 0 <= w < W: if c in "#@*" and c == A[h][w]: A[h][w] = count solve(c,h+1,w,count) solve(c,h-1,w,count) solve(c,h,w+1,count) solve(c,h,w-1,count) while 1: H,W = map(int,raw_input().split()) if H == W == 0: break A = [list(raw_input()) for i in range(H)] count = 0 for h in range(H): for w in range(W): if str(A[h][w]) in "#@*": solve(A[h][w],h ,w,count) count += 1 print count
File "/tmp/tmp70z735d4/tmp03c3_ve9.py", line 20 print count ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s762746192
p00118
u633068244
1414860765
Python
Python
py
Runtime Error
0
0
456
def solve(c,h,w,count): if 0 <= h < H and 0 <= w < W: if c in "#@*" and c == A[h][w]: A[h][w] = count solve(c,h+1,w,count) solve(c,h-1,w,count) solve(c,h,w+1,count) solve(c,h,w-1,count) while 1: H,W = map(int,raw_input().split()) if H == W == 0: break A = [list(raw_input()) for i in range(H)] count = 0 for h in range(H): for w in range(W): if str(A[h][w]) in "#@*": solve(A[h][w],h ,w,count) count += 1 print count
File "/tmp/tmpowxuyz7b/tmp7ef1c7lr.py", line 21 print count ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s052077037
p00118
u633068244
1414915602
Python
Python
py
Runtime Error
0
0
467
def solve(c,h,w,count): if 0 <= h < H and 0 <= w < W: if type(c) is not int and c == A[h][w]: A[h][w] = count solve(c,h+1,w,count) solve(c,h-1,w,count) solve(c,h,w+1,count) solve(c,h,w-1,count) while 1: H,W = map(int,raw_input().split()) if H == W == 0: break A = [list(raw_input()) for i in range(H)] count = 0 for h in range(H): for w in range(W): if type(A[h][w]) is not int: solve(A[h][w],h ,w,count) count += 1 print count
File "/tmp/tmpank8rt03/tmpjmt5a6gq.py", line 21 print count ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s312140255
p00118
u633068244
1414920132
Python
Python
py
Runtime Error
0
0
447
def solve(c,h,w,count): if 0 <= h < H and 0 <= w < W: if type(A[h][w]) is not int and c == A[h][w]: A[h][w] = count for dh,dw in [[1,0],[-1,0],[0,1],[0,-1]]: solve(c,h+dh,w+dw,count) while 1: H,W = map(int,raw_input().split()) if H == W == 0:break A = [list(raw_input()) for i in range(H)] count = 0 for h in range(H): for w in range(W): if type(A[h][w]) is not int: solve(A[h][w],h ,w,count) count += 1 print count
File "/tmp/tmpt05ge0w5/tmpox3mknmw.py", line 17 print count ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s764833390
p00118
u633068244
1414921929
Python
Python
py
Runtime Error
0
0
350
def solve(c,h,w): if A[h][w] == c: A[h][w] = "X" for dx,dy in zip((1,-1,0,0),(0,0,1,-1)): if 0 <= h+dh < H and 0 <= w+dw < W: solve(c,h+dh,w+dw) while 1: H,W = map(int,raw_input().split()) if H == W == 0: break count = 0 for h in range(H): for w in range(W): if A[h][w] != "X": solve(A[h][w],h,w) count += 1 print count
File "/tmp/tmpthpnalma/tmpwrpzvf8w.py", line 17 print count ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s641889171
p00118
u912237403
1415028743
Python
Python
py
Runtime Error
0
0
467
def f(y,x,c0): global A c=A[y][x] if c==" " or c!=c0: return 0 else: A[y][x]=" " for i,j in [[0,-1],[0,1],[-1,0],[1,0]]: f(y+i,x+j,c0) return 1 while 1: H,W=map(int,raw_input().split()) if H==W==0: break A=[] for i in range(H+2): if i==0 or i==H+1: A.append(list(" "*(W+2))) else: A.append(list(" "+raw_input()+" ")) c=0 for i in range(1,H+1): for j in range(1,W+1): c+=f(i,j,A[i][j]) print c
File "/tmp/tmpgtjn0dqq/tmpu00o2gdq.py", line 25 print c ^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s945980272
p00118
u912237403
1415029593
Python
Python
py
Runtime Error
0
0
566
def f(y,x,c0): global A c=A[y][x] if c==" " or c!=c0: return 0 else: A[y][x]=" " for i,j in [[0,-1],[0,1],[-1,0],[1,0]]: f(y+i,x+j,c0) return 1 while 1: H,W=map(int,raw_input().split()) if H==W==0: break A=[[[] for _ in range(W+2)] for _ in range(H+2)] for i in range(H+2): if i==0 or i==H+1: for j in range(W+2): A[i][j]=" " else: s=" "+raw_input()+" " for j in range(W+2): A[i][j]=s[j] for e in A: print e c=0 for i in range(1,H+1): for j in range(1,W+1): c+=f(i,j,A[i][j]) print c
File "/tmp/tmp1afvjzzu/tmpoiahq892.py", line 22 for e in A: print e ^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s959930845
p00118
u912237403
1415029697
Python
Python
py
Runtime Error
0
0
574
def f(y,x,c0): global A c=A[y][x] if c==" " or c!=c0: return 0 else: A[y][x]=" " for i,j in [[0,-1],[0,1],[-1,0],[1,0]]: f(y+i,x+j,c0) return 1 while 1: H,W=map(int,raw_input().split()) if H==W==0: break A=[[[] for _ in range(W+2)] for _ in range(H+2)] for i in range(H+2): if i==0 or i==H+1: for j in range(W+2): A[i][j]=" " else: s=" "+raw_input().strip()+" " for j in range(W+2): A[i][j]=s[j] for e in A: print e c=0 for i in range(1,H+1): for j in range(1,W+1): c+=f(i,j,A[i][j]) print c
File "/tmp/tmpnmk8socm/tmpxcxyo8gi.py", line 22 for e in A: print e ^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s984888231
p00118
u912237403
1415029762
Python
Python
py
Runtime Error
0
0
560
def f(y,x,c0): global A c=A[y][x] if c==" " or c!=c0: return 0 else: A[y][x]=" " for i,j in [[0,-1],[0,1],[-1,0],[1,0]]: f(y+i,x+j,c0) return 1 while 1: H,W=map(int,raw_input().split()) if H==W==0: break A=[[[] for _ in range(W+2)] for _ in range(H+2)] for i in range(H+2): if i==0 or i==H+1: for j in range(W+2): A[i][j]=" " else: s=raw_input() for j in range(1,W+1): A[i][j]=s[j] for e in A: print e c=0 for i in range(1,H+1): for j in range(1,W+1): c+=f(i,j,A[i][j]) print c
File "/tmp/tmpah4hfmtr/tmp4u01d9dp.py", line 22 for e in A: print e ^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s773201372
p00118
u912237403
1415029813
Python
Python
py
Runtime Error
0
0
569
def f(y,x,c0): global A c=A[y][x] if c==" " or c!=c0: return 0 else: A[y][x]=" " for i,j in [[0,-1],[0,1],[-1,0],[1,0]]: f(y+i,x+j,c0) return 1 while 1: H,W=map(int,raw_input().split()) if H==W==0: break A=[[[] for _ in range(W+2)] for _ in range(H+2)] for i in range(H+2): if i==0 or i==H+1: for j in range(W+2): A[i][j]=" " else: s=raw_input().rstrip() for j in range(1,W+1): A[i][j]=s[j] for e in A: print e c=0 for i in range(1,H+1): for j in range(1,W+1): c+=f(i,j,A[i][j]) print c
File "/tmp/tmp1a74asoj/tmps9c4o46w.py", line 22 for e in A: print e ^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s172313361
p00118
u912237403
1415030147
Python
Python
py
Runtime Error
0
0
544
def f(y,x,c0): global A c=A[y][x] if c==" " or c!=c0: return 0 else: A[y][x]=" " for i,j in [[0,-1],[0,1],[-1,0],[1,0]]: f(y+i,x+j,c0) return 1 while 1: H,W=map(int,raw_input().split()) if H==W==0: break A=[[[] for _ in range(W+2)] for _ in range(H+2)] for i in range(H+2): if i==0 or i==H+1: for j in range(W+2): A[i][j]=" " else: s=" "+raw_input()+" " for j in range(W+2): A[i][j]=s[j] c=0 for i in range(1,H+1): for j in range(1,W+1): c+=f(i,j,A[i][j]) print c
File "/tmp/tmp1y_her8z/tmpahdmn9jg.py", line 26 print c ^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s032894455
p00118
u912237403
1415030214
Python
Python
py
Runtime Error
0
0
537
def f(y,x,c0): global A c=A[y][x] if c==" " or c!=c0: return 0 else: A[y][x]=" " for i,j in [[0,-1],[0,1],[-1,0],[1,0]]: f(y+i,x+j,c0) return 1 while 1: H,W=map(int,raw_input().split()) if H==W==0: break A=[[" " for _ in range(W+2)] for _ in range(H+2)] for i in range(H+2): if i==0 or i==H+1: for j in range(W+2): A[i][j]=" " else: s=raw_input() for j in range(W): A[i][j+1]=s[j] c=0 for i in range(1,H+1): for j in range(1,W+1): c+=f(i,j,A[i][j]) print c
File "/tmp/tmp8yr3qpew/tmpnpoyp0js.py", line 26 print c ^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s285175966
p00118
u912237403
1415030401
Python
Python
py
Runtime Error
0
0
461
def f(y,x,c0): global A c=A[y][x] if c==" " or c!=c0: return 0 else: A[y][x]=" " for i,j in [[0,-1],[0,1],[-1,0],[1,0]]: f(y+i,x+j,c0) return 1 while 1: H,W=map(int,raw_input().split()) if H==W==0: break A=[[" " for _ in range(W+2)] for _ in range(H+2)] for i in range(H): s=raw_input() for j in range(W): A[i+1][j+1]=s[j] c=0 for i in range(1,H+1): for j in range(1,W+1): c+=f(i,j,A[i][j]) print c
File "/tmp/tmpcbx18h8k/tmpxa0gfimh.py", line 23 print c ^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s307495629
p00118
u912237403
1415186687
Python
Python
py
Runtime Error
0
0
461
def f(y,x,c0): global A c=A[y][x] if c=="X" or c!=c0: return 0 else: A[y][x]="X" for i,j in [[0,-1],[0,1],[-1,0],[1,0]]: f(y+i,x+j,c0) return 1 while 1: H,W=map(int,raw_input().split()) if H==W==0: break A=[["X" for _ in range(W+2)] for _ in range(H+2)] for i in range(H): s=raw_input() for j in range(W): A[i+1][j+1]=s[j] c=0 for i in range(1,H+1): for j in range(1,W+1): c+=f(i,j,A[i][j]) print c
File "/tmp/tmp3qgcqkml/tmpjww9xmop.py", line 23 print c ^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s286869468
p00118
u912237403
1415186727
Python
Python
py
Runtime Error
0
0
479
def f(y,x,c0): global A c=A[y][x] if c=="X" or c!=c0: return 0 else: A[y][x]="X" for i,j in [[0,-1],[0,1],[-1,0],[1,0]]: f(y+i,x+j,c0) return 1 while 1: H,W=map(int,raw_input().split()) if H==W==0: break A=[["X" for _ in range(W+2)] for _ in range(H+2)] for i in range(H): s=raw_input() for j in range(W): A[i+1][j+1]=s[j] c=0 for i in range(1,H+1): for j in range(1,W+1): c+=A[i][j] # c+=f(i,j,A[i][j]) print c
File "/tmp/tmpmzy2rhv_/tmp8aa_cvx4.py", line 24 print c ^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s345176250
p00118
u912237403
1415187694
Python
Python
py
Runtime Error
0
0
509
def f(y,x,c0): global A c=A[y][x] if x==0 or x==W+1 or y==0 or y==H+1: return 0 if c=="X" or c!=c0: return 0 else: A[y][x]="X" for i,j in [[0,-1],[0,1],[-1,0],[1,0]]: f(y+i,x+j,c0) return 1 while 1: H,W=map(int,raw_input().split()) if H==W==0: break A=[["X" for _ in range(W+2)] for _ in range(H+2)] for i in range(H): s=raw_input() for j in range(W): A[i+1][j+1]=s[j] c=0 for i in range(1,H+1): for j in range(1,W+1): c+=f(i,j,A[i][j]) print c
File "/tmp/tmp0ypdpwvg/tmphyf4jtg3.py", line 24 print c ^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s865444531
p00118
u912237403
1415187764
Python
Python
py
Runtime Error
0
0
436
if c=="X" or c!=c0: return 0 else: return 0 A[y][x]="X" for i,j in [[0,-1],[0,1],[-1,0],[1,0]]: f(y+i,x+j,c0) return 1 while 1: H,W=map(int,raw_input().split()) if H==W==0: break A=[["X" for _ in range(W+2)] for _ in range(H+2)] for i in range(H): s=raw_input() for j in range(W): A[i+1][j+1]=s[j] c=0 for i in range(1,H+1): for j in range(1,W+1): c+=f(i,j,A[i][j]) print c
File "/tmp/tmp5uvaflp8/tmp41hvzl6i.py", line 1 if c=="X" or c!=c0: IndentationError: unexpected indent
s658193095
p00118
u912237403
1415188300
Python
Python
py
Runtime Error
0
0
439
def f(y,x,c0): global A c=A[y][x] if c=='X' or c!=c0: return 0 else: A[y][x]='X' for i,j in [[0,-1],[0,1],[-1,0],[1,0]]: f(y+i,x+j,c0) return 1 while 1: H,W=map(int,raw_input().split()) if H==W==0: break A=[['X' for _ in range(W+2)] for _ in range(H+2)] for i in range(H): A[i+1][1:W+1]=list(raw_input()) c=0 for i in range(1,H+1): for j in range(1,W+1): c+=f(i,j,A[i][j]) print c
File "/tmp/tmpce98e4xc/tmpli906kcx.py", line 22 print c ^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s533177826
p00118
u633068244
1417490356
Python
Python
py
Runtime Error
0
0
493
def solve(h,w,count,c): if 0 <= h < H and 0 <= w < W and A[h][w] == c: A[h][w] = count for dh,dw in zip([1,0,-1,0],[0,1,0,-1]): solve(h+dh,w+dw,count,c) while 1: H,W = map(int,raw_input().split()) if H == W == 0: break A = [list(raw_input()) for _ in range(H)] count = 0 for h in range(H): for w in range(W): if type(A[h][w]) is not int: solve(h,w,count,A[h][w]) count += 1 print count
File "/tmp/tmp4x0bklv_/tmpfzgc5kh4.py", line 16 print count ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s300217311
p00118
u507118101
1418524437
Python
Python
py
Runtime Error
0
0
686
def dfs(x,y,ch): field[x][y] = '.' for i in range(4): nx = x+moveY[i] ny = y+moveX[i] if (nx >= 0 and ny >= 0) and(nx < H and ny < W) and field[nx][ny] == ch: if field[nx][ny] == '#' or field[nx][ny] == '*'or field[nx][ny] == '@': dfs(nx,ny,field[nx][ny]) if __name__ == '__main__': moveY = [-1,0,1,0] moveX = [0,1,0,-1] H,W = map(int,raw_input().split(' ')) field = ['' for i in range(H)] h = 0 while True: s = raw_input() if s == '0 0': break field[h] = list(s) h += 1 correct =0 for i in range(H): for j in range(W): if field[i][j] == '@' or field[i][j] == '#'or field[i][j] == '*': dfs(i,j,field[i][j]) correct += 1 print correct
File "/tmp/tmpm7tqocod/tmpemznbb9k.py", line 27 print correct ^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s573123200
p00118
u507118101
1418524528
Python
Python
py
Runtime Error
0
0
686
def dfs(x,y,ch): field[x][y] = '.' for i in range(4): nx = x+moveY[i] ny = y+moveX[i] if (nx >= 0 and ny >= 0) and(nx < H and ny < W) and field[nx][ny] == ch: if field[nx][ny] == '#' or field[nx][ny] == '*'or field[nx][ny] == '@': dfs(nx,ny,field[nx][ny]) if __name__ == '__main__': moveY = [-1,0,1,0] moveX = [0,1,0,-1] H,W = map(int,raw_input().split(' ')) field = ['' for i in range(H)] h = 0 while True: s = raw_input() if s == '0 0': break field[h] = list(s) h += 1 correct =0 for i in range(H): for j in range(W): if field[i][j] == '@' or field[i][j] == '#'or field[i][j] == '*': dfs(i,j,field[i][j]) correct += 1 print correct
File "/tmp/tmpfv_b8leq/tmpisqqwut2.py", line 27 print correct ^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s689092585
p00118
u507118101
1418525266
Python
Python
py
Runtime Error
0
0
686
def dfs(x,y,ch): field[x][y] = '.' for i in range(4): nx = x+moveY[i] ny = y+moveX[i] if (nx >= 0 and ny >= 0) and(nx < H and ny < W) and field[nx][ny] == ch: if field[nx][ny] == '#' or field[nx][ny] == '*'or field[nx][ny] == '@': dfs(nx,ny,field[nx][ny]) if __name__ == '__main__': moveY = [-1,0,1,0] moveX = [0,1,0,-1] H,W = map(int,raw_input().split(' ')) field = ['' for i in range(H)] h = 0 while True: s = raw_input() if s == '0 0': break field[h] = list(s) h += 1 correct =0 for i in range(H): for j in range(W): if field[i][j] == '@' or field[i][j] == '#'or field[i][j] == '*': dfs(i,j,field[i][j]) correct += 1 print correct
File "/tmp/tmpxenb3sym/tmp6mtbqx3j.py", line 27 print correct ^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s675314079
p00118
u507118101
1418525615
Python
Python
py
Runtime Error
0
0
641
def dfs(x,y,ch): field[x][y] = '.' for i in range(4): nx = x+moveY[i] ny = y+moveX[i] if (nx >= 0 and ny >= 0) and(nx < H and ny < W) and field[nx][ny] == ch: if field[nx][ny] == '#' or field[nx][ny] == '*'or field[nx][ny] == '@': dfs(nx,ny,field[nx][ny]) moveY = [-1,0,1,0] moveX = [0,1,0,-1] H,W = map(int,raw_input().split(' ')) field = ['' for i in range(H)] h = 0 while True: s = raw_input() if s == '0 0': break field[h] = list(s) h += 1 correct =0 for i in range(H): for j in range(W): if field[i][j] == '@' or field[i][j] == '#'or field[i][j] == '*': dfs(i,j,field[i][j]) correct += 1 print correct
File "/tmp/tmpdm3qfse3/tmpx5uda1_n.py", line 26 print correct ^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s622052543
p00118
u507118101
1418527795
Python
Python
py
Runtime Error
0
0
746
def dfs(X,Y,ch): stack.append([X,Y]) field[X][Y] = '.' while len(stack) != 0: x,y = stack.pop() for i in range(4): nx = x+moveY[i] ny = y+moveX[i] if (nx >= 0 and ny >= 0) and(nx < H and ny < W) and field[nx][ny] == ch: if field[nx][ny] == '#' or field[nx][ny] == '*'or field[nx][ny] == '@': field[nx][ny] = '.' stack.append([nx,ny]) stack = [] moveY = [-1,0,1,0] moveX = [0,1,0,-1] H,W = map(int,raw_input().split(' ')) field = ['' for i in range(H)] h = 0 while True: s = raw_input() if s == '0 0': break field[h] = list(s) h += 1 correct =0 for i in range(H): for j in range(W): if field[i][j] == '@' or field[i][j] == '#'or field[i][j] == '*': dfs(i,j,field[i][j]) correct += 1 print correct
File "/tmp/tmp8exeqmxa/tmp69dq_ocg.py", line 31 print correct ^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s548863796
p00118
u507118101
1418528360
Python
Python
py
Runtime Error
0
0
802
def dfs(X,Y,ch): stack.append([X,Y]) print stack field[X][Y] = '.' while len(stack) != 0: x,y = stack.pop() for i in range(4): nx = x+moveY[i] ny = y+moveX[i] if (nx >= 0 and ny >= 0) and(nx < H and ny < W) and field[nx][ny] == ch: if field[nx][ny] == '#' or field[nx][ny] == '*'or field[nx][ny] == '@': field[nx][ny] = '.' stack.append([nx,ny]) print stack stack = [] moveY = [-1,0,1,0] moveX = [0,1,0,-1] while True: H,W = map(int,raw_input().split(' ')) if H == 0 and W == 0: break field = ['' for i in range(H)] h = 0 while True: field[h] = list(raw_input()) h += 1 correct =0 for i in range(H): for j in range(W): if field[i][j] == '@' or field[i][j] == '#'or field[i][j] == '*': dfs(i,j,field[i][j]) correct += 1 print correct
File "/tmp/tmp7ga5omx2/tmpwpj9lri2.py", line 3 print stack ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s835013502
p00118
u507118101
1418529080
Python
Python
py
Runtime Error
0
0
629
def dfs(X,Y,ch): field[X][Y] = '.' for i in range(4): nx = X+moveY[i] ny = Y+moveX[i] if (nx >= 0 and ny >= 0) and(nx < H and ny < W) and field[nx][ny] == ch: if field[nx][ny] == '#' or field[nx][ny] == '*'or field[nx][ny] == '@': dfs(nx,ny,field[nx][ny]) moveY = [-1,0,1,0] moveX = [0,1,0,-1] while True: H,W = map(int,raw_input().split(' ')) if H == 0 and W == 0: break field = [list(raw_input()) for i in range(H)] print field correct =0 for i in range(H): for j in range(W): if field[i][j] == '@' or field[i][j] == '#'or field[i][j] == '*': dfs(i,j,field[i][j]) correct += 1 print correct
File "/tmp/tmpdtvo4_s0/tmpfut3ct7d.py", line 16 print field ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s865913861
p00118
u873482706
1435549513
Python
Python
py
Runtime Error
0
0
779
def wa(h, w, f): if not (0 <= h <= H-1 and 0 <= w <= W-1): return elif mapp[h][w] != f: return else: mapp[h][w] = '$' #right wa(h, w+1, f) #up wa(h-1, w, f) #left wa(h, w-1, f) #down wa(h+1, w, f) while True: H, W = map(int, raw_input().split(' ')) if H == 0: break mapp = [list(raw_input()) for i in range(H)] count = 0 for h in range(H): for w in range(W): if mapp[h][w] == '@': wa(h, w, '@') elif mapp[h][w] == '#': wa(h, w, '#') elif mapp[h][w] == '*': wa(h, w, '*') else: continue count += 1 else: print count
File "/tmp/tmpxgw9uxjo/tmp7ekvf_sj.py", line 34 print count ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s001468684
p00118
u873482706
1435549707
Python
Python
py
Runtime Error
0
0
724
def wa(h, w, f): if not (0 <= h <= H-1 and 0 <= w <= W-1): return elif mapp[h][w] != f: return else: mapp[h][w] = '$' wa(h, w+1, f) wa(h-1, w, f) wa(h, w-1, f) wa(h+1, w, f) while True: H, W = map(int, raw_input().split(' ')) if H == 0: break mapp = [list(raw_input()) for i in range(H)] count = 0 for h in range(H): for w in range(W): if mapp[h][w] == '@': wa(h, w, '@') elif mapp[h][w] == '#': wa(h, w, '#') elif mapp[h][w] == '*': wa(h, w, '*') else: continue count += 1 else: print count
File "/tmp/tmpd6k5ht_0/tmpb7hf5hqk.py", line 30 print count ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s991289936
p00118
u873482706
1435549778
Python
Python
py
Runtime Error
0
0
735
def wa(h, w, f): if not (0 <= h <= H-1 and 0 <= w <= W-1): return elif mapp[h][w] != f: return else: mapp[h][w] = '$' wa(h, w+1, f) wa(h-1, w, f) wa(h, w-1, f) wa(h+1, w, f) while True: H, W = map(int, raw_input().split(' ')) if H == 0 and W == 0: break mapp = [list(raw_input()) for i in range(H)] count = 0 for h in range(H): for w in range(W): if mapp[h][w] == '@': wa(h, w, '@') elif mapp[h][w] == '#': wa(h, w, '#') elif mapp[h][w] == '*': wa(h, w, '*') else: continue count += 1 else: print count
File "/tmp/tmp096t5iud/tmp9tmrrog7.py", line 30 print count ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s507746799
p00118
u873482706
1435550004
Python
Python
py
Runtime Error
0
0
762
def wa(h, w, f): if not (0 <= h <= H-1 and 0 <= w <= W-1): return elif mapp[h][w] != f: return else: mapp[h][w] = '$' wa(h, w+1, f) wa(h-1, w, f) wa(h, w-1, f) wa(h+1, w, f) while True: H, W = map(int, raw_input().split(' ')) if H == 0 and W == 0: break mapp = [] for i in range(H): mapp.append(list(raw_input())) count = 0 for h in range(H): for w in range(W): if mapp[h][w] == '@': wa(h, w, '@') elif mapp[h][w] == '#': wa(h, w, '#') elif mapp[h][w] == '*': wa(h, w, '*') else: continue count += 1 else: print count
File "/tmp/tmpxmfmmrjb/tmpze2dzf8c.py", line 32 print count ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s921184437
p00118
u873482706
1435550878
Python
Python
py
Runtime Error
0
0
746
def wa(h, w, f): if not (0 <= h <= H-1 and 0 <= w <= W-1): return elif mapp[h][w] != f: return else: mapp[h][w] = '$' wa(h, w+1, f) wa(h-1, w, f) wa(h, w-1, f) wa(h+1, w, f) while True: H, W = map(int, raw_input().split(' ')) if H == 0 and W == 0: break mapp = [list(raw_input()[i*W:i*W+W]) for i in range(H)] count = 0 for h in range(H): for w in range(W): if mapp[h][w] == '@': wa(h, w, '@') elif mapp[h][w] == '#': wa(h, w, '#') elif mapp[h][w] == '*': wa(h, w, '*') else: continue count += 1 else: print count
File "/tmp/tmp0aoug9pz/tmph01cwyyb.py", line 30 print count ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s812869007
p00118
u873482706
1435551023
Python
Python
py
Runtime Error
0
0
803
def wa(h, w, f): if not (0 <= h <= H-1 and 0 <= w <= W-1): return elif mapp[h][w] != f: return else: mapp[h][w] = '$' wa(h, w+1, f) wa(h-1, w, f) wa(h, w-1, f) wa(h+1, w, f) while True: H, W = map(int, raw_input().split(' ')) if H == 0 and W == 0: break line = raw_input() mapp = [list(line[i*W:i*W+W]) for i in range(H)] for line in mapp: print line count = 0 for h in range(H): for w in range(W): if mapp[h][w] == '@': wa(h, w, '@') elif mapp[h][w] == '#': wa(h, w, '#') elif mapp[h][w] == '*': wa(h, w, '*') else: continue count += 1 else: print count
File "/tmp/tmpe3wyzx0n/tmpbr0pg6gh.py", line 19 print line ^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s083351160
p00118
u873482706
1435551211
Python
Python
py
Runtime Error
0
0
770
def wa(h, w, f): if not (0 <= h <= H-1 and 0 <= w <= W-1): return elif mapp[h][w] != f: return else: mapp[h][w] = '$' wa(h, w+1, f) wa(h-1, w, f) wa(h, w-1, f) wa(h+1, w, f) while True: H, W = map(int, raw_input().split(' ')) if H == 0 and W == 0: break line = raw_input() mapp = [list(line[i*W:i*W+W]) for i in range(H)] count = 0 for h in range(H): for w in range(W): if mapp[h][w] == '@': wa(h, w, '@') elif mapp[h][w] == '#': wa(h, w, '#') elif mapp[h][w] == '*': wa(h, w, '*') else: continue count += 1 else: print count
File "/tmp/tmpqggn1rrz/tmp5j7xkzgw.py", line 31 print count ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s052637293
p00118
u873482706
1435551645
Python
Python
py
Runtime Error
0
0
735
def wa(h, w, f): if not (0 <= h <= H-1 and 0 <= w <= W-1): return elif mapp[h][w] != f: return else: mapp[h][w] = '$' wa(h, w+1, f) wa(h-1, w, f) wa(h, w-1, f) wa(h+1, w, f) while True: H, W = map(int, raw_input().split(' ')) if H == 0 and W == 0: break mapp = [list(raw_input()) for i in range(H)] count = 0 for h in range(H): for w in range(W): if mapp[h][w] == '@': wa(h, w, '@') elif mapp[h][w] == '#': wa(h, w, '#') elif mapp[h][w] == '*': wa(h, w, '*') else: continue count += 1 else: print count
File "/tmp/tmp23cauhav/tmpg5e7jfoi.py", line 30 print count ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s231867700
p00118
u873482706
1435552218
Python
Python
py
Runtime Error
0
0
750
def wa(h, w, f): if not (0 <= h <= H-1 and 0 <= w <= W-1): return elif mapp[h][w] != f: return else: mapp[h][w] = '$' wa(h, w+1, f) wa(h-1, w, f) wa(h, w-1, f) wa(h+1, w, f) while True: H, W = map(int, raw_input().split(' ')) if H == 0 and W == 0: break mapp = [list(raw_input()) for i in range(H)] count = 0 for h in range(H): for w in range(W): if mapp[h][w] == '@': count += 1 wa(h, w, '@') elif mapp[h][w] == '#': count += 1 wa(h, w, '#') elif mapp[h][w] == '*': count += 1 wa(h, w, '*') else: print count
File "/tmp/tmpcj40kp1c/tmpakzq7z9m.py", line 30 print count ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s565115978
p00118
u873482706
1435553559
Python
Python
py
Runtime Error
0
0
750
def wa(h, w, f): if not (0 <= h <= H-1 and 0 <= w <= W-1): return elif mapp[h][w] != f: return else: mapp[h][w] = '$' wa(h, w+1, f) wa(h-1, w, f) wa(h, w-1, f) wa(h+1, w, f) while True: H, W = map(int, raw_input().split(' ')) if H == 0 and W == 0: break mapp = [list(raw_input()) for i in range(H)] count = 0 for h in range(H): for w in range(W): if mapp[h][w] == '@': count += 1 wa(h, w, '@') elif mapp[h][w] == '#': count += 1 wa(h, w, '#') elif mapp[h][w] == '*': count += 1 wa(h, w, '*') else: print count
File "/tmp/tmpe8wpo__b/tmp7u6yfhvq.py", line 30 print count ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s698947183
p00118
u873482706
1435553811
Python
Python
py
Runtime Error
0
0
747
def wa(h, w, f): if not (0 <= h <= H-1 and 0 <= w <= W-1): return elif mapp[h][w] != f: return else: mapp[h][w] = '$' wa(h, w+1, f) wa(h-1, w, f) wa(h, w-1, f) wa(h+1, w, f) while True: H, W = map(int, raw_input().split()) if H == 0 and W == 0: break mapp = [list(raw_input()) for i in range(H)] count = 0 for h in range(H): for w in range(W): if mapp[h][w] == '@': count += 1 wa(h, w, '@') elif mapp[h][w] == '#': count += 1 wa(h, w, '#') elif mapp[h][w] == '*': count += 1 wa(h, w, '*') else: print count
File "/tmp/tmp4_cvp0aw/tmpiru98_4v.py", line 30 print count ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s880935667
p00118
u873482706
1435553921
Python
Python
py
Runtime Error
0
0
741
def wa(h, w, f): if not (0 <= h < H and 0 <= w < W): return elif mapp[h][w] != f: return else: mapp[h][w] = '$' wa(h, w+1, f) wa(h-1, w, f) wa(h, w-1, f) wa(h+1, w, f) while True: H, W = map(int, raw_input().split()) if H == 0 and W == 0: break mapp = [list(raw_input()) for i in range(H)] count = 0 for h in range(H): for w in range(W): if mapp[h][w] == '@': count += 1 wa(h, w, '@') elif mapp[h][w] == '#': count += 1 wa(h, w, '#') elif mapp[h][w] == '*': count += 1 wa(h, w, '*') else: print count
File "/tmp/tmp532ykefx/tmp0du4squ2.py", line 30 print count ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s424472831
p00118
u873482706
1435554042
Python
Python
py
Runtime Error
0
0
741
def wa(h, w, f): if not (0 <= h < H and 0 <= w < W): return elif mapp[h][w] != f: return else: mapp[h][w] = '$' wa(h, w+1, f) wa(h-1, w, f) wa(h, w-1, f) wa(h+1, w, f) while True: W, H = map(int, raw_input().split()) if H == 0 and W == 0: break mapp = [list(raw_input()) for i in range(H)] count = 0 for h in range(H): for w in range(W): if mapp[h][w] == '@': count += 1 wa(h, w, '@') elif mapp[h][w] == '#': count += 1 wa(h, w, '#') elif mapp[h][w] == '*': count += 1 wa(h, w, '*') else: print count
File "/tmp/tmpvoo6khyr/tmp3wuyd0oa.py", line 30 print count ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s207314498
p00118
u736039489
1436312494
Python
Python
py
Runtime Error
0
0
882
#! -*- coding:utf-8 -*- while True: H, W = map(int, raw_input().split(' ')) if H==0 and W==0: break #print H, W data = [] for i in range(H): data.append(list(raw_input())) flg = [[0 for j in range(W)] for i in range(H)] def search(i,j,mark): # if i<0 or i>=H or j<0 or j>=W: # break if i+1 < H and flg[i+1][j] == 0 and data[i+1][j] == mark: flg[i+1][j] = 1 search(i+1,j,mark) if i-1 >= 0 and flg[i-1][j] == 0 and data[i-1][j] == mark: flg[i-1][j] = 1 search(i-1,j,mark) if j+1 < W and flg[i][j+1] == 0 and data[i][j+1] == mark : flg[i][j+1] = 1 search(i,j+1,mark) if j-1 >= 0 and flg[i][j-1] == 0 and data[i][j-1] == mark : flg[i][j-1] = 1 search(i,j-1,mark) count = 0 for i in range(H): for j in range(W): if flg[i][j] != 0: continue search(i,j,data[i][j]) count += 1 print count # print data # print flg
File "/tmp/tmpe_h651qc/tmpjrx_m0bm.py", line 44 print count ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s035595382
p00118
u736039489
1436313697
Python
Python
py
Runtime Error
0
0
889
#! -*- coding:utf-8 -*- while True: H, W = map(int, raw_input().split(' ')) #print H, W data = [] for i in range(H): data.append(list(raw_input())) flg = [[0 for j in range(W)] for i in range(H)] def search(i,j,mark): # if i<0 or i>=H or j<0 or j>=W: # break if i+1 < H and flg[i+1][j] == 0 and data[i+1][j] == mark: flg[i+1][j] = 1 search(i+1,j,mark) if i-1 >= 0 and flg[i-1][j] == 0 and data[i-1][j] == mark: flg[i-1][j] = 1 search(i-1,j,mark) if j+1 < W and flg[i][j+1] == 0 and data[i][j+1] == mark : flg[i][j+1] = 1 search(i,j+1,mark) if j-1 >= 0 and flg[i][j-1] == 0 and data[i][j-1] == mark : flg[i][j-1] = 1 search(i,j-1,mark) count = 0 for i in range(H): for j in range(W): if flg[i][j] != 0: continue search(i,j,data[i][j]) count += 1 if H==0 and W==0: break else: print count # print data # print flg
File "/tmp/tmpu9rtvqyh/tmpfyoqooks.py", line 44 print count ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s850958551
p00118
u338932851
1440985807
Python
Python
py
Runtime Error
0
0
1349
dx = [1, 0, -1, 0] dy = [0, 1, 0, -1] def dfs(i, j): if (area[i][j] == '#'): area[i][j] = "." for k in range(4): nx = i + dx[k] ny = j + dy[k] if ((0 <= nx < W) and (0 <= ny < H) and (area[nx][ny] == '#')): dfs(nx, ny) elif (area[i][j] == '@'): area[i][j] = "." for k in range(4): nx = i + dx[k] ny = j + dy[k] if (0 <= nx < W and 0 <= ny < H and area[nx][ny] == '@'): dfs(nx, ny) elif (area[i][j] == '*'): area[i][j] = "." for k in range(4): nx = i + dx[k] ny = j + dy[k] if (0 <= nx < W and 0 <= ny < H and area[nx][ny] == '*'): dfs(nx, ny) while True: H, W = map(int, raw_input().split()) area = [list(raw_input()) for i in range(H)] if H == 0 and W == 0: break count = 0 for i in range(W): for j in range(H): if area[i][j] == '#': dfs(i, j) count += 1 if area[i][j] == '@': dfs(i, j) count += 1 if area[i][j] == '*': dfs(i, j) count += 1 else: continue print count
File "/tmp/tmpdbhl8be1/tmp8naksnuy.py", line 57 print count ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s074114633
p00118
u338932851
1440985893
Python
Python
py
Runtime Error
0
0
1349
dx = [1, 0, -1, 0] dy = [0, 1, 0, -1] def dfs(i, j): if (area[i][j] == '#'): area[i][j] = "." for k in range(4): nx = i + dx[k] ny = j + dy[k] if ((0 <= nx < W) and (0 <= ny < H) and (area[nx][ny] == '#')): dfs(nx, ny) elif (area[i][j] == '@'): area[i][j] = "." for k in range(4): nx = i + dx[k] ny = j + dy[k] if (0 <= nx < W and 0 <= ny < H and area[nx][ny] == '@'): dfs(nx, ny) elif (area[i][j] == '*'): area[i][j] = "." for k in range(4): nx = i + dx[k] ny = j + dy[k] if (0 <= nx < W and 0 <= ny < H and area[nx][ny] == '*'): dfs(nx, ny) while True: H, W = map(int, raw_input().split()) area = [list(raw_input()) for i in range(H)] if H == 0 and W == 0: break count = 0 for i in range(W): for j in range(H): if area[i][j] == '#': dfs(i, j) count += 1 if area[i][j] == '@': dfs(i, j) count += 1 if area[i][j] == '*': dfs(i, j) count += 1 else: continue print count
File "/tmp/tmp3ehn6kd3/tmp302iwcza.py", line 57 print count ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s873425394
p00118
u489809100
1448974867
Python
Python
py
Runtime Error
0
0
746
def check(x, y, flag): farm[x][y] = "$" if farm[x + 1][y] != "$" and farm[x + 1][y] == flag : check(x + 1, y, flag) if farm[x - 1][y] != "$" and farm[x - 1][y] == flag : check(x - 1, y, flag) if farm[x][y + 1] != "$" and farm[x][y + 1] == flag : check(x, y + 1, flag) if farm[x][y - 1] != "$" and farm[x][y - 1] == flag : check(x, y - 1, flag) while True: h,w = map(int, raw_input().split()) if h == 0 and w == 0 : break farm = [] farm.append(list("$" * (w + 2))) for i in range(0, h): farm.append(list("$" + raw_input() + "$")) farm.append(list("$" * (w + 2))) count = 0 for i in range(0, h): for j in range(0, w): if farm[i + 1][j + 1] != "$": check(i + 1, j + 1, farm[i + 1][j + 1]) count += 1 print count
File "/tmp/tmpq8n36kru/tmp28ivdke7.py", line 25 print count ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s319318407
p00118
u489809100
1448975059
Python
Python
py
Runtime Error
0
0
642
def check(x, y, flag): farm[x][y] = "$" if farm[x + 1][y] == flag : check(x + 1, y, flag) if farm[x - 1][y] == flag : check(x - 1, y, flag) if farm[x][y + 1] == flag : check(x, y + 1, flag) if farm[x][y - 1] == flag : check(x, y - 1, flag) while True: h,w = map(int, raw_input().split()) if h == 0 and w == 0 : break farm = [] farm.append(list("$" * (w + 2))) for i in range(0, h): farm.append(list("$" + raw_input() + "$")) farm.append(list("$" * (w + 2))) count = 0 for i in range(0, h): for j in range(0, w): if farm[i + 1][j + 1] != "$": check(i + 1, j + 1, farm[i + 1][j + 1]) count += 1 print count
File "/tmp/tmpw_liqdqp/tmpyapdair5.py", line 25 print count ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s755442666
p00118
u489809100
1448975281
Python
Python
py
Runtime Error
0
0
642
def check(x, y, flag): farm[x][y] = "$" if farm[x + 1][y] == flag : check(x + 1, y, flag) if farm[x - 1][y] == flag : check(x - 1, y, flag) if farm[x][y + 1] == flag : check(x, y + 1, flag) if farm[x][y - 1] == flag : check(x, y - 1, flag) while True: h,w = map(int, raw_input().split()) if h == 0 and w == 0 : break farm = [] farm.append(list("$" * (h + 2))) for i in range(0, w): farm.append(list("$" + raw_input() + "$")) farm.append(list("$" * (h + 2))) count = 0 for i in range(0, w): for j in range(0, h): if farm[i + 1][j + 1] != "$": check(i + 1, j + 1, farm[i + 1][j + 1]) count += 1 print count
File "/tmp/tmptjehgpk6/tmpsjpwydak.py", line 25 print count ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s924102865
p00118
u489809100
1448975480
Python
Python
py
Runtime Error
0
0
646
def check(x, y, flag): farm[x][y] = "$" if farm[x + 1][y] == flag : check(x + 1, y, flag) if farm[x - 1][y] == flag : check(x - 1, y, flag) if farm[x][y + 1] == flag : check(x, y + 1, flag) if farm[x][y - 1] == flag : check(x, y - 1, flag) return 1 while True: h,w = map(int, raw_input().split()) if h == 0 and w == 0 : break farm = [] farm.append(list("$" * (w + 2))) for i in range(0, h): farm.append(list("$" + raw_input() + "$")) farm.append(list("$" * (w + 2))) count = 0 for i in range(0, h): for j in range(0, w): if farm[i + 1][j + 1] != "$": count += check(i + 1, j + 1, farm[i + 1][j + 1]) print count
File "/tmp/tmp04m3urf4/tmpmj0mq5z9.py", line 25 print count ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s773344827
p00118
u489809100
1448975632
Python
Python
py
Runtime Error
0
0
687
import sys sys.setrecursionlimit(10000) def check(x, y, flag): farm[x][y] = "$" if farm[x + 1][y] == flag : check(x + 1, y, flag) if farm[x - 1][y] == flag : check(x - 1, y, flag) if farm[x][y + 1] == flag : check(x, y + 1, flag) if farm[x][y - 1] == flag : check(x, y - 1, flag) return 1 while True: h,w = map(int, raw_input().split()) if h == 0 and w == 0 : break farm = [] farm.append(list("$" * (w + 2))) for i in range(0, h): farm.append(list("$" + raw_input() + "$")) farm.append(list("$" * (w + 2))) count = 0 for i in range(0, h): for j in range(0, w): if farm[i + 1][j + 1] != "$": count += check(i + 1, j + 1, farm[i + 1][j + 1]) print count
File "/tmp/tmppysc6fej/tmpnkzuk4ng.py", line 28 print count ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s548810327
p00118
u421925564
1461571868
Python
Python3
py
Runtime Error
0
0
747
h = 0 w = 0 list1 = [] def dfs(x, y, f): list1[y] = list1[y][:x] + '1' + list1[y][x+1:] if y - 1 >= 0: if list1[y - 1][x] == f: dfs(x, y - 1, f) if y + 1 < h: if list1[y + 1][x] == f: dfs(x, y + 1, f) if x - 1 >= 0: if list1[y][x - 1] == f: dfs(x - 1, y, f) if x + 1 < w: if list1[y][x + 1] == f: dfs(x + 1, y, f) return 1 while True: h, w = list(map(lambda x: int(x),input().split(" "))) if 0 in (h, w): break n = 0 for i in range(0, h): list1.append(input()) for i in range(0, h): for j in range(0, w): if list1[i][j] != '1': n += dfs(j, i, list1[i][j]) print(n)
Traceback (most recent call last): File "/tmp/tmprhg8_svm/tmpi3k2lcxl.py", line 23, in <module> h, w = list(map(lambda x: int(x),input().split(" "))) ^^^^^^^ EOFError: EOF when reading a line
s824789406
p00118
u421925564
1461571951
Python
Python3
py
Runtime Error
0
0
747
h = 0 w = 0 list1 = [] def dfs(x, y, f): list1[y] = list1[y][:x] + '1' + list1[y][x+1:] if y - 1 >= 0: if list1[y - 1][x] == f: dfs(x, y - 1, f) if y + 1 < h: if list1[y + 1][x] == f: dfs(x, y + 1, f) if x - 1 >= 0: if list1[y][x - 1] == f: dfs(x - 1, y, f) if x + 1 < w: if list1[y][x + 1] == f: dfs(x + 1, y, f) return 1 while True: h, w = list(map(lambda x: int(x),input().split(" "))) if 0 in (h, w): break n = 0 for i in range(0, h): list1.append(input()) for i in range(0, h): for j in range(0, w): if list1[i][j] != '1': n += dfs(j, i, list1[i][j]) print(n)
Traceback (most recent call last): File "/tmp/tmpj0vjxwjj/tmp_93zw5ou.py", line 23, in <module> h, w = list(map(lambda x: int(x),input().split(" "))) ^^^^^^^ EOFError: EOF when reading a line
s432708699
p00118
u421925564
1461572070
Python
Python3
py
Runtime Error
0
0
747
h = 0 w = 0 list1 = [] def dfs(x, y, f): list1[y] = list1[y][:x] + '1' + list1[y][x+1:] if y - 1 >= 0: if list1[y - 1][x] == f: dfs(x, y - 1, f) if y + 1 < h: if list1[y + 1][x] == f: dfs(x, y + 1, f) if x - 1 >= 0: if list1[y][x - 1] == f: dfs(x - 1, y, f) if x + 1 < w: if list1[y][x + 1] == f: dfs(x + 1, y, f) return 1 while True: h, w = list(map(lambda x: int(x),input().split(" "))) if 0 in (h, w): break n = 0 for i in range(0, h): list1.append(input()) for i in range(0, h): for j in range(0, w): if list1[i][j] != '1': n += dfs(j, i, list1[i][j]) print(n)
Traceback (most recent call last): File "/tmp/tmp00t2pltm/tmpz09487lg.py", line 23, in <module> h, w = list(map(lambda x: int(x),input().split(" "))) ^^^^^^^ EOFError: EOF when reading a line
s165281318
p00118
u421925564
1461572098
Python
Python
py
Runtime Error
0
0
747
h = 0 w = 0 list1 = [] def dfs(x, y, f): list1[y] = list1[y][:x] + '1' + list1[y][x+1:] if y - 1 >= 0: if list1[y - 1][x] == f: dfs(x, y - 1, f) if y + 1 < h: if list1[y + 1][x] == f: dfs(x, y + 1, f) if x - 1 >= 0: if list1[y][x - 1] == f: dfs(x - 1, y, f) if x + 1 < w: if list1[y][x + 1] == f: dfs(x + 1, y, f) return 1 while True: h, w = list(map(lambda x: int(x),input().split(" "))) if 0 in (h, w): break n = 0 for i in range(0, h): list1.append(input()) for i in range(0, h): for j in range(0, w): if list1[i][j] != '1': n += dfs(j, i, list1[i][j]) print(n)
Traceback (most recent call last): File "/tmp/tmpzqlig3ih/tmpsprprud5.py", line 23, in <module> h, w = list(map(lambda x: int(x),input().split(" "))) ^^^^^^^ EOFError: EOF when reading a line
s499764544
p00118
u421925564
1461649461
Python
Python3
py
Runtime Error
0
0
747
h = 0 w = 0 list1 = [] def dfs(x, y, f): list1[y] = list1[y][:x] + '1' + list1[y][x+1:] if y - 1 >= 0: if list1[y - 1][x] == f: dfs(x, y - 1, f) if y + 1 < h: if list1[y + 1][x] == f: dfs(x, y + 1, f) if x - 1 >= 0: if list1[y][x - 1] == f: dfs(x - 1, y, f) if x + 1 < w: if list1[y][x + 1] == f: dfs(x + 1, y, f) return 1 while True: h, w = list(map(lambda x: int(x),input().split(" "))) if 0 in (h, w): break n = 0 for i in range(0, h): list1.append(input()) for i in range(0, h): for j in range(0, w): if list1[i][j] != '1': n += dfs(j, i, list1[i][j]) print(n)
Traceback (most recent call last): File "/tmp/tmp9c3neliy/tmpit_d8cno.py", line 23, in <module> h, w = list(map(lambda x: int(x),input().split(" "))) ^^^^^^^ EOFError: EOF when reading a line
s329196479
p00118
u421925564
1461653693
Python
Python3
py
Runtime Error
0
0
1046
h = w = 0 slist =[] list1=[] def dfs(f): while True: if len(slist) == 0: return 1 coordinate= slist.pop() #print(coordinate) x = coordinate[0] y = coordinate[1] list1[y] = list1[y][:x] + '1' + list1[y][x + 1:] if x + 1 < w: if list1[y][x + 1] == f: slist.append([x + 1,y]) if x - 1 >= 0: if list1[y][x-1] == f: slist.append([x - 1, y]) if y + 1 < h: if list1[y + 1][x] == f: slist.append([x, y + 1]) if y -1 >= 0: if list1[y -1][x] == f: slist.append([x, y - 1]) while True: h, w = list(map(lambda x: int(x),input().split(" "))) if 0 in (h, w): break n = 0 for i in range(0, h): list1.append(input()) for i in range(0, h): for j in range(0, w): if list1[i][j] != '1': slist.append([j,i]) n += dfs(list1[i][j]) #print(list1) print(n)
Traceback (most recent call last): File "/tmp/tmpii6i8rd1/tmp656dqcum.py", line 28, in <module> h, w = list(map(lambda x: int(x),input().split(" "))) ^^^^^^^ EOFError: EOF when reading a line
s159535702
p00118
u421925564
1461653734
Python
Python3
py
Runtime Error
0
0
1046
h = w = 0 slist =[] list1=[] def dfs(f): while True: if len(slist) == 0: return 1 coordinate= slist.pop() #print(coordinate) x = coordinate[0] y = coordinate[1] list1[y] = list1[y][:x] + '1' + list1[y][x + 1:] if x + 1 < w: if list1[y][x + 1] == f: slist.append([x + 1,y]) if x - 1 >= 0: if list1[y][x-1] == f: slist.append([x - 1, y]) if y + 1 < h: if list1[y + 1][x] == f: slist.append([x, y + 1]) if y -1 >= 0: if list1[y -1][x] == f: slist.append([x, y - 1]) while True: h, w = list(map(lambda x: int(x),input().split(" "))) if 0 in (h, w): break n = 0 for i in range(0, h): list1.append(input()) for i in range(0, h): for j in range(0, w): if list1[i][j] != '1': slist.append([j,i]) n += dfs(list1[i][j]) #print(list1) print(n)
Traceback (most recent call last): File "/tmp/tmptqqeiohu/tmpvb2tv7uc.py", line 28, in <module> h, w = list(map(lambda x: int(x),input().split(" "))) ^^^^^^^ EOFError: EOF when reading a line
s508481170
p00118
u421925564
1461653759
Python
Python3
py
Runtime Error
0
0
1046
h = w = 0 slist =[] list1=[] def dfs(f): while True: if len(slist) == 0: return 1 coordinate= slist.pop() #print(coordinate) x = coordinate[0] y = coordinate[1] list1[y] = list1[y][:x] + '1' + list1[y][x + 1:] if x + 1 < w: if list1[y][x + 1] == f: slist.append([x + 1,y]) if x - 1 >= 0: if list1[y][x-1] == f: slist.append([x - 1, y]) if y + 1 < h: if list1[y + 1][x] == f: slist.append([x, y + 1]) if y -1 >= 0: if list1[y -1][x] == f: slist.append([x, y - 1]) while True: h, w = list(map(lambda x: int(x),input().split(" "))) if 0 in (h, w): break n = 0 for i in range(0, h): list1.append(input()) for i in range(0, h): for j in range(0, w): if list1[i][j] != '1': slist.append([j,i]) n += dfs(list1[i][j]) #print(list1) print(n)
Traceback (most recent call last): File "/tmp/tmpjiz6zid_/tmpi4oukjq_.py", line 28, in <module> h, w = list(map(lambda x: int(x),input().split(" "))) ^^^^^^^ EOFError: EOF when reading a line
s142838702
p00118
u421925564
1461654033
Python
Python3
py
Runtime Error
0
0
1046
h = w = 0 slist =[] list1=[] def dfs(f): while True: if len(slist) == 0: return 1 coordinate= slist.pop() #print(coordinate) x = coordinate[0] y = coordinate[1] list1[y] = list1[y][:x] + '1' + list1[y][x + 1:] if x + 1 < w: if list1[y][x + 1] == f: slist.append([x + 1,y]) if x - 1 >= 0: if list1[y][x-1] == f: slist.append([x - 1, y]) if y + 1 < h: if list1[y + 1][x] == f: slist.append([x, y + 1]) if y -1 >= 0: if list1[y -1][x] == f: slist.append([x, y - 1]) while True: h, w = list(map(lambda x: int(x),input().split(" "))) if 0 in (h, w): break n = 0 for i in range(0, h): list1.append(input()) for i in range(0, h): for j in range(0, w): if list1[i][j] != '1': slist.append([j,i]) n += dfs(list1[i][j]) #print(list1) print(n)
Traceback (most recent call last): File "/tmp/tmp9bh4ecyz/tmp9evi8ors.py", line 28, in <module> h, w = list(map(lambda x: int(x),input().split(" "))) ^^^^^^^ EOFError: EOF when reading a line
s204894645
p00118
u421925564
1461654818
Python
Python3
py
Runtime Error
0
0
760
h = 0 w = 0 list1 = [] def dfs(x, y, f): list1[y] = list1[y][:x] + '1' + list1[y][x+1:] if y - 1 >= 0: if list1[y - 1][x] == f: dfs(x, y - 1, f) if y + 1 < h: if list1[y + 1][x] == f: dfs(x, y + 1, f) if x - 1 >= 0: if list1[y][x - 1] == f: dfs(x - 1, y, f) if x + 1 < w: if list1[y][x + 1] == f: dfs(x + 1, y, f) return 1 while True: h, w = list(map(lambda x: int(x),input().split(" "))) if 0 in (h, w): break n = 0 for i in range(0, h): list1.append(input()) for i in range(0, h): for j in range(0, w): if list1[i][j] != '1': n += dfs(j, i, list1[i][j]) print(n) list1=[]
Traceback (most recent call last): File "/tmp/tmpgap5_xa0/tmpxjg4urji.py", line 23, in <module> h, w = list(map(lambda x: int(x),input().split(" "))) ^^^^^^^ EOFError: EOF when reading a line
s086812647
p00118
u421925564
1461654979
Python
Python3
py
Runtime Error
0
0
760
h = 0 w = 0 list1 = [] def dfs(x, y, f): list1[y] = list1[y][:x] + '1' + list1[y][x+1:] if y - 1 >= 0: if list1[y - 1][x] == f: dfs(x, y - 1, f) if y + 1 < h: if list1[y + 1][x] == f: dfs(x, y + 1, f) if x - 1 >= 0: if list1[y][x - 1] == f: dfs(x - 1, y, f) if x + 1 < w: if list1[y][x + 1] == f: dfs(x + 1, y, f) return 1 while True: h, w = list(map(lambda x: int(x),input().split(" "))) if 0 in (h, w): break n = 0 for i in range(0, h): list1.append(input()) for i in range(0, h): for j in range(0, w): if list1[i][j] != '1': n += dfs(j, i, list1[i][j]) print(n) list1=[]
Traceback (most recent call last): File "/tmp/tmp8x_w8cx3/tmplqrmaofq.py", line 23, in <module> h, w = list(map(lambda x: int(x),input().split(" "))) ^^^^^^^ EOFError: EOF when reading a line
s540132425
p00118
u421925564
1461655447
Python
Python3
py
Runtime Error
0
0
774
h = 0 w = 0 list1 = [] def dfs(x, y, f): list1[y] = list1[y][:x] + '1' + list1[y][x+1:] if y - 1 >= 0: if list1[y - 1][x] == f: dfs(x, y - 1, f) if y + 1 < h: if list1[y + 1][x] == f: dfs(x, y + 1, f) if x - 1 >= 0: if list1[y][x - 1] == f: dfs(x - 1, y, f) if x + 1 < w: if list1[y][x + 1] == f: dfs(x + 1, y, f) return while True: h, w = list(map(lambda x: int(x),input().split(" "))) if 0 in (h, w): break n = 0 for i in range(0, h): list1.append(input()) for i in range(0, h): for j in range(0, w): if list1[i][j] != '1': dfs(j, i, list1[i][j]) n+=1 print(n) list1=[]
Traceback (most recent call last): File "/tmp/tmp_i9aky1n/tmpnsst480l.py", line 23, in <module> h, w = list(map(lambda x: int(x),input().split(" "))) ^^^^^^^ EOFError: EOF when reading a line
s596529673
p00118
u884495090
1461750786
Python
Python
py
Runtime Error
0
0
657
#!/usr/bin/env python matrix = [] vec = [[1,0],[-1,0],[0,1],[0,-1]] visited =[] def dfs(x,y,fruit): visited.append((x,y)) for v in vec: nx = x + v[0] ny = y + v[1] if not (nx,ny) in visited and nx in xrange(w) and ny in xrange(h): if matrix[ny][nx] == fruit: dfs(nx,ny,fruit) while True: h,w = map(int,raw_input().rstrip().split(" ")) if h == 0 and w == 0: break matrix = [] visited = [] ans = 0 for i in xrange(h): s = raw_input().rstrip() matrix.append(list(s)) for i in xrange(h): for j in xrange(w): if not (j,i) in visited: dfs(j,i,matrix[i][j]) ans+=1 print ans
File "/tmp/tmpdw2m7gt_/tmppa1313ip.py", line 34 print ans ^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s974924382
p00118
u884495090
1461751088
Python
Python
py
Runtime Error
0
0
657
#!/usr/bin/env python matrix = [] vec = [[1,0],[-1,0],[0,1],[0,-1]] visited =[] def dfs(x,y,fruit): visited.append((x,y)) for v in vec: nx = x + v[0] ny = y + v[1] if not (nx,ny) in visited and nx in xrange(w) and ny in xrange(h): if matrix[ny][nx] == fruit: dfs(nx,ny,fruit) while True: h,w = map(int,raw_input().rstrip().split(" ")) if h == 0 and w == 0: break matrix = [] visited = [] ans = 0 for i in xrange(h): s = raw_input().rstrip() matrix.append(list(s)) for i in xrange(h): for j in xrange(w): if not (j,i) in visited: dfs(j,i,matrix[i][j]) ans+=1 print ans
File "/tmp/tmpzxv20bwd/tmpz2qhzr3l.py", line 34 print ans ^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s419661467
p00118
u884495090
1461751428
Python
Python
py
Runtime Error
0
0
698
#!/usr/bin/env python import sys sys.setrecursionlimit(10000) matrix = [] vec = [[1,0],[-1,0],[0,1],[0,-1]] visited =[] def dfs(x,y,fruit): visited.append((x,y)) for v in vec: nx = x + v[0] ny = y + v[1] if not (nx,ny) in visited and nx in xrange(w) and ny in xrange(h): if matrix[ny][nx] == fruit: dfs(nx,ny,fruit) while True: h,w = map(int,raw_input().rstrip().split(" ")) if h == 0 and w == 0: break matrix = [] visited = [] ans = 0 for i in xrange(h): s = raw_input().rstrip() matrix.append(list(s)) for i in xrange(h): for j in xrange(w): if not (j,i) in visited: dfs(j,i,matrix[i][j]) ans+=1 print ans
File "/tmp/tmp7kcxe62d/tmpae55zb9e.py", line 37 print ans ^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s804996133
p00118
u884495090
1461752357
Python
Python
py
Runtime Error
0
0
737
#!/usr/bin/env python import sys sys.setrecursionlimit(10000) matrix = [] vec = [[1,0],[-1,0],[0,1],[0,-1]] visited =[] h = 0 w = 0 def dfs(x,y,fruit): global visited visited.append((x,y)) for v in vec: nx = x + v[0] ny = y + v[1] if (not (nx,ny) in visited) and nx in xrange(w) and ny in xrange(h): if matrix[ny][nx] == fruit: dfs(nx,ny,fruit) return 0 while True: h,w = map(int,raw_input().rstrip().split(" ")) if h == 0 and w == 0: break matrix = [] visited = [] ans = 0 for i in xrange(h): s = raw_input().rstrip() matrix.append(list(s)) for i in xrange(h): for j in xrange(w): if not (j,i) in visited: dfs(j,i,matrix[i][j]) ans+=1 print ans
File "/tmp/tmpetb9p59c/tmps77v62xj.py", line 38 print ans ^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s373504365
p00118
u884495090
1461755424
Python
Python
py
Runtime Error
0
0
753
#!/usr/bin/env python matrix = [] vec = [[1,0],[-1,0],[0,1],[0,-1]] visited =[] h = 0 w = 0 def dfs(x,y,fruit): #visited.append((x,y)) visited[y][x] = 1 for v in vec: nx = x + v[0] ny = y + v[1] if nx in xrange(w) and ny in xrange(h): if visited[ny][nx]==0 and matrix[ny][nx] == fruit: dfs(nx,ny,fruit) return 0 while True: h,w = map(int,raw_input().split()) if h == 0 and w == 0: break # print h,w matrix = [] visited = [] ans = 0 for i in xrange(h): s = raw_input().rstrip() matrix.append(list(s)) visited.append([0]*w) for i in xrange(h): for j in xrange(w): #if not (j,i) in visited: if visited[i][j] == 0: dfs(j,i,matrix[i][j]) ans+=1 print ans
File "/tmp/tmpbme02na4/tmpz3slaj6n.py", line 40 print ans ^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s952960747
p00118
u884495090
1461755480
Python
Python
py
Runtime Error
0
0
793
#!/usr/bin/env python import sys sys.setrecursionlimit(10000) matrix = [] vec = [[1,0],[-1,0],[0,1],[0,-1]] visited =[] h = 0 w = 0 def dfs(x,y,fruit): #visited.append((x,y)) visited[y][x] = 1 for v in vec: nx = x + v[0] ny = y + v[1] if nx in xrange(w) and ny in xrange(h): if visited[ny][nx]==0 and matrix[ny][nx] == fruit: dfs(nx,ny,fruit) return 0 while True: h,w = map(int,raw_input().split()) if h == 0 and w == 0: break # print h,w matrix = [] visited = [] ans = 0 for i in xrange(h): s = raw_input().rstrip() matrix.append(list(s)) visited.append([0]*w) for i in xrange(h): for j in xrange(w): #if not (j,i) in visited: if visited[i][j] == 0: dfs(j,i,matrix[i][j]) ans+=1 print ans
File "/tmp/tmpbdk64hat/tmps62dg34o.py", line 42 print ans ^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s038087022
p00118
u685815919
1473650415
Python
Python
py
Runtime Error
0
0
635
dxy = [[1, 0], [0, 1], [-1, 0], [0, -1]] field = [] H, W = 0, 0 def solver(x, y, symbol): global field, H, W if x < 0 or y < 0 or x >= H or y >= W: return for dx, dy in dxy: if x+dx < 0 or y+dy < 0 or x+dx >= H or y+dy >= W: continue if field[x+dx][y+dy] == symbol: field[x+dx][y+dy] = '.' solver(x+dx, y+dy, symbol) while True: H, W = map(int, raw_input().split()) if H == 0 and W == 0: break field = [list(raw_input()) for i in range(H)] ans = 0 for x in xrange(H): for y in xrange(W): if field[x][y] != '.': solver(x, y, field[x][y]) ans += 1 print ans
File "/tmp/tmpk4fz7o6m/tmpz13clto4.py", line 27 print ans ^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s820051097
p00118
u685815919
1473651135
Python
Python
py
Runtime Error
0
0
636
dxy = [[1, 0], [0, 1], [-1, 0], [0, -1]] field = [] H, W = 0, 0 def solver(x, y, symbol): global field, H, W if x < 0 or y < 0 or x >= H or y >= W: return for dx, dy in dxy: if x+dx < 0 or y+dy < 0 or x+dx >= H or y+dy >= W: continue if field[x+dx][y+dy] == symbol: field[x+dx][y+dy] = '.' solver(x+dx, y+dy, symbol) while True: H, W = map(int, raw_input().split()) if H == 0 and W == 0: break field = [list(raw_input()) for i in range(H)] ans = 0 for x in xrange(H): for y in xrange(W): if field[x][y] != '.': solver(x, y, field[x][y]) ans += 1 print ans
File "/tmp/tmplxaz7lm6/tmp9u8jh3_z.py", line 28 print ans ^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s276510888
p00118
u685815919
1473652992
Python
Python
py
Runtime Error
0
0
752
dxy = [[1, 0], [0, 1], [-1, 0], [0, -1]] field = [] H, W = 0, 0 q = queue.Queue() def solver(x, y, symbol): global q, field, H, W while True: if x < 0 or y < 0 or x >= H or y >= W: continue for dx, dy in dxy: if x+dx < 0 or y+dy < 0 or x+dx >= H or y+dy >= W: continue if field[x+dx][y+dy] == symbol: field[x+dx][y+dy] = '.' q.put([x+dx, y+dy]) data = q.get() if data is None: return x, y = data) while True: H, W = map(int, raw_input().split()) if H == 0 and W == 0: break field = [list(raw_input()) for i in range(H)] ans = 0 for x in xrange(H): for y in xrange(W): if field[x][y] != '.': solver(x, y, field[x][y]) ans += 1 print ans
File "/tmp/tmpuowu8279/tmppd6b_iz8.py", line 20 x, y = data) ^ SyntaxError: unmatched ')'
s235387219
p00118
u727466163
1473696383
Python
Python
py
Runtime Error
0
0
582
count=0 a_0=[] a_1=[] mode=0 init_input=raw_input().split() n=init_input[0] m=init_input[1] a_0=raw_input().split() for i in range(m): if i==0: count+=1 else: if a_0[i]!=a_0[i-1]: count+=1 mode=1 n-=1 while n>0: if mode==0: a_0=raw_input().split() for i in range(m): if a_0[i]!=a_1[i]: if i==0: count+=1 else: if a_0[i]!=a_0[i-1]: count+=1 mode=1 n-=1 else: a_1=raw_input().split() for i in range(m): if a_1[i]!=a_0[i]: if i==0: count+=1 else: if a_1[i]!=a_1[i-1]: count+=1 mode=0 n-=1 print count
File "/tmp/tmptd38_vsg/tmpt2d0nvbv.py", line 44 print count ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s252762473
p00118
u393305246
1473696584
Python
Python
py
Runtime Error
0
0
582
count=0 a_0=[] a_1=[] mode=0 init_input=raw_input().split() n=init_input[0] m=init_input[1] a_0=raw_input().split() for i in range(m): if i==0: count+=1 else: if a_0[i]!=a_0[i-1]: count+=1 mode=1 n-=1 while n>0: if mode==0: a_0=raw_input().split() for i in range(m): if a_0[i]!=a_1[i]: if i==0: count+=1 else: if a_0[i]!=a_0[i-1]: count+=1 mode=1 n-=1 else: a_1=raw_input().split() for i in range(m): if a_1[i]!=a_0[i]: if i==0: count+=1 else: if a_1[i]!=a_1[i-1]: count+=1 mode=0 n-=1 print count
File "/tmp/tmpkm0bf4ty/tmptwov7h5u.py", line 44 print count ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s308200377
p00118
u393305246
1473696927
Python
Python
py
Runtime Error
0
0
592
count=0 a_0=[] a_1=[] mode=0 init_input=map(int, raw_input().split()) n=init_input[0] m=init_input[1] a_0=raw_input().split() for i in range(m): if i==0: count+=1 else: if a_0[i]!=a_0[i-1]: count+=1 mode=1 n-=1 while n>0: if mode==0: a_0=raw_input().split() for i in range(m): if a_0[i]!=a_1[i]: if i==0: count+=1 else: if a_0[i]!=a_0[i-1]: count+=1 mode=1 n-=1 else: a_1=raw_input().split() for i in range(m): if a_1[i]!=a_0[i]: if i==0: count+=1 else: if a_1[i]!=a_1[i-1]: count+=1 mode=0 n-=1 print count
File "/tmp/tmptirfnobg/tmppcqb85sn.py", line 44 print count ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s710827057
p00118
u393305246
1473697441
Python
Python
py
Runtime Error
0
0
592
count=0 a_0=[] a_1=[] mode=0 init_input=map(int, raw_input().split()) n=init_input[0] m=init_input[1] line=input() a_0=list(line) for i in range(m): if i==0: count+=1 else: if a_0[i]!=a_0[i-1]: count+=1 mode=1 n-=1 while n>0: line=input() if mode==0: a_0=list(line) for i in range(m): if a_0[i]!=a_1[i]: if i==0: count+=1 else: if a_0[i]!=a_0[i-1]: count+=1 mode=1 n-=1 else: a_1=list(line) for i in range(m): if a_1[i]!=a_0[i]: if i==0: count+=1 else: if a_1[i]!=a_1[i-1]: count+=1 mode=0 n-=1 print count
File "/tmp/tmpqu8j6zie/tmpempq1zxa.py", line 46 print count ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s231035398
p00118
u350804311
1473921229
Python
Python3
py
Runtime Error
0
0
713
while True: H, W = list(map(int, input().split())) if H == 0 and W == 0: break field = [] for i in range(H): field.append(list(input())) ans = 0 def field_count(x, y): fruit = field[x][y] field[x][y] = "." for dx in [-1, 0, 1]: nx = x + dx if 0 <= nx < H and field[nx][y] == fruit: field_count(nx, y) for dy in [-1, 0, 1]: ny = y + dy if 0 <= ny < W and field[x][ny] == fruit: field_count(x, ny) for i in range(H): for j in range(W): if field[i][j] != ".": field_count(i, j) ans += 1 print(str(ans))
Traceback (most recent call last): File "/tmp/tmpf5git6mm/tmpcbthcwcy.py", line 2, in <module> H, W = list(map(int, input().split())) ^^^^^^^ EOFError: EOF when reading a line