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
s934998267
p00118
u945345165
1493345405
Python
Python3
py
Runtime Error
0
0
1218
def setLine(tempH, line): for i in range(0, len(line)): geo[tempH][i] = line[i:i+1] def solve(): person = 0 for i in range(0,H): for j in range(0,W): if geo[i][j] is not "_": search(i,j) person += 1 print(person) def search(i,j): temp = geo[i][j] geo[i][j] = "_" dx = [-1,0,1,0] dy = [0,-1,0,1] for a in range(0,4): idx = i + dx[a] jdy = j + dy[a] if(isOnMap(idx, jdy)): if(isNeededToSolve(temp, idx, jdy)): search(idx,jdy) def isOnMap(i,j): return (0<=i and 0<=j and i<H and j<W) def isNeededToSolve(temp,i,j): target = geo[i][j] return (target is not "_" and temp is target) H = -1 W = -1 tempH = 0 geo = [[0 for i in range(1)]for j in range(1)] repeat = True while repeat: line = input() if H is -1 and W is -1: H = int(line.split(" ")[0]) W = int(line.split(" ")[1]) geo = [[0 for i in range(W)] for j in range(H)] else: setLine(tempH, line) tempH+=1 #break if H is 0 and W is 0: break #solve if tempH is H: solve() H = -1 W = -1 tempH = 0
/tmp/tmp424hb4pa/tmprgrkfcwq.py:9: SyntaxWarning: "is not" with a literal. Did you mean "!="? if geo[i][j] is not "_": /tmp/tmp424hb4pa/tmprgrkfcwq.py:31: SyntaxWarning: "is not" with a literal. Did you mean "!="? return (target is not "_" and temp is target) /tmp/tmp424hb4pa/tmprgrkfcwq.py:40: SyntaxWarning: "is" with a literal. Did you mean "=="? if H is -1 and W is -1: /tmp/tmp424hb4pa/tmprgrkfcwq.py:40: SyntaxWarning: "is" with a literal. Did you mean "=="? if H is -1 and W is -1: /tmp/tmp424hb4pa/tmprgrkfcwq.py:49: SyntaxWarning: "is" with a literal. Did you mean "=="? if H is 0 and W is 0: /tmp/tmp424hb4pa/tmprgrkfcwq.py:49: SyntaxWarning: "is" with a literal. Did you mean "=="? if H is 0 and W is 0: Traceback (most recent call last): File "/tmp/tmp424hb4pa/tmprgrkfcwq.py", line 39, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s360904846
p00118
u945345165
1493345491
Python
Python3
py
Runtime Error
0
0
1263
def setLine(tempH, line): for i in range(0, len(line)): geo[tempH][i] = line[i:i+1] def solve(): person = 0 for i in range(0,H): for j in range(0,W): if geo[i][j] is not "_": search(i,j) person += 1 print(person) def search(i,j): temp = geo[i][j] geo[i][j] = "_" dx = [-1,0,1,0] dy = [0,-1,0,1] for a in range(0,4): idx = i + dx[a] jdy = j + dy[a] if(isOnMap(idx, jdy)): if(isNeededToSolve(temp, idx, jdy)): search(idx,jdy) def isOnMap(i,j): return (0<=i and 0<=j and i<H and j<W) def isNeededToSolve(temp,i,j): target = geo[i][j] return (target is not "_" and temp is target) limit = 10**10 sys.getrecursionlimit(limit) H = -1 W = -1 tempH = 0 geo = [[0 for i in range(1)]for j in range(1)] repeat = True while repeat: line = input() if H is -1 and W is -1: H = int(line.split(" ")[0]) W = int(line.split(" ")[1]) geo = [[0 for i in range(W)] for j in range(H)] else: setLine(tempH, line) tempH+=1 #break if H is 0 and W is 0: break #solve if tempH is H: solve() H = -1 W = -1 tempH = 0
/tmp/tmpx8x9zggu/tmpb8ufaqot.py:9: SyntaxWarning: "is not" with a literal. Did you mean "!="? if geo[i][j] is not "_": /tmp/tmpx8x9zggu/tmpb8ufaqot.py:31: SyntaxWarning: "is not" with a literal. Did you mean "!="? return (target is not "_" and temp is target) /tmp/tmpx8x9zggu/tmpb8ufaqot.py:43: SyntaxWarning: "is" with a literal. Did you mean "=="? if H is -1 and W is -1: /tmp/tmpx8x9zggu/tmpb8ufaqot.py:43: SyntaxWarning: "is" with a literal. Did you mean "=="? if H is -1 and W is -1: /tmp/tmpx8x9zggu/tmpb8ufaqot.py:52: SyntaxWarning: "is" with a literal. Did you mean "=="? if H is 0 and W is 0: /tmp/tmpx8x9zggu/tmpb8ufaqot.py:52: SyntaxWarning: "is" with a literal. Did you mean "=="? if H is 0 and W is 0: Traceback (most recent call last): File "/tmp/tmpx8x9zggu/tmpb8ufaqot.py", line 34, in <module> sys.getrecursionlimit(limit) ^^^ NameError: name 'sys' is not defined
s014445014
p00118
u284851373
1493353440
Python
Python3
py
Runtime Error
0
0
1037
# -*- coding:utf-8 -*- import sys sys.setrecursionlimit(1000000) def preDatasets(): #f = open('a.txt') datas = sys.stdin.readlines() #f.close() for i in range(len(datas)): datas[i] = datas[i].strip('\n') return datas def dfs(x, y, sym): tile[x][y] = '.' for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if(nx>=0 and nx<N and ny>=0 and ny<M and tile[nx][ny]==sym): dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): if not tile[i][j] == '.': if tile[i][j] == '@': dfs(i, j, '@') res += 1 elif tile[i][j] == '#': dfs(i, j, '#') res += 1 elif tile[i][j] == '*': dfs(i, j, '*') res += 1 print(res) index = 0 while True: datas = preDatasets() DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] N = int(datas[index].split(' ')[0]) M = int(datas[index].split(' ')[1]) tile = [[0 for i in range(N)]for j in range(M)] for i in range(len(tile)): tile[i] = list(datas[index+i+1]) print(tile) if N == 0: break else: solve() index += N+1
Traceback (most recent call last): File "/tmp/tmpbr3_d6o4/tmp5ily0vi8.py", line 43, in <module> N = int(datas[index].split(' ')[0]) ~~~~~^^^^^^^ IndexError: list index out of range
s530122803
p00118
u284851373
1493353462
Python
Python3
py
Runtime Error
0
0
1005
# -*- coding:utf-8 -*- import sys sys.setrecursionlimit(1000000) def preDatasets(): datas = sys.stdin.readlines() for i in range(len(datas)): datas[i] = datas[i].strip('\n') return datas def dfs(x, y, sym): tile[x][y] = '.' for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if(nx>=0 and nx<N and ny>=0 and ny<M and tile[nx][ny]==sym): dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): if not tile[i][j] == '.': if tile[i][j] == '@': dfs(i, j, '@') res += 1 elif tile[i][j] == '#': dfs(i, j, '#') res += 1 elif tile[i][j] == '*': dfs(i, j, '*') res += 1 print(res) index = 0 while True: datas = preDatasets() DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] N = int(datas[index].split(' ')[0]) M = int(datas[index].split(' ')[1]) tile = [[0 for i in range(N)]for j in range(M)] for i in range(len(tile)): tile[i] = list(datas[index+i+1]) print(tile) if N == 0: break else: solve() index += N+1
Traceback (most recent call last): File "/tmp/tmp36_npal1/tmpykic919s.py", line 41, in <module> N = int(datas[index].split(' ')[0]) ~~~~~^^^^^^^ IndexError: list index out of range
s321331159
p00118
u284851373
1493353477
Python
Python3
py
Runtime Error
0
0
1006
# -*- coding:utf-8 -*- import sys sys.setrecursionlimit(10000000) def preDatasets(): datas = sys.stdin.readlines() for i in range(len(datas)): datas[i] = datas[i].strip('\n') return datas def dfs(x, y, sym): tile[x][y] = '.' for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if(nx>=0 and nx<N and ny>=0 and ny<M and tile[nx][ny]==sym): dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): if not tile[i][j] == '.': if tile[i][j] == '@': dfs(i, j, '@') res += 1 elif tile[i][j] == '#': dfs(i, j, '#') res += 1 elif tile[i][j] == '*': dfs(i, j, '*') res += 1 print(res) index = 0 while True: datas = preDatasets() DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] N = int(datas[index].split(' ')[0]) M = int(datas[index].split(' ')[1]) tile = [[0 for i in range(N)]for j in range(M)] for i in range(len(tile)): tile[i] = list(datas[index+i+1]) print(tile) if N == 0: break else: solve() index += N+1
Traceback (most recent call last): File "/tmp/tmprgzjtgii/tmp57mk5szq.py", line 41, in <module> N = int(datas[index].split(' ')[0]) ~~~~~^^^^^^^ IndexError: list index out of range
s301512354
p00118
u284851373
1493353538
Python
Python3
py
Runtime Error
0
0
993
# -*- coding:utf-8 -*- import sys sys.setrecursionlimit(10000000) def preDatasets(): datas = sys.stdin.readlines() for i in range(len(datas)): datas[i] = datas[i].strip('\n') return datas def dfs(x, y, sym): tile[x][y] = '.' for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if(nx>=0 and nx<N and ny>=0 and ny<M and tile[nx][ny]==sym): dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): if not tile[i][j] == '.': if tile[i][j] == '@': dfs(i, j, '@') res += 1 elif tile[i][j] == '#': dfs(i, j, '#') res += 1 elif tile[i][j] == '*': dfs(i, j, '*') res += 1 print(res) index = 0 while True: datas = preDatasets() DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] N = int(datas[index].split(' ')[0]) M = int(datas[index].split(' ')[1]) tile = [[0 for i in range(N)]for j in range(M)] for i in range(len(tile)): tile[i] = list(datas[index+i+1]) if N == 0: break else: solve() index += N+1
Traceback (most recent call last): File "/tmp/tmpb_4fn35o/tmp8oa96i11.py", line 41, in <module> N = int(datas[index].split(' ')[0]) ~~~~~^^^^^^^ IndexError: list index out of range
s627237537
p00118
u284851373
1493353593
Python
Python3
py
Runtime Error
0
0
993
# -*- coding:utf-8 -*- import sys sys.setrecursionlimit(10000000) def preDatasets(): datas = sys.stdin.readlines() for i in range(len(datas)): datas[i] = datas[i].strip('\n') return datas def dfs(x, y, sym): tile[x][y] = '.' for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if(nx>=0 and nx<N and ny>=0 and ny<M and tile[nx][ny]==sym): dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): if not tile[i][j] == '.': if tile[i][j] == '@': dfs(i, j, '@') res += 1 elif tile[i][j] == '#': dfs(i, j, '#') res += 1 elif tile[i][j] == '*': dfs(i, j, '*') res += 1 print(res) index = 0 while True: datas = preDatasets() DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] N = int(datas[index].split(' ')[0]) M = int(datas[index].split(' ')[1]) tile = [[0 for i in range(N)]for j in range(M)] for i in range(len(tile)): tile[i] = list(datas[index+i+1]) if N == 0: break else: solve() index += N+1
Traceback (most recent call last): File "/tmp/tmpim4th42s/tmpioegb0ap.py", line 41, in <module> N = int(datas[index].split(' ')[0]) ~~~~~^^^^^^^ IndexError: list index out of range
s075700566
p00118
u284851373
1493353803
Python
Python3
py
Runtime Error
0
0
993
# -*- coding:utf-8 -*- import sys sys.setrecursionlimit(10000000) def preDatasets(): datas = sys.stdin.readlines() for i in range(len(datas)): datas[i] = datas[i].strip('\n') return datas def dfs(x, y, sym): tile[x][y] = '.' for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if(nx>=0 and nx<N and ny>=0 and ny<M and tile[nx][ny]==sym): dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): if not tile[i][j] == '.': if tile[i][j] == '@': dfs(i, j, '@') res += 1 elif tile[i][j] == '#': dfs(i, j, '#') res += 1 elif tile[i][j] == '*': dfs(i, j, '*') res += 1 print(res) index = 0 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] while True: datas = preDatasets() N = int(datas[index].split(' ')[0]) M = int(datas[index].split(' ')[1]) tile = [[0 for i in range(N)]for j in range(M)] for i in range(len(tile)): tile[i] = list(datas[index+i+1]) if N == 0: break else: solve() index += N+1
Traceback (most recent call last): File "/tmp/tmpehzc_py1/tmp_pzsxavc.py", line 42, in <module> N = int(datas[index].split(' ')[0]) ~~~~~^^^^^^^ IndexError: list index out of range
s273528107
p00118
u284851373
1493354047
Python
Python3
py
Runtime Error
0
0
979
# -*- coding:utf-8 -*- import sys sys.setrecursionlimit(10000000) def preDatasets(): datas = input() for i in range(len(datas)): datas[i] = datas[i].strip('\n') return datas def dfs(x, y, sym): tile[x][y] = '.' for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if(nx>=0 and nx<N and ny>=0 and ny<M and tile[nx][ny]==sym): dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): if not tile[i][j] == '.': if tile[i][j] == '@': dfs(i, j, '@') res += 1 elif tile[i][j] == '#': dfs(i, j, '#') res += 1 elif tile[i][j] == '*': dfs(i, j, '*') res += 1 print(res) index = 0 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] while True: datas = preDatasets() N = int(datas[index].split(' ')[0]) M = int(datas[index].split(' ')[1]) tile = [[0 for i in range(N)]for j in range(M)] for i in range(len(tile)): tile[i] = list(datas[index+i+1]) if N == 0: break else: solve() index += N+1
Traceback (most recent call last): File "/tmp/tmp9eceyc__/tmpexczqe5j.py", line 39, in <module> datas = preDatasets() ^^^^^^^^^^^^^ File "/tmp/tmp9eceyc__/tmpexczqe5j.py", line 6, in preDatasets datas = input() ^^^^^^^ EOFError: EOF when reading a line
s830627017
p00118
u284851373
1493354059
Python
Python3
py
Runtime Error
0
0
978
# -*- coding:utf-8 -*- import sys sys.setrecursionlimit(1000000) def preDatasets(): datas = input() for i in range(len(datas)): datas[i] = datas[i].strip('\n') return datas def dfs(x, y, sym): tile[x][y] = '.' for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if(nx>=0 and nx<N and ny>=0 and ny<M and tile[nx][ny]==sym): dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): if not tile[i][j] == '.': if tile[i][j] == '@': dfs(i, j, '@') res += 1 elif tile[i][j] == '#': dfs(i, j, '#') res += 1 elif tile[i][j] == '*': dfs(i, j, '*') res += 1 print(res) index = 0 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] while True: datas = preDatasets() N = int(datas[index].split(' ')[0]) M = int(datas[index].split(' ')[1]) tile = [[0 for i in range(N)]for j in range(M)] for i in range(len(tile)): tile[i] = list(datas[index+i+1]) if N == 0: break else: solve() index += N+1
Traceback (most recent call last): File "/tmp/tmp7uhl56d7/tmpuwdmt3d8.py", line 39, in <module> datas = preDatasets() ^^^^^^^^^^^^^ File "/tmp/tmp7uhl56d7/tmpuwdmt3d8.py", line 6, in preDatasets datas = input() ^^^^^^^ EOFError: EOF when reading a line
s489680143
p00118
u284851373
1493354098
Python
Python3
py
Runtime Error
0
0
976
# -*- coding:utf-8 -*- import sys sys.setrecursionlimit(1000000) def preDatasets(): datas = input() for i in range(len(datas)): datas[i] = datas[i].strip('\n') return datas def dfs(x, y, sym): tile[x][y] = '.' for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if nx>=0 and nx<N and ny>=0 and ny<M and tile[nx][ny]==sym: dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): if not tile[i][j] == '.': if tile[i][j] == '@': dfs(i, j, '@') res += 1 elif tile[i][j] == '#': dfs(i, j, '#') res += 1 elif tile[i][j] == '*': dfs(i, j, '*') res += 1 print(res) index = 0 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] while True: datas = preDatasets() N = int(datas[index].split(' ')[0]) M = int(datas[index].split(' ')[1]) tile = [[0 for i in range(N)]for j in range(M)] for i in range(len(tile)): tile[i] = list(datas[index+i+1]) if N == 0: break else: solve() index += N+1
Traceback (most recent call last): File "/tmp/tmpijlefi2a/tmp05v70903.py", line 39, in <module> datas = preDatasets() ^^^^^^^^^^^^^ File "/tmp/tmpijlefi2a/tmp05v70903.py", line 6, in preDatasets datas = input() ^^^^^^^ EOFError: EOF when reading a line
s833425412
p00118
u284851373
1493354114
Python
Python3
py
Runtime Error
0
0
953
import sys sys.setrecursionlimit(1000000) def preDatasets(): datas = input() for i in range(len(datas)): datas[i] = datas[i].strip('\n') return datas def dfs(x, y, sym): tile[x][y] = '.' for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if nx>=0 and nx<N and ny>=0 and ny<M and tile[nx][ny]==sym: dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): if not tile[i][j] == '.': if tile[i][j] == '@': dfs(i, j, '@') res += 1 elif tile[i][j] == '#': dfs(i, j, '#') res += 1 elif tile[i][j] == '*': dfs(i, j, '*') res += 1 print(res) index = 0 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] while True: datas = preDatasets() N = int(datas[index].split(' ')[0]) M = int(datas[index].split(' ')[1]) tile = [[0 for i in range(N)]for j in range(M)] for i in range(len(tile)): tile[i] = list(datas[index+i+1]) if N == 0: break else: solve() index += N+1
Traceback (most recent call last): File "/tmp/tmpwitwt8mx/tmpmg_xsf2o.py", line 38, in <module> datas = preDatasets() ^^^^^^^^^^^^^ File "/tmp/tmpwitwt8mx/tmpmg_xsf2o.py", line 5, in preDatasets datas = input() ^^^^^^^ EOFError: EOF when reading a line
s074034955
p00118
u284851373
1493355247
Python
Python3
py
Runtime Error
0
0
1043
# -*- coding:utf-8 -*- import sys sys.setrecursionlimit(1000000) def preDatasets(q): line = input() print(line) datas[q] = line return datas def dfs(x, y, sym): tile[x][y] = '.' for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if nx>=0 and nx<N and ny>=0 and ny<M and tile[nx][ny]==sym: dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): if not tile[i][j] == '.': if tile[i][j] == '@': dfs(i, j, '@') res += 1 elif tile[i][j] == '#': dfs(i, j, '#') res += 1 elif tile[i][j] == '*': dfs(i, j, '*') res += 1 print(res) index = 0 counter=0 datas = [[0 for i in range(1)]for j in range(1)] DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] while True: line = input() if ' ' in line: N = int(datas[index].split(' ')[0]) M = int(datas[index].split(' ')[1]) tile = [[0 for i in range(N)]for j in range(M)] if N == 0: break if not counter<=M: for i in range(len(tile)): tile[i] = list(datas[index+i+1]) solve() index += N+1 counter+=1
Traceback (most recent call last): File "/tmp/tmpt31uneph/tmp0b5ar6l_.py", line 41, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s557981532
p00118
u284851373
1493355865
Python
Python3
py
Runtime Error
0
0
866
# -*- coding:utf-8 -*- import sys sys.setrecursionlimit(1000000) def dfs(x, y, sym): tile[x][y] = '.' for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if nx>=0 and nx<N and ny>=0 and ny<M and tile[nx][ny]==sym: dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): if not tile[i][j] == '.': if tile[i][j] == '@': dfs(i, j, '@') res += 1 elif tile[i][j] == '#': dfs(i, j, '#') res += 1 elif tile[i][j] == '*': dfs(i, j, '*') res += 1 print(res) index = 0 counter=0 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] while True: counter+=1 line = input() if ' ' in line: N = int(line.split(' ')[0]) M = int(line.split(' ')[1]) tile = [[0 for i in range(N)]for j in range(M)] else: tile[counter-2] = list(line) if N == 0: break if counter-1==M: solve() counter = 0
Traceback (most recent call last): File "/tmp/tmpqk_m7aoy/tmp8zc498_h.py", line 35, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s282190541
p00118
u284851373
1493355908
Python
Python3
py
Runtime Error
0
0
865
# -*- coding:utf-8 -*- import sys sys.setrecursionlimit(100000) def dfs(x, y, sym): tile[x][y] = '.' for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if nx>=0 and nx<N and ny>=0 and ny<M and tile[nx][ny]==sym: dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): if not tile[i][j] == '.': if tile[i][j] == '@': dfs(i, j, '@') res += 1 elif tile[i][j] == '#': dfs(i, j, '#') res += 1 elif tile[i][j] == '*': dfs(i, j, '*') res += 1 print(res) index = 0 counter=0 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] while True: counter+=1 line = input() if ' ' in line: N = int(line.split(' ')[0]) M = int(line.split(' ')[1]) tile = [[0 for i in range(N)]for j in range(M)] else: tile[counter-2] = list(line) if N == 0: break if counter-1==M: solve() counter = 0
Traceback (most recent call last): File "/tmp/tmppo8xxq53/tmpa85tb8wm.py", line 35, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s652211314
p00118
u284851373
1493356532
Python
Python3
py
Runtime Error
0
0
874
# -*- coding:utf-8 -*- import sys sys.setrecursionlimit(1000000) def dfs(x, y, sym): tile[x][y] = '.' for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if nx>=0 and nx<N and ny>=0 and ny<M and tile[nx][ny]==sym: dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): if not tile[i][j] == '.': if tile[i][j] == '@': dfs(i, j, '@') res += 1 elif tile[i][j] == '#': dfs(i, j, '#') res += 1 elif tile[i][j] == '*': dfs(i, j, '*') res += 1 print(res) index = 0 counter=0 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] while True: counter+=1 line = input() if ' ' in line: N = int(line.split(' ')[0]) M = int(line.split(' ')[1]) tile = [[0 for i in range(N)]for j in range(M)] else: tile[counter-2] = list(line) if N==0 and M==0: break if counter-1==M: solve() counter = 0
Traceback (most recent call last): File "/tmp/tmppmgw8fyj/tmpwp8bp79k.py", line 36, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s529157817
p00118
u284851373
1493356540
Python
Python3
py
Runtime Error
0
0
851
import sys sys.setrecursionlimit(1000000) def dfs(x, y, sym): tile[x][y] = '.' for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if nx>=0 and nx<N and ny>=0 and ny<M and tile[nx][ny]==sym: dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): if not tile[i][j] == '.': if tile[i][j] == '@': dfs(i, j, '@') res += 1 elif tile[i][j] == '#': dfs(i, j, '#') res += 1 elif tile[i][j] == '*': dfs(i, j, '*') res += 1 print(res) index = 0 counter=0 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] while True: counter+=1 line = input() if ' ' in line: N = int(line.split(' ')[0]) M = int(line.split(' ')[1]) tile = [[0 for i in range(N)]for j in range(M)] else: tile[counter-2] = list(line) if N==0 and M==0: break if counter-1==M: solve() counter = 0
Traceback (most recent call last): File "/tmp/tmpts_nl228/tmp3hxv31pr.py", line 35, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s717952627
p00118
u284851373
1493356679
Python
Python3
py
Runtime Error
0
0
852
import sys sys.setrecursionlimit(10000000) def dfs(x, y, sym): tile[x][y] = '.' for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if nx>=0 and nx<N and ny>=0 and ny<M and tile[nx][ny]==sym: dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): if not tile[i][j] == '.': if tile[i][j] == '@': dfs(i, j, '@') res += 1 elif tile[i][j] == '#': dfs(i, j, '#') res += 1 elif tile[i][j] == '*': dfs(i, j, '*') res += 1 print(res) index = 0 counter=0 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] while True: counter+=1 line = input() if ' ' in line: N = int(line.split(' ')[0]) M = int(line.split(' ')[1]) tile = [[0 for i in range(N)]for j in range(M)] else: tile[counter-2] = list(line) if N==0 and M==0: break if counter-1==M: solve() counter = 0
Traceback (most recent call last): File "/tmp/tmplzylcvqx/tmpahos58k6.py", line 35, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s238784118
p00118
u284851373
1493356686
Python
Python3
py
Runtime Error
0
0
853
import sys sys.setrecursionlimit(100000000) def dfs(x, y, sym): tile[x][y] = '.' for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if nx>=0 and nx<N and ny>=0 and ny<M and tile[nx][ny]==sym: dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): if not tile[i][j] == '.': if tile[i][j] == '@': dfs(i, j, '@') res += 1 elif tile[i][j] == '#': dfs(i, j, '#') res += 1 elif tile[i][j] == '*': dfs(i, j, '*') res += 1 print(res) index = 0 counter=0 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] while True: counter+=1 line = input() if ' ' in line: N = int(line.split(' ')[0]) M = int(line.split(' ')[1]) tile = [[0 for i in range(N)]for j in range(M)] else: tile[counter-2] = list(line) if N==0 and M==0: break if counter-1==M: solve() counter = 0
Traceback (most recent call last): File "/tmp/tmpa3txrmsf/tmpyqae0rjv.py", line 35, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s763960044
p00118
u284851373
1493356691
Python
Python3
py
Runtime Error
0
0
854
import sys sys.setrecursionlimit(1000000000) def dfs(x, y, sym): tile[x][y] = '.' for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if nx>=0 and nx<N and ny>=0 and ny<M and tile[nx][ny]==sym: dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): if not tile[i][j] == '.': if tile[i][j] == '@': dfs(i, j, '@') res += 1 elif tile[i][j] == '#': dfs(i, j, '#') res += 1 elif tile[i][j] == '*': dfs(i, j, '*') res += 1 print(res) index = 0 counter=0 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] while True: counter+=1 line = input() if ' ' in line: N = int(line.split(' ')[0]) M = int(line.split(' ')[1]) tile = [[0 for i in range(N)]for j in range(M)] else: tile[counter-2] = list(line) if N==0 and M==0: break if counter-1==M: solve() counter = 0
Traceback (most recent call last): File "/tmp/tmpzhwrw0kb/tmp7bp8xqma.py", line 35, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s329311281
p00118
u284851373
1493356994
Python
Python3
py
Runtime Error
0
0
869
# -*- coding:utf-8 -*- import sys sys.setrecursionlimit(1000000) def dfs(x, y, sym): tile[x][y] = '.' for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if nx>=0 and nx<N and ny>=0 and ny<M and tile[nx][ny]==sym: dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): if not tile[i][j] == '.': if tile[i][j] == '@': dfs(i, j, '@') res += 1 elif tile[i][j] == '#': dfs(i, j, '#') res += 1 elif tile[i][j] == '*': dfs(i, j, '*') res += 1 print(res) index = 0 counter=0 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] while True: counter+=1 line = input() if ' ' in line: N = int(line.split(' ')[0]) M = int(line.split(' ')[1]) tile = [[0 for i in range(N)]for j in range(M)] else: tile[counter-2] = list(line) if N==0 and M==0: break if counter-1==M: solve() counter = 0
Traceback (most recent call last): File "/tmp/tmpin670pbe/tmphbti_doq.py", line 35, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s667472085
p00118
u284851373
1493357012
Python
Python3
py
Runtime Error
0
0
846
import sys sys.setrecursionlimit(1000000) def dfs(x, y, sym): tile[x][y] = '.' for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if nx>=0 and nx<N and ny>=0 and ny<M and tile[nx][ny]==sym: dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): if not tile[i][j] == '.': if tile[i][j] == '@': dfs(i, j, '@') res += 1 elif tile[i][j] == '#': dfs(i, j, '#') res += 1 elif tile[i][j] == '*': dfs(i, j, '*') res += 1 print(res) index = 0 counter=0 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] while True: counter+=1 line = input() if ' ' in line: N = int(line.split(' ')[0]) M = int(line.split(' ')[1]) tile = [[0 for i in range(N)]for j in range(M)] else: tile[counter-2] = list(line) if N==0 and M==0: break if counter-1==M: solve() counter = 0
Traceback (most recent call last): File "/tmp/tmpltnqe4n3/tmp5fc5rkoq.py", line 34, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s836370163
p00118
u284851373
1493357277
Python
Python3
py
Runtime Error
0
0
846
import sys sys.setrecursionlimit(1000000) def dfs(x, y, sym): tile[x][y] = '.' for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if nx>=0 and nx<N and ny>=0 and ny<M and tile[nx][ny]==sym: dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): if not tile[i][j] == '.': if tile[i][j] == '@': dfs(i, j, '@') res += 1 elif tile[i][j] == '#': dfs(i, j, '#') res += 1 elif tile[i][j] == '*': dfs(i, j, '*') res += 1 print(res) index = 0 counter=0 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] while True: counter+=1 line = input() if ' ' in line: N = int(line.split(' ')[0]) M = int(line.split(' ')[1]) tile = [[0 for i in range(N)]for j in range(M)] else: tile[counter-2] = list(line) if N==0 and M==0: break if counter-1==M: solve() counter = 0
Traceback (most recent call last): File "/tmp/tmpme3x7fdc/tmpxt4i11yf.py", line 34, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s126024851
p00118
u284851373
1493357322
Python
Python3
py
Runtime Error
0
0
869
# -*- coding:utf-8 -*- import sys sys.setrecursionlimit(1000000) def dfs(x, y, sym): tile[x][y] = '.' for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if nx>=0 and nx<N and ny>=0 and ny<M and tile[nx][ny]==sym: dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): if not tile[i][j] == '.': if tile[i][j] == '@': dfs(i, j, '@') res += 1 elif tile[i][j] == '#': dfs(i, j, '#') res += 1 elif tile[i][j] == '*': dfs(i, j, '*') res += 1 print(res) index = 0 counter=0 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] while True: counter+=1 line = input() if ' ' in line: N = int(line.split(' ')[0]) M = int(line.split(' ')[1]) tile = [[0 for i in range(N)]for j in range(M)] else: tile[counter-2] = list(line) if N==0 and M==0: break if counter-1==M: solve() counter = 0
Traceback (most recent call last): File "/tmp/tmpcdsq91gz/tmpuprbqlry.py", line 35, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s224220259
p00118
u284851373
1493364020
Python
Python3
py
Runtime Error
0
0
885
# -*- coding:utf-8 -*- import sys sys.setrecursionlimit(1000000) def dfs(x, y, sym): tile[x][y] = '.' for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if nx>=0 and nx<N and ny>=0 and ny<M and tile[nx][ny]==sym: dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): if not tile[i][j] == '.': if tile[i][j] == '@': dfs(i, j, '@') res += 1 elif tile[i][j] == '#': dfs(i, j, '#') res += 1 elif tile[i][j] == '*': dfs(i, j, '*') res += 1 return res res=0 counter=0 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] while True: counter+=1 line = input() if ' ' in line: N = int(line.split(' ')[0]) M = int(line.split(' ')[1]) tile = [[0 for i in range(N)]for j in range(M)] else: tile[counter-2] = list(line) if N==0 and M==0: break if counter-1==M: res = solve() counter = 0 print(res)
Traceback (most recent call last): File "/tmp/tmpovg2ujjt/tmp20qfeckv.py", line 35, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s719223417
p00118
u284851373
1493364733
Python
Python3
py
Runtime Error
0
0
890
# -*- coding:utf-8 -*- import sys sys.setrecursionlimit(1000000) def dfs(x, y, sym): tile[x][y] = '.' for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if nx>=0 and nx<N and ny>=0 and ny<M and tile[nx][ny]==sym: dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): if not tile[i][j] == '.': if tile[i][j] == '@': dfs(i, j, '@') res += 1 elif tile[i][j] == '#': dfs(i, j, '#') res += 1 elif tile[i][j] == '*': dfs(i, j, '*') res += 1 return res res=0 counter=0 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] while True: counter+=1 line = input() if ' ' in line: nums = line.split(' ') N = int(nums[0]) M = int(nums[1]) tile = [[0 for i in range(N)]for j in range(M)] else: tile[counter-2] = list(line) if N==0 and M==0: break if (counter-1)==M: res = solve() counter = 0 print(res)
Traceback (most recent call last): File "/tmp/tmp0mfjnmip/tmpft69oa2j.py", line 35, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s440380822
p00118
u284851373
1493364865
Python
Python3
py
Runtime Error
0
0
921
# -*- coding:utf-8 -*- import sys sys.setrecursionlimit(1000000) def dfs(x, y, sym): tile[x][y] = '.' for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if nx>=0 and nx<N and ny>=0 and ny<M and tile[nx][ny]==sym: dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): if not tile[i][j] == '.': if tile[i][j] == '@': dfs(i, j, '@') res += 1 elif tile[i][j] == '#': dfs(i, j, '#') res += 1 elif tile[i][j] == '*': dfs(i, j, '*') res += 1 return res res=0 counter=0 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] while True: counter+=1 line = input() if ' ' in line: nums = line.split(' ') N = int(nums[0]) M = int(nums[1]) tile = [[0 for i in range(N)]for j in range(M)] else: tile[counter-2] = list(line) if N==0 and M==0: break if (counter-1)==M: res = solve() counter = 0 print(res)
File "/tmp/tmp555enu0j/tmpdxuvj3kt.py", line 9 ny = y + DY[i] TabError: inconsistent use of tabs and spaces in indentation
s906244117
p00118
u284851373
1493365725
Python
Python3
py
Runtime Error
0
0
908
# -*- coding:utf-8 -*- import sys sys.setrecursionlimit(1000000) def dfs(x, y, sym): tile[x][y] = '.' for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if nx>=0 and nx<N and ny>=0 and ny<M and tile[nx][ny]==sym: dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): if not tile[i][j] == '.': if tile[i][j] == '@': dfs(i, j, '@') res += 1 elif tile[i][j] == '#': dfs(i, j, '#') res += 1 elif tile[i][j] == '*': dfs(i, j, '*') res += 1 return res res=0 counter=0 N=-1 M=-1 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] while True: counter+=1 line = input() if ' ' in line: nums = line.split(' ') N = int(nums[0]) M = int(nums[1]) tile = [[0 for i in range(N)]for j in range(M)] else: tile[counter-2] = list(line) if (counter-1)==M and M!=0: res = solve() counter = 0 print(res) if N==0 and M==0: break
Traceback (most recent call last): File "/tmp/tmp6q2x2idw/tmp6tpow5wz.py", line 37, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s451740147
p00118
u284851373
1493365943
Python
Python3
py
Runtime Error
0
0
901
# -*- coding:utf-8 -*- import sys sys.setrecursionlimit(1000000) def dfs(x, y, sym): tile[x][y] = '.' for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if nx>=0 and nx<N and ny>=0 and ny<M and tile[nx][ny]==sym: dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): if not tile[i][j] == '.': if tile[i][j] == '@': dfs(i, j, '@') res += 1 elif tile[i][j] == '#': dfs(i, j, '#') res += 1 elif tile[i][j] == '*': dfs(i, j, '*') res += 1 return res res=0 counter=0 N=-1 M=-1 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] while True: counter+=1 line = input() if ' ' in line: nums = line.split(' ') N = int(nums[0]) M = int(nums[1]) tile = [[0 for i in range(N)]for j in range(M)] if N==0 and M==0: break else: tile[counter-2] = list(line) if (counter-1)==M: res = solve() counter = 0 print(res)
Traceback (most recent call last): File "/tmp/tmpjil8kam4/tmpiq9tdcd6.py", line 37, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s989840761
p00118
u284851373
1493377023
Python
Python3
py
Runtime Error
0
0
1041
# -*- coding:utf-8 -*- import sys sys.setrecursionlimit(10000) def preDatasets(q): line = input() print(line) datas[q] = line return datas def dfs(x, y, sym): tile[x][y] = '.' for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if nx>=0 and nx<N and ny>=0 and ny<M and tile[nx][ny]==sym: dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): if not tile[i][j] == '.': if tile[i][j] == '@': dfs(i, j, '@') res += 1 elif tile[i][j] == '#': dfs(i, j, '#') res += 1 elif tile[i][j] == '*': dfs(i, j, '*') res += 1 print(res) index = 0 counter=0 datas = [[0 for i in range(1)]for j in range(1)] DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] while True: line = input() if ' ' in line: N = int(datas[index].split(' ')[0]) M = int(datas[index].split(' ')[1]) tile = [[0 for i in range(N)]for j in range(M)] if N == 0: break if not counter<=M: for i in range(len(tile)): tile[i] = list(datas[index+i+1]) solve() index += N+1 counter+=1
Traceback (most recent call last): File "/tmp/tmpsypmornv/tmpan3ixb8x.py", line 41, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s275917829
p00118
u284851373
1493377030
Python
Python3
py
Runtime Error
0
0
1042
# -*- coding:utf-8 -*- import sys sys.setrecursionlimit(100000) def preDatasets(q): line = input() print(line) datas[q] = line return datas def dfs(x, y, sym): tile[x][y] = '.' for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if nx>=0 and nx<N and ny>=0 and ny<M and tile[nx][ny]==sym: dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): if not tile[i][j] == '.': if tile[i][j] == '@': dfs(i, j, '@') res += 1 elif tile[i][j] == '#': dfs(i, j, '#') res += 1 elif tile[i][j] == '*': dfs(i, j, '*') res += 1 print(res) index = 0 counter=0 datas = [[0 for i in range(1)]for j in range(1)] DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] while True: line = input() if ' ' in line: N = int(datas[index].split(' ')[0]) M = int(datas[index].split(' ')[1]) tile = [[0 for i in range(N)]for j in range(M)] if N == 0: break if not counter<=M: for i in range(len(tile)): tile[i] = list(datas[index+i+1]) solve() index += N+1 counter+=1
Traceback (most recent call last): File "/tmp/tmpy7v928bj/tmpktkha_td.py", line 41, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s120248550
p00118
u284851373
1493377051
Python
Python3
py
Runtime Error
0
0
891
# -*- coding:utf-8 -*- import sys sys.setrecursionlimit(1000000) def dfs(x, y, sym): tile[x][y] = '.' for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if nx>=0 and nx<N and ny>=0 and ny<M and tile[nx][ny]==sym: dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): if not tile[i][j] == '.': if tile[i][j] == '@': dfs(i, j, '@') res += 1 elif tile[i][j] == '#': dfs(i, j, '#') res += 1 elif tile[i][j] == '*': dfs(i, j, '*') res += 1 return res res=0 counter=0 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] while True: counter+=1 line = input() if ' ' in line: nums = line.split(' ') N = int(nums[0]) M = int(nums[1]) tile = [[0 for i in range(N)]for j in range(M)] if N==0 and M==0: break else: tile[counter-2] = list(line) if (counter-1)==M: res = solve() counter = 0 print(res)
Traceback (most recent call last): File "/tmp/tmpqe9gcsa8/tmphnbs_nzg.py", line 35, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s920379870
p00118
u284851373
1493377060
Python
Python3
py
Runtime Error
0
0
890
# -*- coding:utf-8 -*- import sys sys.setrecursionlimit(100000) def dfs(x, y, sym): tile[x][y] = '.' for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if nx>=0 and nx<N and ny>=0 and ny<M and tile[nx][ny]==sym: dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): if not tile[i][j] == '.': if tile[i][j] == '@': dfs(i, j, '@') res += 1 elif tile[i][j] == '#': dfs(i, j, '#') res += 1 elif tile[i][j] == '*': dfs(i, j, '*') res += 1 return res res=0 counter=0 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] while True: counter+=1 line = input() if ' ' in line: nums = line.split(' ') N = int(nums[0]) M = int(nums[1]) tile = [[0 for i in range(N)]for j in range(M)] if N==0 and M==0: break else: tile[counter-2] = list(line) if (counter-1)==M: res = solve() counter = 0 print(res)
Traceback (most recent call last): File "/tmp/tmpnn0639ul/tmpf46lck6a.py", line 35, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s223419124
p00118
u284851373
1493377068
Python
Python3
py
Runtime Error
0
0
892
# -*- coding:utf-8 -*- import sys sys.setrecursionlimit(10000000) def dfs(x, y, sym): tile[x][y] = '.' for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if nx>=0 and nx<N and ny>=0 and ny<M and tile[nx][ny]==sym: dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): if not tile[i][j] == '.': if tile[i][j] == '@': dfs(i, j, '@') res += 1 elif tile[i][j] == '#': dfs(i, j, '#') res += 1 elif tile[i][j] == '*': dfs(i, j, '*') res += 1 return res res=0 counter=0 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] while True: counter+=1 line = input() if ' ' in line: nums = line.split(' ') N = int(nums[0]) M = int(nums[1]) tile = [[0 for i in range(N)]for j in range(M)] if N==0 and M==0: break else: tile[counter-2] = list(line) if (counter-1)==M: res = solve() counter = 0 print(res)
Traceback (most recent call last): File "/tmp/tmp4r_y8pcg/tmp0wtxt4ly.py", line 35, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s791601386
p00118
u284851373
1493377075
Python
Python3
py
Runtime Error
0
0
893
# -*- coding:utf-8 -*- import sys sys.setrecursionlimit(100000000) def dfs(x, y, sym): tile[x][y] = '.' for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if nx>=0 and nx<N and ny>=0 and ny<M and tile[nx][ny]==sym: dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): if not tile[i][j] == '.': if tile[i][j] == '@': dfs(i, j, '@') res += 1 elif tile[i][j] == '#': dfs(i, j, '#') res += 1 elif tile[i][j] == '*': dfs(i, j, '*') res += 1 return res res=0 counter=0 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] while True: counter+=1 line = input() if ' ' in line: nums = line.split(' ') N = int(nums[0]) M = int(nums[1]) tile = [[0 for i in range(N)]for j in range(M)] if N==0 and M==0: break else: tile[counter-2] = list(line) if (counter-1)==M: res = solve() counter = 0 print(res)
Traceback (most recent call last): File "/tmp/tmp4rls4pw2/tmpb4txitka.py", line 35, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s052220987
p00118
u284851373
1493377081
Python
Python3
py
Runtime Error
0
0
894
# -*- coding:utf-8 -*- import sys sys.setrecursionlimit(1000000000) def dfs(x, y, sym): tile[x][y] = '.' for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if nx>=0 and nx<N and ny>=0 and ny<M and tile[nx][ny]==sym: dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): if not tile[i][j] == '.': if tile[i][j] == '@': dfs(i, j, '@') res += 1 elif tile[i][j] == '#': dfs(i, j, '#') res += 1 elif tile[i][j] == '*': dfs(i, j, '*') res += 1 return res res=0 counter=0 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] while True: counter+=1 line = input() if ' ' in line: nums = line.split(' ') N = int(nums[0]) M = int(nums[1]) tile = [[0 for i in range(N)]for j in range(M)] if N==0 and M==0: break else: tile[counter-2] = list(line) if (counter-1)==M: res = solve() counter = 0 print(res)
Traceback (most recent call last): File "/tmp/tmp0ff_8u4u/tmpetingsgj.py", line 35, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s474773864
p00118
u284851373
1493379971
Python
Python3
py
Runtime Error
0
0
864
import sys sys.setrecursionlimit(1000000) def dfs(x, y, sym): tile[x][y] = '.' for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if nx>=0 and nx<N and ny>=0 and ny<M and tile[nx][ny]==sym: dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): if tile[i][j] != '.': if tile[i][j] == '@': dfs(i, j, '@') res += 1 elif tile[i][j] == '#': dfs(i, j, '#') res += 1 elif tile[i][j] == '*': dfs(i, j, '*') res += 1 return res res=0 counter=0 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] while True: counter+=1 line = input() if ' ' in line: nums = line.split(' ') N = int(nums[0]) M = int(nums[1]) tile = [[0 for i in range(N)]for j in range(M)] if N==0 and M==0: break else: tile[counter-2] = list(line) if (counter-1)==M: res = solve() counter = 0 print(res)
Traceback (most recent call last): File "/tmp/tmp95gez2tn/tmp_refqe4z.py", line 34, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s599358554
p00118
u284851373
1493380569
Python
Python3
py
Runtime Error
0
0
887
# -*- coding:utf-8 -*- import sys sys.setrecursionlimit(1000000) def dfs(x, y, sym): tile[x][y] = "." for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if nx>=0 and nx<N and ny>=0 and ny<M and tile[nx][ny]==sym: dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): if tile[i][j] != ".": if tile[i][j] == "@": dfs(i, j, "@") res += 1 elif tile[i][j] == "#": dfs(i, j, "#") res += 1 elif tile[i][j] == "*": dfs(i, j, "*") res += 1 return res res=0 counter=0 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] while True: counter+=1 line = input() if ' ' in line: nums = line.split(" ") N = int(nums[0]) M = int(nums[1]) tile = [[0 for i in range(N)]for j in range(M)] if N==0 and M==0: break else: tile[counter-2] = list(line) if (counter-1)==M: res = solve() counter = 0 print(res)
Traceback (most recent call last): File "/tmp/tmp_q02zo8o/tmpot4k2yao.py", line 35, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s632590658
p00118
u284851373
1493380638
Python
Python3
py
Runtime Error
0
0
861
# -*- coding:utf-8 -*- import sys sys.setrecursionlimit(1000000) def dfs(x, y, sym): tile[x][y] = "." for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if nx>=0 and nx<N and ny>=0 and ny<M and tile[nx][ny]==sym: dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): if tile[i][j] != ".": if tile[i][j] == "@": dfs(i, j, "@") res += 1 elif tile[i][j] == "#": dfs(i, j, "#") res += 1 elif tile[i][j] == "*": dfs(i, j, "*") res += 1 print(res) counter=0 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] while True: counter+=1 line = input() if ' ' in line: nums = line.split(" ") N = int(nums[0]) M = int(nums[1]) tile = [[0 for i in range(N)]for j in range(M)] if N==0 and M==0: break else: tile[counter-2] = list(line) if (counter-1)==M: solve() counter = 0
Traceback (most recent call last): File "/tmp/tmpugarchl9/tmpvyojbttg.py", line 34, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s230938620
p00118
u284851373
1493380677
Python
Python3
py
Runtime Error
0
0
861
# -*- coding:utf-8 -*- import sys def dfs(x, y, sym): tile[x][y] = "." for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if nx>=0 and nx<N and ny>=0 and ny<M and tile[nx][ny]==sym: dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): if tile[i][j] != ".": if tile[i][j] == "@": dfs(i, j, "@") res += 1 elif tile[i][j] == "#": dfs(i, j, "#") res += 1 elif tile[i][j] == "*": dfs(i, j, "*") res += 1 print(res) counter=0 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] sys.setrecursionlimit(1000000) while True: counter+=1 line = input() if ' ' in line: nums = line.split(" ") N = int(nums[0]) M = int(nums[1]) tile = [[0 for i in range(N)]for j in range(M)] if N==0 and M==0: break else: tile[counter-2] = list(line) if (counter-1)==M: solve() counter = 0
Traceback (most recent call last): File "/tmp/tmp0c1jd2fz/tmpdga3pt5j.py", line 35, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s500538582
p00118
u284851373
1493380864
Python
Python3
py
Runtime Error
0
0
860
# -*- coding:utf-8 -*- import sys def dfs(x, y, sym): tile[x][y] = "." for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if nx>=0 and nx<N and ny>=0 and ny<M and tile[nx][ny]==sym: dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): if tile[i][j] != ".": if tile[i][j] == "@": dfs(i, j, "@") res += 1 elif tile[i][j] == "#": dfs(i, j, "#") res += 1 elif tile[i][j] == "*": dfs(i, j, "*") res += 1 print(res) counter=0 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] sys.setrecursionlimit(1000000) while True: counter+=1 line = input() if ' ' in line: nums = line.split(" ") N = int(nums[0]) M = int(nums[1]) tile = [[0 for i in range(N)] for j in range(M)] if N==0 and M==0: break else: tile[counter-2] = list(line) if (counter-1)==M: solve() counter = 0
Traceback (most recent call last): File "/tmp/tmp58l0kusq/tmpyrmsew58.py", line 35, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s882919592
p00118
u284851373
1493380929
Python
Python3
py
Runtime Error
0
0
908
# -*- coding:utf-8 -*- import sys def dfs(x, y, sym): tile[x][y] = "." for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if nx>=0 and nx<N and ny>=0 and ny<M and tile[nx][ny]==sym: dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): if tile[i][j] != ".": if tile[i][j] == "@": dfs(i, j, "@") res += 1 elif tile[i][j] == "#": dfs(i, j, "#") res += 1 elif tile[i][j] == "*": dfs(i, j, "*") res += 1 print(res) counter=0 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] sys.setrecursionlimit(1000000) tile = [[0 for i in range(1)] for j in range(1)] while True: counter+=1 line = input() if ' ' in line: nums = line.split(" ") N = int(nums[0]) M = int(nums[1]) tile = [[0 for i in range(N)] for j in range(M)] if N==0 and M==0: break else: tile[counter-2] = list(line) if (counter-1)==M: solve() counter = 0
Traceback (most recent call last): File "/tmp/tmp9gdkf72j/tmpmhy4wj1w.py", line 35, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s609385909
p00118
u284851373
1493381149
Python
Python3
py
Runtime Error
0
0
808
# -*- coding:utf-8 -*- import sys def dfs(x, y, sym): tile[x][y] = "." for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if nx>=0 and nx<N and ny>=0 and ny<M and tile[nx][ny]==sym: dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): sym = tile[i][j] if tile[i][j] != ".": if tile[i][j] == sym: dfs(i, j, sym) res += 1 print(res) counter=0 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] sys.setrecursionlimit(1000000) tile = [[0 for i in range(1)] for j in range(1)] while True: counter+=1 line = input() if ' ' in line: nums = line.split(" ") N = int(nums[0]) M = int(nums[1]) tile = [[0 for i in range(N)] for j in range(M)] if N is 0 and M is 0: break else: tile[counter-2] = list(line) if (counter-1)==M: solve() counter = 0
/tmp/tmptdst8qt6/tmp7hsz29a3.py:36: SyntaxWarning: "is" with a literal. Did you mean "=="? if N is 0 and M is 0: /tmp/tmptdst8qt6/tmp7hsz29a3.py:36: SyntaxWarning: "is" with a literal. Did you mean "=="? if N is 0 and M is 0: Traceback (most recent call last): File "/tmp/tmptdst8qt6/tmp7hsz29a3.py", line 30, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s354316486
p00118
u284851373
1493381185
Python
Python3
py
Runtime Error
0
0
810
# -*- coding:utf-8 -*- import sys def dfs(x, y, sym): tile[x][y] = "." for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if nx>=0 and nx<N and ny>=0 and ny<M and tile[nx][ny] is sym: dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): sym = tile[i][j] if tile[i][j] != ".": if tile[i][j] is sym: dfs(i, j, sym) res += 1 print(res) counter=0 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] sys.setrecursionlimit(1000000) tile = [[0 for i in range(1)] for j in range(1)] while True: counter+=1 line = input() if ' ' in line: nums = line.split(" ") N = int(nums[0]) M = int(nums[1]) tile = [[0 for i in range(N)] for j in range(M)] if N is 0 and M is 0: break else: tile[counter-2] = list(line) if (counter-1)==M: solve() counter = 0
/tmp/tmpvj2rzuox/tmp42etpcku.py:36: SyntaxWarning: "is" with a literal. Did you mean "=="? if N is 0 and M is 0: /tmp/tmpvj2rzuox/tmp42etpcku.py:36: SyntaxWarning: "is" with a literal. Did you mean "=="? if N is 0 and M is 0: Traceback (most recent call last): File "/tmp/tmpvj2rzuox/tmp42etpcku.py", line 30, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s940632651
p00118
u284851373
1493381249
Python
Python3
py
Runtime Error
0
0
806
# -*- coding:utf-8 -*- import sys def dfs(x, y, sym): tile[x][y] = "." for i in range(0,4): nx = x + DX[i] ny = y + DY[i] if nx>=0 and nx<N and ny>=0 and ny<M and tile[nx][ny] is sym: dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): sym = tile[i][j] if tile[i][j] != ".": if tile[i][j] is sym: dfs(i, j, sym) res += 1 print(res) counter=0 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] sys.setrecursionlimit(1000000) tile = [[0 for i in range(1)] for j in range(1)] while True: counter+=1 line = input() if ' ' in line: nums = line.split(" ") N = int(nums[0]) M = int(nums[1]) tile = [[0 for i in range(N)] for j in range(M)] if N is 0 and M is 0: break else: tile[counter-2] = list(line) if (counter-1)==M: solve() counter = 0
/tmp/tmphu3w7rdu/tmp4np7ajah.py:36: SyntaxWarning: "is" with a literal. Did you mean "=="? if N is 0 and M is 0: /tmp/tmphu3w7rdu/tmp4np7ajah.py:36: SyntaxWarning: "is" with a literal. Did you mean "=="? if N is 0 and M is 0: Traceback (most recent call last): File "/tmp/tmphu3w7rdu/tmp4np7ajah.py", line 30, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s451541061
p00118
u284851373
1493381358
Python
Python3
py
Runtime Error
0
0
810
# -*- coding:utf-8 -*- import sys def dfs(x, y, sym): tile[x][y] = "." for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if 0<=nx and nx<N and 0<=ny and ny<M and tile[nx][ny] is sym: dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): sym = tile[i][j] if tile[i][j] != ".": if tile[i][j] is sym: dfs(i, j, sym) res += 1 print(res) counter=0 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] sys.setrecursionlimit(1000000) tile = [[0 for i in range(1)] for j in range(1)] while True: counter+=1 line = input() if ' ' in line: nums = line.split(" ") N = int(nums[0]) M = int(nums[1]) tile = [[0 for i in range(N)] for j in range(M)] if N is 0 and M is 0: break else: tile[counter-2] = list(line) if (counter-1)==M: solve() counter = 0
/tmp/tmp9uc6l82n/tmpk759k960.py:36: SyntaxWarning: "is" with a literal. Did you mean "=="? if N is 0 and M is 0: /tmp/tmp9uc6l82n/tmpk759k960.py:36: SyntaxWarning: "is" with a literal. Did you mean "=="? if N is 0 and M is 0: Traceback (most recent call last): File "/tmp/tmp9uc6l82n/tmpk759k960.py", line 30, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s538858804
p00118
u284851373
1493381397
Python
Python3
py
Runtime Error
0
0
786
import sys def dfs(x, y, sym): tile[x][y] = "." for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if 0<=nx and nx<N and 0<=ny and ny<M and tile[nx][ny] is sym: dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): sym = tile[i][j] if tile[i][j] != ".": if tile[i][j] is sym: dfs(i, j, sym) res += 1 print(res) counter=0 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] sys.setrecursionlimit(1000000) tile = [[0 for i in range(1)] for j in range(1)] while True: counter+=1 line = input() if ' ' in line: nums = line.split(" ") N = int(nums[0]) M = int(nums[1]) tile = [[0 for i in range(N)] for j in range(M)] if N is 0 and M is 0: break else: tile[counter-2] = list(line) if (counter-1)==M: solve() counter = 0
/tmp/tmpr8yh3q6j/tmpfa0ngp65.py:34: SyntaxWarning: "is" with a literal. Did you mean "=="? if N is 0 and M is 0: /tmp/tmpr8yh3q6j/tmpfa0ngp65.py:34: SyntaxWarning: "is" with a literal. Did you mean "=="? if N is 0 and M is 0: Traceback (most recent call last): File "/tmp/tmpr8yh3q6j/tmpfa0ngp65.py", line 28, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s954808043
p00118
u284851373
1493381449
Python
Python3
py
Runtime Error
0
0
811
# -*- coding:utf-8 -*- import sys def dfs(x, y, sym): tile[x][y] = "." for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if 0<=nx and nx<N and 0<=ny and ny<M and tile[nx][ny] is sym: dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): sym = tile[i][j] if tile[i][j] != ".": if tile[i][j] is sym: dfs(i, j, sym) res += 1 print(res) counter=0 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] sys.setrecursionlimit(10000000) tile = [[0 for i in range(1)] for j in range(1)] while True: counter+=1 line = input() if ' ' in line: nums = line.split(" ") N = int(nums[0]) M = int(nums[1]) tile = [[0 for i in range(N)] for j in range(M)] if N is 0 and M is 0: break else: tile[counter-2] = list(line) if (counter-1)==M: solve() counter = 0
/tmp/tmpbjp8jkq1/tmpw86myy4w.py:36: SyntaxWarning: "is" with a literal. Did you mean "=="? if N is 0 and M is 0: /tmp/tmpbjp8jkq1/tmpw86myy4w.py:36: SyntaxWarning: "is" with a literal. Did you mean "=="? if N is 0 and M is 0: Traceback (most recent call last): File "/tmp/tmpbjp8jkq1/tmpw86myy4w.py", line 30, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s467394555
p00118
u284851373
1493382062
Python
Python3
py
Runtime Error
0
0
823
# -*- coding:utf-8 -*- import sys print("hi") def dfs(x, y, sym): tile[x][y] = "." for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if 0<=nx and nx<N and 0<=ny and ny<M and tile[nx][ny] is sym: dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): sym = tile[i][j] if tile[i][j] != ".": if tile[i][j] is sym: dfs(i, j, sym) res += 1 print(res) counter=0 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] sys.setrecursionlimit(10000000) tile = [[0 for i in range(1)] for j in range(1)] while True: counter+=1 line = input() if ' ' in line: nums = line.split(" ") N = int(nums[0]) M = int(nums[1]) tile = [[0 for i in range(N)] for j in range(M)] if N is 0 and M is 0: break else: tile[counter-2] = list(line) if (counter-1)==M: solve() counter = 0
/tmp/tmp5fmpvxvk/tmp117q_wfi.py:37: SyntaxWarning: "is" with a literal. Did you mean "=="? if N is 0 and M is 0: /tmp/tmp5fmpvxvk/tmp117q_wfi.py:37: SyntaxWarning: "is" with a literal. Did you mean "=="? if N is 0 and M is 0: Traceback (most recent call last): File "/tmp/tmp5fmpvxvk/tmp117q_wfi.py", line 31, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
hi
s432496123
p00118
u284851373
1493382079
Python
Python3
py
Runtime Error
0
0
789
#import sys def dfs(x, y, sym): tile[x][y] = "." for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if 0<=nx and nx<N and 0<=ny and ny<M and tile[nx][ny] is sym: dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): sym = tile[i][j] if tile[i][j] != ".": if tile[i][j] is sym: dfs(i, j, sym) res += 1 print(res) counter=0 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] sys.setrecursionlimit(10000000) tile = [[0 for i in range(1)] for j in range(1)] while True: counter+=1 line = input() if ' ' in line: nums = line.split(" ") N = int(nums[0]) M = int(nums[1]) tile = [[0 for i in range(N)] for j in range(M)] if N is 0 and M is 0: break else: tile[counter-2] = list(line) if (counter-1)==M: solve() counter = 0
/tmp/tmp7wxkz_x2/tmpt7_gktai.py:35: SyntaxWarning: "is" with a literal. Did you mean "=="? if N is 0 and M is 0: /tmp/tmp7wxkz_x2/tmpt7_gktai.py:35: SyntaxWarning: "is" with a literal. Did you mean "=="? if N is 0 and M is 0: Traceback (most recent call last): File "/tmp/tmp7wxkz_x2/tmpt7_gktai.py", line 25, in <module> sys.setrecursionlimit(10000000) ^^^ NameError: name 'sys' is not defined
s472950882
p00118
u284851373
1493382118
Python
Python3
py
Runtime Error
0
0
797
import sys def dfs(x, y, sym): tile[x][y] = "." for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if 0<=nx and nx<N and 0<=ny and ny<M and tile[nx][ny] is sym: dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): sym = tile[i][j] if tile[i][j] != ".": if tile[i][j] is sym: dfs(i, j, sym) res += 1 print(res) counter=0 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] tile = [[0 for i in range(1)] for j in range(1)] while True: sys.setrecursionlimit(10000000) counter+=1 line = input() if ' ' in line: nums = line.split(" ") N = int(nums[0]) M = int(nums[1]) tile = [[0 for i in range(N)] for j in range(M)] if N is 0 and M is 0: break else: tile[counter-2] = list(line) if (counter-1)==M: solve() counter = 0
File "/tmp/tmppzyjh2bs/tmp6i69pzed.py", line 29 counter+=1 TabError: inconsistent use of tabs and spaces in indentation
s778233940
p00118
u284851373
1493382166
Python
Python3
py
Runtime Error
0
0
740
import sys def dfs(x, y, sym): tile[x][y] = "." for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if 0<=nx and nx<N and 0<=ny and ny<M and tile[nx][ny] is sym: dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): sym = tile[i][j] if tile[i][j] != ".": if tile[i][j] is sym: dfs(i, j, sym) res += 1 print(res) counter=0 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] sys.setrecursionlimit(10000000) while True: counter+=1 line = input() if ' ' in line: nums = line.split(" ") N = int(nums[0]) M = int(nums[1]) tile = [[0 for i in range(N)] for j in range(M)] if N is 0 and M is 0: break else: tile[counter-2] = list(line) if (counter-1)==M: solve() counter = 0
/tmp/tmprf4efbr0/tmpf55gafpp.py:35: SyntaxWarning: "is" with a literal. Did you mean "=="? if N is 0 and M is 0: /tmp/tmprf4efbr0/tmpf55gafpp.py:35: SyntaxWarning: "is" with a literal. Did you mean "=="? if N is 0 and M is 0: Traceback (most recent call last): File "/tmp/tmprf4efbr0/tmpf55gafpp.py", line 29, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s089512826
p00118
u284851373
1493382346
Python
Python3
py
Runtime Error
0
0
762
# -*- coding:utf-8 -*- import sys def dfs(x, y, sym): tile[x][y] = "." for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if 0<=nx and nx<N and 0<=ny and ny<M and tile[nx][ny] is sym: dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): sym = tile[i][j] if tile[i][j] != ".": if tile[i][j] is sym: dfs(i, j, sym) res += 1 print(res) counter=0 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] sys.setrecursionlimit(10000000) while True: counter+=1 line = input() if ' ' in line: nums = line.split(" ") N = int(nums[0]) M = int(nums[1]) tile = [[0 for i in range(N)] for j in range(M)] if N is 0 and M is 0: break else: tile[counter-2] = list(line) if counter-1 is M: solve() counter = 0
/tmp/tmpn1tswvlr/tmps9o07ipe.py:35: SyntaxWarning: "is" with a literal. Did you mean "=="? if N is 0 and M is 0: /tmp/tmpn1tswvlr/tmps9o07ipe.py:35: SyntaxWarning: "is" with a literal. Did you mean "=="? if N is 0 and M is 0: Traceback (most recent call last): File "/tmp/tmpn1tswvlr/tmps9o07ipe.py", line 29, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s340568184
p00118
u284851373
1493382622
Python
Python3
py
Runtime Error
0
0
762
# -*- coding:utf-8 -*- import sys def dfs(x, y, sym): tile[x][y] = "." for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if 0<=nx and nx<N and 0<=ny and ny<M and tile[nx][ny] is sym: dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): sym = tile[i][j] if tile[i][j] != ".": if tile[i][j] is sym: dfs(i, j, sym) res += 1 print(res) counter=0 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] sys.setrecursionlimit(10000000) while True: counter+=1 line = input() if ' ' in line: nums = line.split(" ") N = int(nums[0]) M = int(nums[1]) tile = [[0 for i in range(N)] for j in range(M)] else: tile[counter-2] = list(line) if N is 0 and M is 0: break if counter-1 is M: solve() counter = 0
/tmp/tmp1zd455g2/tmp2vt2axxf.py:37: SyntaxWarning: "is" with a literal. Did you mean "=="? if N is 0 and M is 0: /tmp/tmp1zd455g2/tmp2vt2axxf.py:37: SyntaxWarning: "is" with a literal. Did you mean "=="? if N is 0 and M is 0: Traceback (most recent call last): File "/tmp/tmp1zd455g2/tmp2vt2axxf.py", line 29, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s618552202
p00118
u284851373
1493382654
Python
Python3
py
Runtime Error
0
0
762
# -*- coding:utf-8 -*- import sys def dfs(x, y, sym): tile[x][y] = "." for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if 0<=nx and nx<N and 0<=ny and ny<M and tile[nx][ny] is sym: dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): sym = tile[i][j] if tile[i][j] != ".": if tile[i][j] is sym: dfs(i, j, sym) res += 1 print(res) counter=0 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] sys.setrecursionlimit(10000000) while True: line = input() counter+=1 if ' ' in line: nums = line.split(" ") N = int(nums[0]) M = int(nums[1]) tile = [[0 for i in range(N)] for j in range(M)] else: tile[counter-2] = list(line) if N is 0 and M is 0: break if counter-1 is M: solve() counter = 0
/tmp/tmpygtpjmzg/tmpupwjgbsq.py:37: SyntaxWarning: "is" with a literal. Did you mean "=="? if N is 0 and M is 0: /tmp/tmpygtpjmzg/tmpupwjgbsq.py:37: SyntaxWarning: "is" with a literal. Did you mean "=="? if N is 0 and M is 0: Traceback (most recent call last): File "/tmp/tmpygtpjmzg/tmpupwjgbsq.py", line 28, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s610514734
p00118
u284851373
1493382762
Python
Python3
py
Runtime Error
0
0
781
# -*- coding:utf-8 -*- import sys def dfs(x, y, sym): tile[x][y] = "." for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if 0<=nx and nx<N and 0<=ny and ny<M and tile[nx][ny] is sym: dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): sym = tile[i][j] if tile[i][j] != ".": if tile[i][j] is sym: dfs(i, j, sym) res += 1 print(res) counter=0 flg=1 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] sys.setrecursionlimit(10000000) while True: line = input() counter+=1 if flg is 1: nums = line.split(" ") N = int(nums[0]) M = int(nums[1]) tile = [[0 for i in range(N)] for j in range(M)] flg=0 else: tile[counter-2] = list(line) if N is 0 and M is 0: break if counter-1 is M: solve() flg=1 counter = 0
/tmp/tmpuzv3rr9b/tmp1sgh1la8.py:31: SyntaxWarning: "is" with a literal. Did you mean "=="? if flg is 1: /tmp/tmpuzv3rr9b/tmp1sgh1la8.py:39: SyntaxWarning: "is" with a literal. Did you mean "=="? if N is 0 and M is 0: /tmp/tmpuzv3rr9b/tmp1sgh1la8.py:39: SyntaxWarning: "is" with a literal. Did you mean "=="? if N is 0 and M is 0: Traceback (most recent call last): File "/tmp/tmpuzv3rr9b/tmp1sgh1la8.py", line 29, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s372281997
p00118
u284851373
1493382851
Python
Python3
py
Runtime Error
0
0
782
# -*- coding:utf-8 -*- import sys def dfs(x, y, sym): tile[x][y] = "." for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if 0<=nx and nx<N and 0<=ny and ny<M and tile[nx][ny] is sym: dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): sym = tile[i][j] if tile[i][j] != ".": if tile[i][j] is sym: dfs(i, j, sym) res += 1 print(res) counter=0 flg=1 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] sys.setrecursionlimit(10**7) while True: line = input() counter += 1 if flg is 1: nums = line.split(" ") N = int(nums[0]) M = int(nums[1]) tile = [[0 for i in range(N)] for j in range(M)] flg=0 else: tile[counter-2] = list(line) if N is 0 and M is 0: break if counter-1 is M: solve() flg = 1 counter = 0
/tmp/tmpdo4hfmlj/tmpu4r5in8v.py:31: SyntaxWarning: "is" with a literal. Did you mean "=="? if flg is 1: /tmp/tmpdo4hfmlj/tmpu4r5in8v.py:39: SyntaxWarning: "is" with a literal. Did you mean "=="? if N is 0 and M is 0: /tmp/tmpdo4hfmlj/tmpu4r5in8v.py:39: SyntaxWarning: "is" with a literal. Did you mean "=="? if N is 0 and M is 0: Traceback (most recent call last): File "/tmp/tmpdo4hfmlj/tmpu4r5in8v.py", line 29, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s222454450
p00118
u284851373
1493382861
Python
Python3
py
Runtime Error
0
0
759
import sys def dfs(x, y, sym): tile[x][y] = "." for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if 0<=nx and nx<N and 0<=ny and ny<M and tile[nx][ny] is sym: dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): sym = tile[i][j] if tile[i][j] != ".": if tile[i][j] is sym: dfs(i, j, sym) res += 1 print(res) counter=0 flg=1 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] sys.setrecursionlimit(10**7) while True: line = input() counter += 1 if flg is 1: nums = line.split(" ") N = int(nums[0]) M = int(nums[1]) tile = [[0 for i in range(N)] for j in range(M)] flg=0 else: tile[counter-2] = list(line) if N is 0 and M is 0: break if counter-1 is M: solve() flg = 1 counter = 0
/tmp/tmpww_xj0lo/tmp3oqry0fq.py:30: SyntaxWarning: "is" with a literal. Did you mean "=="? if flg is 1: /tmp/tmpww_xj0lo/tmp3oqry0fq.py:38: SyntaxWarning: "is" with a literal. Did you mean "=="? if N is 0 and M is 0: /tmp/tmpww_xj0lo/tmp3oqry0fq.py:38: SyntaxWarning: "is" with a literal. Did you mean "=="? if N is 0 and M is 0: Traceback (most recent call last): File "/tmp/tmpww_xj0lo/tmp3oqry0fq.py", line 28, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s727140390
p00118
u284851373
1493382930
Python
Python3
py
Runtime Error
0
0
781
# -*- coding:utf-8 -*- import sys def solve(): res = 0 for i in range(N): for j in range(M): sym = tile[i][j] if tile[i][j] != ".": if tile[i][j] is sym: dfs(i, j, sym) res += 1 print(res) def dfs(x, y, sym): tile[x][y] = "." for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if 0<=nx and nx<N and 0<=ny and ny<M and tile[nx][ny] is sym: dfs(nx, ny, sym) counter=0 flg=1 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] sys.setrecursionlimit(10**7) while True: line = input() counter += 1 if flg is 1: nums = line.split(" ") N = int(nums[0]) M = int(nums[1]) tile = [[0 for i in range(N)] for j in range(M)] flg=0 else: tile[counter-2] = list(line) if N is 0 and M is 0: break if counter-1 is M: solve() flg = 1 counter = 0
/tmp/tmp7dia4rmh/tmpwhu8365w.py:30: SyntaxWarning: "is" with a literal. Did you mean "=="? if flg is 1: /tmp/tmp7dia4rmh/tmpwhu8365w.py:38: SyntaxWarning: "is" with a literal. Did you mean "=="? if N is 0 and M is 0: /tmp/tmp7dia4rmh/tmpwhu8365w.py:38: SyntaxWarning: "is" with a literal. Did you mean "=="? if N is 0 and M is 0: Traceback (most recent call last): File "/tmp/tmp7dia4rmh/tmpwhu8365w.py", line 28, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s756986612
p00118
u284851373
1493382997
Python
Python3
py
Runtime Error
0
0
783
# -*- coding:utf-8 -*- import sys def dfs(x, y, sym): tile[x][y] = "." for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if (0<=nx and nx<N and 0<=ny and ny<M and tile[nx][ny] is sym): dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): sym = tile[i][j] if tile[i][j] != ".": if tile[i][j] is sym: dfs(i, j, sym) res += 1 print(res) counter=0 flg=1 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] sys.setrecursionlimit(10**7) while True: line = input() counter += 1 if flg is 1: nums = line.split(" ") N = int(nums[0]) M = int(nums[1]) tile = [[0 for i in range(N)] for j in range(M)] flg=0 else: tile[counter-2] = list(line) if N is 0 and M is 0: break if counter-1 is M: solve() flg = 1 counter = 0
/tmp/tmpq7vtab2i/tmp6dyscth4.py:30: SyntaxWarning: "is" with a literal. Did you mean "=="? if flg is 1: /tmp/tmpq7vtab2i/tmp6dyscth4.py:38: SyntaxWarning: "is" with a literal. Did you mean "=="? if N is 0 and M is 0: /tmp/tmpq7vtab2i/tmp6dyscth4.py:38: SyntaxWarning: "is" with a literal. Did you mean "=="? if N is 0 and M is 0: Traceback (most recent call last): File "/tmp/tmpq7vtab2i/tmp6dyscth4.py", line 28, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s182468996
p00118
u284851373
1493383004
Python
Python3
py
Runtime Error
0
0
760
import sys def dfs(x, y, sym): tile[x][y] = "." for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if (0<=nx and nx<N and 0<=ny and ny<M and tile[nx][ny] is sym): dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): sym = tile[i][j] if tile[i][j] != ".": if tile[i][j] is sym: dfs(i, j, sym) res += 1 print(res) counter=0 flg=1 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] sys.setrecursionlimit(10**7) while True: line = input() counter += 1 if flg is 1: nums = line.split(" ") N = int(nums[0]) M = int(nums[1]) tile = [[0 for i in range(N)] for j in range(M)] flg=0 else: tile[counter-2] = list(line) if N is 0 and M is 0: break if counter-1 is M: solve() flg = 1 counter = 0
/tmp/tmpwghlk1x6/tmp6wnnojh1.py:29: SyntaxWarning: "is" with a literal. Did you mean "=="? if flg is 1: /tmp/tmpwghlk1x6/tmp6wnnojh1.py:37: SyntaxWarning: "is" with a literal. Did you mean "=="? if N is 0 and M is 0: /tmp/tmpwghlk1x6/tmp6wnnojh1.py:37: SyntaxWarning: "is" with a literal. Did you mean "=="? if N is 0 and M is 0: Traceback (most recent call last): File "/tmp/tmpwghlk1x6/tmp6wnnojh1.py", line 27, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s493115951
p00118
u284851373
1493383359
Python
Python3
py
Runtime Error
0
0
760
# -*- coding:utf-8 -*- import sys def dfs(x, y, sym): tile[x][y] = "." for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if (0<=nx and nx<N and 0<=ny and ny<M and tile[nx][ny] is sym): dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): sym = tile[i][j] if tile[i][j] != ".": if tile[i][j] is sym: dfs(i, j, sym) res += 1 print(res) counter=0 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] sys.setrecursionlimit(10**7) while True: line = input() if ' ' in line: nums = line.split(" ") N = int(nums[0]) M = int(nums[1]) tile = [[0 for i in range(N)] for j in range(M)] else: tile[counter-1] = list(line) if N is 0 and M is 0: break if counter is M: solve() counter = 0 counter += 1
/tmp/tmphrh3dpkd/tmpv4ihy1qv.py:35: SyntaxWarning: "is" with a literal. Did you mean "=="? if N is 0 and M is 0: /tmp/tmphrh3dpkd/tmpv4ihy1qv.py:35: SyntaxWarning: "is" with a literal. Did you mean "=="? if N is 0 and M is 0: Traceback (most recent call last): File "/tmp/tmphrh3dpkd/tmpv4ihy1qv.py", line 27, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s789914911
p00118
u284851373
1493383372
Python
Python3
py
Runtime Error
0
0
737
import sys def dfs(x, y, sym): tile[x][y] = "." for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if (0<=nx and nx<N and 0<=ny and ny<M and tile[nx][ny] is sym): dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): sym = tile[i][j] if tile[i][j] != ".": if tile[i][j] is sym: dfs(i, j, sym) res += 1 print(res) counter=0 DX = [-1, 0, 1, 0] DY = [0, -1, 0, 1] sys.setrecursionlimit(10**7) while True: line = input() if ' ' in line: nums = line.split(" ") N = int(nums[0]) M = int(nums[1]) tile = [[0 for i in range(N)] for j in range(M)] else: tile[counter-1] = list(line) if N is 0 and M is 0: break if counter is M: solve() counter = 0 counter += 1
/tmp/tmpzg2ld8l2/tmpwarvx9a5.py:34: SyntaxWarning: "is" with a literal. Did you mean "=="? if N is 0 and M is 0: /tmp/tmpzg2ld8l2/tmpwarvx9a5.py:34: SyntaxWarning: "is" with a literal. Did you mean "=="? if N is 0 and M is 0: Traceback (most recent call last): File "/tmp/tmpzg2ld8l2/tmpwarvx9a5.py", line 26, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s523045953
p00118
u284851373
1493383541
Python
Python3
py
Runtime Error
0
0
754
# -*- coding:utf-8 -*- import sys def dfs(x, y, sym): tile[x][y] = "." for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if (0<=nx and nx<N and 0<=ny and ny<M and tile[nx][ny] is sym): dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): sym = tile[i][j] if tile[i][j] != ".": if tile[i][j] is sym: dfs(i, j, sym) res += 1 print(res) counter=0 DX = [-1,0,1,0] DY = [0,-1,0,1] sys.setrecursionlimit(10**7) while True: line = input() if " " in line: nums = line.split(" ") N = int(nums[0]) M = int(nums[1]) tile = [[0 for i in range(N)] for j in range(M)] else: tile[counter-1] = list(line) if N is 0 and M is 0: break if counter is M: solve() counter = 0 counter += 1
/tmp/tmpjwmmmfhb/tmpqfkdgoll.py:35: SyntaxWarning: "is" with a literal. Did you mean "=="? if N is 0 and M is 0: /tmp/tmpjwmmmfhb/tmpqfkdgoll.py:35: SyntaxWarning: "is" with a literal. Did you mean "=="? if N is 0 and M is 0: Traceback (most recent call last): File "/tmp/tmpjwmmmfhb/tmpqfkdgoll.py", line 27, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s989781371
p00118
u284851373
1493383569
Python
Python3
py
Runtime Error
0
0
731
import sys def dfs(x, y, sym): tile[x][y] = "." for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if (0<=nx and nx<N and 0<=ny and ny<M and tile[nx][ny] is sym): dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): sym = tile[i][j] if tile[i][j] != ".": if tile[i][j] is sym: dfs(i, j, sym) res += 1 print(res) counter=0 DX = [-1,0,1,0] DY = [0,-1,0,1] sys.setrecursionlimit(10**7) while True: line = input() if " " in line: nums = line.split(" ") N = int(nums[0]) M = int(nums[1]) tile = [[0 for i in range(N)] for j in range(M)] else: tile[counter-1] = list(line) if N is 0 and M is 0: break if counter is M: solve() counter = 0 counter += 1
/tmp/tmpznk7rpu1/tmp6ud4vix7.py:34: SyntaxWarning: "is" with a literal. Did you mean "=="? if N is 0 and M is 0: /tmp/tmpznk7rpu1/tmp6ud4vix7.py:34: SyntaxWarning: "is" with a literal. Did you mean "=="? if N is 0 and M is 0: Traceback (most recent call last): File "/tmp/tmpznk7rpu1/tmp6ud4vix7.py", line 26, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s674688619
p00118
u284851373
1493383837
Python
Python3
py
Runtime Error
0
0
756
# -*- coding:utf-8 -*- import sys def dfs(x, y, sym): tile[x][y] = "." for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if (0<=nx and nx<N and 0<=ny and ny<M and tile[nx][ny] is sym): dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): sym = tile[i][j] if tile[i][j] != ".": if tile[i][j] is sym: dfs(i, j, sym) res += 1 print(res) counter=0 DX = [-1,0,1,0] DY = [0,-1,0,1] sys.setrecursionlimit(10**7) while True: line = input() if " " in line: nums = line.split(" ") N = int(nums[0]) M = int(nums[1]) tile = [[0 for i in range(N)] for j in range(M)] else: tile[counter-1] = list(line) if N is 0 and M is 0: break counter += 1 if counter-1 is M: solve() counter = 0
/tmp/tmpgiqx48w6/tmp58f7gv5i.py:35: SyntaxWarning: "is" with a literal. Did you mean "=="? if N is 0 and M is 0: /tmp/tmpgiqx48w6/tmp58f7gv5i.py:35: SyntaxWarning: "is" with a literal. Did you mean "=="? if N is 0 and M is 0: Traceback (most recent call last): File "/tmp/tmpgiqx48w6/tmp58f7gv5i.py", line 27, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s149981385
p00118
u284851373
1493383846
Python
Python3
py
Runtime Error
0
0
733
import sys def dfs(x, y, sym): tile[x][y] = "." for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if (0<=nx and nx<N and 0<=ny and ny<M and tile[nx][ny] is sym): dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): sym = tile[i][j] if tile[i][j] != ".": if tile[i][j] is sym: dfs(i, j, sym) res += 1 print(res) counter=0 DX = [-1,0,1,0] DY = [0,-1,0,1] sys.setrecursionlimit(10**7) while True: line = input() if " " in line: nums = line.split(" ") N = int(nums[0]) M = int(nums[1]) tile = [[0 for i in range(N)] for j in range(M)] else: tile[counter-1] = list(line) if N is 0 and M is 0: break counter += 1 if counter-1 is M: solve() counter = 0
/tmp/tmp1340t5af/tmplqfkx2jq.py:34: SyntaxWarning: "is" with a literal. Did you mean "=="? if N is 0 and M is 0: /tmp/tmp1340t5af/tmplqfkx2jq.py:34: SyntaxWarning: "is" with a literal. Did you mean "=="? if N is 0 and M is 0: Traceback (most recent call last): File "/tmp/tmp1340t5af/tmplqfkx2jq.py", line 26, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s467105478
p00118
u284851373
1493383953
Python
Python
py
Runtime Error
0
0
733
import sys def dfs(x, y, sym): tile[x][y] = "." for i in range(len(DX)): nx = x + DX[i] ny = y + DY[i] if (0<=nx and nx<N and 0<=ny and ny<M and tile[nx][ny] is sym): dfs(nx, ny, sym) def solve(): res = 0 for i in range(N): for j in range(M): sym = tile[i][j] if tile[i][j] != ".": if tile[i][j] is sym: dfs(i, j, sym) res += 1 print(res) counter=0 DX = [-1,0,1,0] DY = [0,-1,0,1] sys.setrecursionlimit(10**7) while True: line = input() if " " in line: nums = line.split(" ") N = int(nums[0]) M = int(nums[1]) tile = [[0 for i in range(N)] for j in range(M)] else: tile[counter-1] = list(line) if N is 0 and M is 0: break counter += 1 if counter-1 is M: solve() counter = 0
/tmp/tmphsk3q657/tmp484m2i7g.py:34: SyntaxWarning: "is" with a literal. Did you mean "=="? if N is 0 and M is 0: /tmp/tmphsk3q657/tmp484m2i7g.py:34: SyntaxWarning: "is" with a literal. Did you mean "=="? if N is 0 and M is 0: Traceback (most recent call last): File "/tmp/tmphsk3q657/tmp484m2i7g.py", line 26, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s567779812
p00118
u577311000
1493714463
Python
Python3
py
Runtime Error
0
0
988
# -*- coding: utf-8 -*- import sys sys.setrecursionlimit(10*6) def search(values,hp,vp,item): if not (0<=hp<len(values)): return if not (0<=vp<len(values[hp])): return if item!=values[hp][vp]: return values[hp][vp]=True # for dh,dv in [[0,1],[0,-1],[1,0],[-1,0]]: # search(values,hp+dh,vp+dv,item) search(values,hp-1,vp,item) search(values,hp+1,vp,item) search(values,hp,vp-1,item) search(values,hp,vp+1,item) def solve(values): count,valid_items=0,set(['@','#','*']) for i in range(len(values)): for j in range(len(values[i])): if values[i][j] in valid_items: search(values,i,j,values[i][j]) count+=1 return count def main(): line,values=input().strip(),list() while line!='0 0': H,W = list(map(int,line.split(' '))) value = list() for _ in range(H): value.append(list(x for x in input().strip())) print(solve(value)) values.append(value) line = input().strip() # for value in values: # print(solve(value)) if __name__=='__main__': main()
Traceback (most recent call last): File "/tmp/tmpnr4lhpvj/tmpqbml3wf2.py", line 41, in <module> main() File "/tmp/tmpnr4lhpvj/tmpqbml3wf2.py", line 28, in main line,values=input().strip(),list() ^^^^^^^ EOFError: EOF when reading a line
s382432649
p00118
u577311000
1493715008
Python
Python3
py
Runtime Error
0
0
989
# -*- coding: utf-8 -*- import sys sys.setrecursionlimit(10*6) def search(values,hp,vp,item): if not (0<=hp<len(values)): return if not (0<=vp<len(values[hp])): return if item!=values[hp][vp]: return values[hp][vp]=True # for dh,dv in [[0,1],[0,-1],[1,0],[-1,0]]: # search(values,hp+dh,vp+dv,item) search(values,hp-1,vp,item) search(values,hp+1,vp,item) search(values,hp,vp-1,item) search(values,hp,vp+1,item) def solve(values): count,valid_items=0,set(['@','#','*']) for i in range(len(values)): for j in range(len(values[i])): if values[i][j] in valid_items: search(values,i,j,values[i][j]) count+=1 return count def main(): line,values=input().strip(),list() while line!='0 0': H,W = list(map(int,line.split(' '))) value = list() for _ in range(H): value.append(list(x for x in input().strip())) print(solve(value)) # values.append(value) line = input().strip() # for value in values: # print(solve(value)) if __name__=='__main__': main()
Traceback (most recent call last): File "/tmp/tmpkp449uxm/tmpmhxtn1mw.py", line 41, in <module> main() File "/tmp/tmpkp449uxm/tmpmhxtn1mw.py", line 28, in main line,values=input().strip(),list() ^^^^^^^ EOFError: EOF when reading a line
s405519832
p00118
u577311000
1493715399
Python
Python3
py
Runtime Error
0
0
1061
# -*- coding: utf-8 -*- import sys #sys.setrecursionlimit(10**6) sys.setrecursionlimit(10*6) def search(values,hp,vp,item): if not (0<=hp<len(values)): return if not (0<=vp<len(values[hp])): return if item!=values[hp][vp]: return values[hp][vp]=True # for dh,dv in [[0,1],[0,-1],[1,0],[-1,0]]: # search(values,hp+dh,vp+dv,item) search(values,hp-1,vp,item) search(values,hp+1,vp,item) search(values,hp,vp-1,item) search(values,hp,vp+1,item) def solve(values): count,valid_items=0,set(['@','#','*']) for i in range(len(values)): for j in range(len(values[i])): if values[i][j] in valid_items: search(values,i,j,values[i][j]) count+=1 return count def main(): line, values = input().strip(), list() while line!='0 0': H,W = list(map(int,line.split(' '))) value = list() for _ in range(H): # value.append(list(x for x in input().strip())) value.append(list(input().strip())) print(solve(value)) # values.append(value) line = input().strip() for value in values: print(solve(value)) if __name__=='__main__': main()
Traceback (most recent call last): File "/tmp/tmp12a9r_an/tmpkv3iif4y.py", line 43, in <module> main() File "/tmp/tmp12a9r_an/tmpkv3iif4y.py", line 29, in main line, values = input().strip(), list() ^^^^^^^ EOFError: EOF when reading a line
s845952058
p00118
u577311000
1493715453
Python
Python3
py
Runtime Error
0
0
861
# -*- coding: utf-8 -*- import sys sys.setrecursionlimit(10**6) def search(values,hp,vp,item): if not (0<=hp<len(values)): return if not (0<=vp<len(values[hp])): return if item!=values[hp][vp]: return values[hp][vp]=True # for dh,dv in [[0,1],[0,-1],[1,0],[-1,0]]: # search(values,hp+dh,vp+dv,item) search(values,hp-1,vp,item) search(values,hp+1,vp,item) search(values,hp,vp-1,item) search(values,hp,vp+1,item) def solve(values): count,valid_items=0,set(['@','#','*']) for i in range(len(values)): for j in range(len(values[i])): if values[i][j] in valid_items: search(values,i,j,values[i][j]) count+=1 return count def main(): line = input().strip() while line!='0 0': H,W = list(map(int,line.split(' '))) values.append(list(list(input().strip()) for _ in range(H))) line = input().strip() if __name__=='__main__': main()
Traceback (most recent call last): File "/tmp/tmppbhqnduv/tmpm09r4y9k.py", line 35, in <module> main() File "/tmp/tmppbhqnduv/tmpm09r4y9k.py", line 28, in main line = input().strip() ^^^^^^^ EOFError: EOF when reading a line
s186540615
p00118
u577311000
1493715499
Python
Python3
py
Runtime Error
0
0
857
# -*- coding: utf-8 -*- import sys sys.setrecursionlimit(10**6) def search(values,hp,vp,item): if not (0<=hp<len(values)): return if not (0<=vp<len(values[hp])): return if item!=values[hp][vp]: return values[hp][vp]=True # for dh,dv in [[0,1],[0,-1],[1,0],[-1,0]]: # search(values,hp+dh,vp+dv,item) search(values,hp-1,vp,item) search(values,hp+1,vp,item) search(values,hp,vp-1,item) search(values,hp,vp+1,item) def solve(values): count,valid_items=0,set(['@','#','*']) for i in range(len(values)): for j in range(len(values[i])): if values[i][j] in valid_items: search(values,i,j,values[i][j]) count+=1 return count def main(): line = input().strip() while line!='0 0': H,W = list(map(int,line.split(' '))) print(solve(list(list(input().strip()) for _ range(H)))) line = input().strip() if __name__=='__main__': main()
File "/tmp/tmpbe7k8hv7/tmpmxn6uk4g.py", line 31 print(solve(list(list(input().strip()) for _ range(H)))) ^^^^^ SyntaxError: invalid syntax
s520439186
p00118
u577311000
1493715586
Python
Python3
py
Runtime Error
0
0
906
# -*- coding: utf-8 -*- import sys sys.setrecursionlimit(10**6) def search(values,hp,vp,item): if not (0<=hp<len(values)): return if not (0<=vp<len(values[hp])): return if item!=values[hp][vp]: return values[hp][vp]=True for dh,dv in list([0,1],[0,-1],[1,0],[-1,0]): search(values,hp+dh,vp+dv,item) # search(values,hp-1,vp,item) # search(values,hp+1,vp,item) # search(values,hp,vp-1,item) # search(values,hp,vp+1,item) def solve(values): count,valid_items=0,set(['@','#','*']) for i in range(len(values)): for j in range(len(values[i])): if values[i][j] in valid_items: search(values,i,j,values[i][j]) count+=1 return count def main(): line = input().strip() while line!='0 0': H,W = list(map(int,line.split(' '))) values = list() for _ in range(H): values.append(list(input().strip())) print(solve(values)) line = input().strip() if __name__=='__main__': main()
Traceback (most recent call last): File "/tmp/tmpelz5kv14/tmponc3mof4.py", line 38, in <module> main() File "/tmp/tmpelz5kv14/tmponc3mof4.py", line 28, in main line = input().strip() ^^^^^^^ EOFError: EOF when reading a line
s660982645
p00118
u462831976
1494782723
Python
Python3
py
Runtime Error
0
0
979
# -*- coding: utf-8 -*- import sys import os import math directions = [(1, 0), (-1, 0), (0, 1), (0, -1)] for s in sys.stdin: H, W = map(int, s.split()) if H == W == 0: break # map M = [] for i in range(H): s = input().strip() M.append(s) # W x H white map A = [[None for i in range(H)] for j in range(W)] def drawable(x, y): if 0 <= x < W and 0 <= y < H and A[y][x] == None: return True else: return False color_num = 0 def fill(x, y): global color_num A[y][x] = color_num for direction in directions: new_x = x + direction[0] new_y = y + direction[1] if drawable(new_x, new_y) and M[y][x] == M[new_y][new_x]: fill(new_x, new_y) for y in range(H): for x in range(W): if drawable(x, y): color_num += 1 fill(x, y) print(color_num)
s670660826
p00118
u462831976
1494782807
Python
Python3
py
Runtime Error
0
0
979
# -*- coding: utf-8 -*- import sys import os import math directions = [(1, 0), (-1, 0), (0, 1), (0, -1)] for s in sys.stdin: H, W = map(int, s.split()) if H == W == 0: break # map M = [] for i in range(H): s = input().strip() M.append(s) # W x H white map A = [[None for i in range(W)] for j in range(H)] def drawable(x, y): if 0 <= x < W and 0 <= y < H and A[y][x] == None: return True else: return False color_num = 0 def fill(x, y): global color_num A[y][x] = color_num for direction in directions: new_x = x + direction[0] new_y = y + direction[1] if drawable(new_x, new_y) and M[y][x] == M[new_y][new_x]: fill(new_x, new_y) for y in range(H): for x in range(W): if drawable(x, y): color_num += 1 fill(x, y) print(color_num)
s612681325
p00118
u462831976
1494783001
Python
Python3
py
Runtime Error
0
0
979
# -*- coding: utf-8 -*- import sys import os import math directions = [(1, 0), (-1, 0), (0, 1), (0, -1)] for s in sys.stdin: H, W = map(int, s.split()) if H == W == 0: break # map M = [] for i in range(H): s = input().strip() M.append(s) # W x H white map A = [[None for i in range(W)] for j in range(H)] def drawable(x, y): if 0 <= x < W and 0 <= y < H and A[y][x] == None: return True else: return False color_num = 0 def fill(x, y): global color_num A[y][x] = color_num for direction in directions: new_x = x + direction[0] new_y = y + direction[1] if drawable(new_x, new_y) and M[y][x] == M[new_y][new_x]: fill(new_x, new_y) for y in range(H): for x in range(W): if drawable(x, y): color_num += 1 fill(x, y) print(color_num)
s649631175
p00118
u724963150
1496416526
Python
Python3
py
Runtime Error
0
0
659
while True: a=[int(num)for num in input().split(' ')] if a[0]==0:break s=[] cnt=0 def rep(r,c,nest): global cnt f=s[r][c] if f=='.':return s[r][c]='.' if r>0: if s[r-1][c]==f:rep(r-1,c,False) if r<a[0]-1: if s[r+1][c]==f:rep(r+1,c,False) if c>0: if s[r][c-1]==f:rep(r,c-1,False) if c<a[1]-1: if s[r][c+1]==f:rep(r,c+1,False) if nest==True: cnt+=1 for i in range(a[0]): s.append(list(input())) for i in range(a[0]): for j in range(a[1]): rep(i,j,True) print(cnt)
Traceback (most recent call last): File "/tmp/tmp_55_xa6g/tmpmxclvtlr.py", line 2, in <module> a=[int(num)for num in input().split(' ')] ^^^^^^^ EOFError: EOF when reading a line
s791906152
p00118
u724963150
1496419194
Python
Python3
py
Runtime Error
0
0
693
import sys sys.setrecursionlimit(9000) while True: a=[int(num)for num in input().split(' ')] if a[0]==0:break s=[] cnt=0 def rep(r,c,nest): global cnt f=s[r][c] if f=='.':return s[r][c]='.' if r>0: if s[r-1][c]==f:rep(r-1,c,False) if r<a[0]-1: if s[r+1][c]==f:rep(r+1,c,False) if c>0: if s[r][c-1]==f:rep(r,c-1,False) if c<a[1]-1: if s[r][c+1]==f:rep(r,c+1,False) if nest==True: cnt+=1 for i in range(a[0]): s.append(list(input())) for i in range(a[0]): for j in range(a[1]): rep(i,j,True) print(cnt)
Traceback (most recent call last): File "/tmp/tmpj6r_jz23/tmpmp3ypau0.py", line 4, in <module> a=[int(num)for num in input().split(' ')] ^^^^^^^ EOFError: EOF when reading a line
s852116828
p00118
u811733736
1504099727
Python
Python3
py
Runtime Error
0
0
2491
# -*- coding: utf-8 -*- """ http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0118 """ import sys def solve(data): size = len(data[0]) data.insert(0, ['0' for _ in range(size)]) data.insert(len(data), ['0' for _ in range(size)]) processing_area = [] area_id = 0 for y in range(1, len(data)): for x in range(1, len(data[0])): mark = data[y][x] data[y][x] = '0' if mark != '0': area_id += 1 processing_area.append((y, x)) while processing_area: yy, xx = processing_area.pop() if data[yy-1][xx] == mark: data[yy-1][xx] = '0' processing_area.append((yy-1, xx)) if data[yy+1][xx] == mark: data[yy+1][xx] = '0' processing_area.append((yy+1, xx)) if data[yy][xx-1] == mark: data[yy][xx-1] = '0' processing_area.append((yy, xx-1)) if data[yy][xx+1] == mark: data[yy][xx+1] = '0' processing_area.append((yy, xx+1)) mark = '0' return area_id def main(args): # data = [] # data.append(['0', '#', '#', '#', '#', '*', '*', '*', '*', '*', '@', '0']) # data.append(['0', '@', '#', '@', '@', '@', '@', '#', '*', '#', '*', '0']) # data.append(['0', '@', '#', '#', '*', '*', '*', '@', '@', '@', '*', '0']) # data.append(['0', '#', '*', '*', '*', '*', '#', '*', '@', '*', '*', '0']) # data.append(['0', '#', '#', '@', '*', '#', '@', '@', '*', '#', '#', '0']) # data.append(['0', '*', '@', '@', '@', '@', '*', '@', '@', '@', '#', '0']) # data.append(['0', '*', '*', '*', '#', '@', '*', '@', '#', '#', '*', '0']) # data.append(['0', '*', '@', '@', '@', '*', '@', '@', '#', '#', '@', '0']) # data.append(['0', '*', '@', '*', '#', '*', '@', '#', '#', '*', '*', '0']) # data.append(['0', '@', '*', '*', '*', '*', '#', '@', '@', '#', '@', '0']) data = [] while True: h, w = [int(x) for x in input().split(' ')] if h == 0 and w == 0: break for _ in range(w): temp = list(input()) temp.insert(0, '0') temp.append('0') data.append(temp) result = solve(data) print(result) if __name__ == '__main__': main(sys.argv[1:])
Traceback (most recent call last): File "/tmp/tmpqejtidxz/tmpu2qpfgt0.py", line 71, in <module> main(sys.argv[1:]) File "/tmp/tmpqejtidxz/tmpu2qpfgt0.py", line 57, in main h, w = [int(x) for x in input().split(' ')] ^^^^^^^ EOFError: EOF when reading a line
s880281418
p00118
u811733736
1504100899
Python
Python3
py
Runtime Error
0
0
2541
# -*- coding: utf-8 -*- """ http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0118 """ import sys def solve(data): size = len(data[0]) data.insert(0, ['0' for _ in range(size)]) data.insert(len(data), ['0' for _ in range(size)]) processing_area = [] area_id = 0 for y in range(1, len(data)): for x in range(1, len(data[0])): print('y:{}, x:{}'.format(y, x)) mark = data[y][x] data[y][x] = '0' if mark != '0': area_id += 1 processing_area.append((y, x)) while processing_area: yy, xx = processing_area.pop() if data[yy-1][xx] == mark: data[yy-1][xx] = '0' processing_area.append((yy-1, xx)) if data[yy+1][xx] == mark: data[yy+1][xx] = '0' processing_area.append((yy+1, xx)) if data[yy][xx-1] == mark: data[yy][xx-1] = '0' processing_area.append((yy, xx-1)) if data[yy][xx+1] == mark: data[yy][xx+1] = '0' processing_area.append((yy, xx+1)) mark = '0' return area_id def main(args): # data = [] # data.append(['0', '#', '#', '#', '#', '*', '*', '*', '*', '*', '@', '0']) # data.append(['0', '@', '#', '@', '@', '@', '@', '#', '*', '#', '*', '0']) # data.append(['0', '@', '#', '#', '*', '*', '*', '@', '@', '@', '*', '0']) # data.append(['0', '#', '*', '*', '*', '*', '#', '*', '@', '*', '*', '0']) # data.append(['0', '#', '#', '@', '*', '#', '@', '@', '*', '#', '#', '0']) # data.append(['0', '*', '@', '@', '@', '@', '*', '@', '@', '@', '#', '0']) # data.append(['0', '*', '*', '*', '#', '@', '*', '@', '#', '#', '*', '0']) # data.append(['0', '*', '@', '@', '@', '*', '@', '@', '#', '#', '@', '0']) # data.append(['0', '*', '@', '*', '#', '*', '@', '#', '#', '*', '*', '0']) # data.append(['0', '@', '*', '*', '*', '*', '#', '@', '@', '#', '@', '0']) while True: h, w = [int(x) for x in input().split(' ')] if h == 0 and w == 0: break data = [] for _ in range(w): temp = list(input()) temp.insert(0, '0') temp.append('0') data.append(temp) result = solve(data) print(result) if __name__ == '__main__': main(sys.argv[1:])
Traceback (most recent call last): File "/tmp/tmp7lwpbsk3/tmpfkrru5wp.py", line 73, in <module> main(sys.argv[1:]) File "/tmp/tmp7lwpbsk3/tmpfkrru5wp.py", line 58, in main h, w = [int(x) for x in input().split(' ')] ^^^^^^^ EOFError: EOF when reading a line
s994481713
p00118
u811733736
1504100952
Python
Python3
py
Runtime Error
0
0
2543
# -*- coding: utf-8 -*- """ http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0118 """ import sys def solve(data): size = len(data[0]) data.insert(0, ['0' for _ in range(size)]) data.insert(len(data), ['0' for _ in range(size)]) processing_area = [] area_id = 0 for y in range(1, len(data)): for x in range(1, len(data[0])): # print('y:{}, x:{}'.format(y, x)) mark = data[y][x] data[y][x] = '0' if mark != '0': area_id += 1 processing_area.append((y, x)) while processing_area: yy, xx = processing_area.pop() if data[yy-1][xx] == mark: data[yy-1][xx] = '0' processing_area.append((yy-1, xx)) if data[yy+1][xx] == mark: data[yy+1][xx] = '0' processing_area.append((yy+1, xx)) if data[yy][xx-1] == mark: data[yy][xx-1] = '0' processing_area.append((yy, xx-1)) if data[yy][xx+1] == mark: data[yy][xx+1] = '0' processing_area.append((yy, xx+1)) mark = '0' return area_id def main(args): # data = [] # data.append(['0', '#', '#', '#', '#', '*', '*', '*', '*', '*', '@', '0']) # data.append(['0', '@', '#', '@', '@', '@', '@', '#', '*', '#', '*', '0']) # data.append(['0', '@', '#', '#', '*', '*', '*', '@', '@', '@', '*', '0']) # data.append(['0', '#', '*', '*', '*', '*', '#', '*', '@', '*', '*', '0']) # data.append(['0', '#', '#', '@', '*', '#', '@', '@', '*', '#', '#', '0']) # data.append(['0', '*', '@', '@', '@', '@', '*', '@', '@', '@', '#', '0']) # data.append(['0', '*', '*', '*', '#', '@', '*', '@', '#', '#', '*', '0']) # data.append(['0', '*', '@', '@', '@', '*', '@', '@', '#', '#', '@', '0']) # data.append(['0', '*', '@', '*', '#', '*', '@', '#', '#', '*', '*', '0']) # data.append(['0', '@', '*', '*', '*', '*', '#', '@', '@', '#', '@', '0']) while True: h, w = [int(x) for x in input().split(' ')] if h == 0 and w == 0: break data = [] for _ in range(w): temp = list(input()) temp.insert(0, '0') temp.append('0') data.append(temp) result = solve(data) print(result) if __name__ == '__main__': main(sys.argv[1:])
Traceback (most recent call last): File "/tmp/tmpkwpslbqw/tmpi9wlsfok.py", line 73, in <module> main(sys.argv[1:]) File "/tmp/tmpkwpslbqw/tmpi9wlsfok.py", line 58, in main h, w = [int(x) for x in input().split(' ')] ^^^^^^^ EOFError: EOF when reading a line
s938269657
p00118
u811733736
1504101257
Python
Python3
py
Runtime Error
0
0
2574
# -*- coding: utf-8 -*- """ http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0118 """ import sys def solve(data): size = len(data[0]) data.insert(0, ['0' for _ in range(size)]) data.insert(len(data), ['0' for _ in range(size)]) processing_area = [] area_id = 0 for y in range(1, len(data)-1): for x in range(1, len(data[0])): # print('y:{}, x:{}'.format(y, x)) mark = data[y][x] data[y][x] = '0' if mark != '0': area_id += 1 processing_area.append((y, x)) while processing_area: yy, xx = processing_area.pop() if data[yy-1][xx] == mark: # ??? data[yy-1][xx] = '0' processing_area.append((yy-1l, xx)) if data[yy+1][xx] == mark: # ??? data[yy+1][xx] = '0' processing_area.append((yy+1, xx)) if data[yy][xx-1] == mark: # ??? data[yy][xx-1] = '0' processing_area.append((yy, xx-1)) if data[yy][xx+1] == mark: # ??? data[yy][xx+1] = '0' processing_area.append((yy, xx+1)) mark = '0' return area_id def main(args): # data = [] # data.append(['0', '#', '#', '#', '#', '*', '*', '*', '*', '*', '@', '0']) # data.append(['0', '@', '#', '@', '@', '@', '@', '#', '*', '#', '*', '0']) # data.append(['0', '@', '#', '#', '*', '*', '*', '@', '@', '@', '*', '0']) # data.append(['0', '#', '*', '*', '*', '*', '#', '*', '@', '*', '*', '0']) # data.append(['0', '#', '#', '@', '*', '#', '@', '@', '*', '#', '#', '0']) # data.append(['0', '*', '@', '@', '@', '@', '*', '@', '@', '@', '#', '0']) # data.append(['0', '*', '*', '*', '#', '@', '*', '@', '#', '#', '*', '0']) # data.append(['0', '*', '@', '@', '@', '*', '@', '@', '#', '#', '@', '0']) # data.append(['0', '*', '@', '*', '#', '*', '@', '#', '#', '*', '*', '0']) # data.append(['0', '@', '*', '*', '*', '*', '#', '@', '@', '#', '@', '0']) while True: h, w = [int(x) for x in input().split(' ')] if h == 0 and w == 0: break data = [] for _ in range(h): temp = list(input()) temp.insert(0, '0') temp.append('0') data.append(temp) result = solve(data) print(result) if __name__ == '__main__': main(sys.argv[1:])
File "/tmp/tmpua8f1s9c/tmp9k98hanq.py", line 29 processing_area.append((yy-1l, xx)) ^ SyntaxError: invalid decimal literal
s167591882
p00118
u510797278
1504673545
Python
Python3
py
Runtime Error
0
0
1035
field = [] w = 0 h = 0 def main(): global field, w, h while True: h, w = map(int, input().split()) if h == 0 and w == 0: break count = 0 field = [[0] * w for _ in range(h)] for y in range(h): kinds = [_ for _ in input()] arrangement(kinds, y) for y in range(h): for x in range(w): if field[y][x] != -1: dfs(field[y][x], x, y) count += 1 print(count) def arrangement(kinds, y): global field for i, kind in enumerate(kinds): field[y][i] = kind def dfs(kind, x, y): global field field[y][x] = -1 for dx, dy in zip([0, 0, -1, 1], [1, -1, 0, 0]): next_x = x + dx next_y = y + dy if next_x < 0 or next_y < 0 or next_x >= w or next_y >= h: continue if field[next_y][next_x] != kind: continue dfs(field[next_y][next_x], next_x, next_y) if __name__ == '__main__': main()
Traceback (most recent call last): File "/tmp/tmppcek3x_k/tmpn3ecgeqx.py", line 47, in <module> main() File "/tmp/tmppcek3x_k/tmpn3ecgeqx.py", line 9, in main h, w = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s931707152
p00118
u510797278
1504674764
Python
Python3
py
Runtime Error
0
0
1001
field = [] w = 0 h = 0 def main(): global field, w, h while True: h, w = map(int, input().split()) if h == 0 and w == 0: break count = 0 [field.append([_ for _ in input()]) for _ in range(h)] print(field) for y in range(h): for x in range(w): if field[y][x] != -1: dfs(field[y][x], x, y) count += 1 print(count) def arrangement(kinds, y): global field for i, kind in enumerate(kinds): field[y][i] = kind def dfs(kind, x, y): global field print(x, y, field[y][x]) field[y][x] = -1 for dx, dy in zip([0, 0, -1, 1], [1, -1, 0, 0]): next_x = x + dx next_y = y + dy if next_x < 0 or next_y < 0 or next_x >= w or next_y >= h: continue if field[next_y][next_x] != kind: continue dfs(field[next_y][next_x], next_x, next_y) if __name__ == '__main__': main()
Traceback (most recent call last): File "/tmp/tmpbvfmplwr/tmphw8lj77e.py", line 45, in <module> main() File "/tmp/tmpbvfmplwr/tmphw8lj77e.py", line 9, in main h, w = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s402264668
p00118
u510797278
1504688663
Python
Python3
py
Runtime Error
0
0
840
field = [] w = 0 h = 0 def main(): global field, w, h while True: h, w = map(int, input().split()) if h == 0 and w == 0: break count = 0 [field.append([_ for _ in input()]) for _ in range(h)] for y in range(h): for x in range(w): if field[y][x] != -1: dfs(field[y][x], x, y) count += 1 print(count) def dfs(kind, x, y): global field field[y][x] = -1 for dx, dy in zip([0, 0, -1, 1], [1, -1, 0, 0]): next_x = x + dx next_y = y + dy if next_x < 0 or next_y < 0 or next_x >= w or next_y >= h: continue if field[next_y][next_x] != kind: continue dfs(field[next_y][next_x], next_x, next_y) if __name__ == '__main__': main()
Traceback (most recent call last): File "/tmp/tmpebihbp99/tmpyc2e66o0.py", line 36, in <module> main() File "/tmp/tmpebihbp99/tmpyc2e66o0.py", line 9, in main h, w = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s324230965
p00118
u510797278
1504688841
Python
Python3
py
Runtime Error
0
0
859
field = [] w = 0 h = 0 def main(): global field, w, h while True: h, w = map(int, input().split()) if h == 0 and w == 0: break count = 0 field = [] [field.append([_ for _ in input()]) for _ in range(h)] for y in range(h): for x in range(w): if field[y][x] != -1: dfs(field[y][x], x, y) count += 1 print(count) def dfs(kind, x, y): global field field[y][x] = -1 for dx, dy in zip([0, 0, -1, 1], [1, -1, 0, 0]): next_x = x + dx next_y = y + dy if next_x < 0 or next_y < 0 or next_x >= w or next_y >= h: continue if field[next_y][next_x] != kind: continue dfs(field[next_y][next_x], next_x, next_y) if __name__ == '__main__': main()
Traceback (most recent call last): File "/tmp/tmpt45e09sn/tmpo3k2yw5q.py", line 37, in <module> main() File "/tmp/tmpt45e09sn/tmpo3k2yw5q.py", line 9, in main h, w = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s412096775
p00118
u695154284
1505222566
Python
Python3
py
Runtime Error
0
0
749
import sys d = [(1, 0), (-1, 0), (0, 1), (0, -1)] def dfs(x, y, c): judged[x][y] = True for dx, dy in d: if 0 <= x + dx < H and 0 <= y + dy < W and (not judged[x + dx][y + dy]) and orchard[x + dx][y + dy] == c: dfs(x + dx, y + dy, c) if __name__ == '__main__': while True: H, W = list(map(int, input().split())) if H == 0 and W == 0: break orchard = [input() for i in range(H)] judged = [[False for i in range(W)] for j in range(H)] # print(orchard) ans = 0 for i in range(0, H): for j in range(0, W): if not judged[i][j]: ans += 1 dfs(i, j, orchard[i][j]) print(ans)
Traceback (most recent call last): File "/tmp/tmpd8ot99nz/tmpspenard_.py", line 15, in <module> H, W = list(map(int, input().split())) ^^^^^^^ EOFError: EOF when reading a line
s980605873
p00118
u695154284
1505222609
Python
Python3
py
Runtime Error
0
0
749
import sys d = [(1, 0), (-1, 0), (0, 1), (0, -1)] def dfs(x, y, c): judged[x][y] = True for dx, dy in d: if 0 <= x + dx < H and 0 <= y + dy < W and (not judged[x + dx][y + dy]) and orchard[x + dx][y + dy] == c: dfs(x + dx, y + dy, c) if __name__ == '__main__': while True: H, W = list(map(int, input().split())) if H == 0 and W == 0: break orchard = [input() for i in range(H)] judged = [[False for i in range(W)] for j in range(H)] # print(orchard) ans = 0 for i in range(0, H): for j in range(0, W): if not judged[i][j]: ans += 1 dfs(i, j, orchard[i][j]) print(ans)
Traceback (most recent call last): File "/tmp/tmpq56ckdlb/tmp7vgk97o3.py", line 15, in <module> H, W = list(map(int, input().split())) ^^^^^^^ EOFError: EOF when reading a line
s573424296
p00118
u695154284
1505222884
Python
Python3
py
Runtime Error
0
0
752
import sys d = [(1, 0), (-1, 0), (0, 1), (0, -1)] def dfs(x, y, c): judged[x][y] = True for dx, dy in d: if 0 <= x + dx < H and 0 <= y + dy < W and (not judged[x + dx][y + dy]) and orchard[x + dx][y + dy] == c: dfs(x + dx, y + dy, c) if __name__ == '__main__': while True: H, W = list(map(int, input().split(' '))) if H == 0 and W == 0: break orchard = [input() for i in range(H)] judged = [[False for i in range(W)] for j in range(H)] # print(orchard) ans = 0 for i in range(0, H): for j in range(0, W): if not judged[i][j]: ans += 1 dfs(i, j, orchard[i][j]) print(ans)
Traceback (most recent call last): File "/tmp/tmpsj2x7yc5/tmptj6j1gjy.py", line 15, in <module> H, W = list(map(int, input().split(' '))) ^^^^^^^ EOFError: EOF when reading a line
s648310386
p00118
u695154284
1505223261
Python
Python3
py
Runtime Error
0
0
749
import sys d = [(1, 0), (-1, 0), (0, 1), (0, -1)] def dfs(x, y, c): judged[x][y] = True for dx, dy in d: if 0 <= x + dx < H and 0 <= y + dy < W and (not judged[x + dx][y + dy]) and orchard[x + dx][y + dy] == c: dfs(x + dx, y + dy, c) if __name__ == '__main__': while True: H, W = list(map(int, input().split())) if H == 0 and W == 0: break orchard = [input() for i in range(H)] judged = [[False for i in range(W)] for j in range(H)] # print(orchard) ans = 0 for i in range(0, H): for j in range(0, W): if not judged[i][j]: ans += 1 dfs(i, j, orchard[i][j]) print(ans)
Traceback (most recent call last): File "/tmp/tmpc6jct2t4/tmp3z0egvwy.py", line 15, in <module> H, W = list(map(int, input().split())) ^^^^^^^ EOFError: EOF when reading a line
s778225904
p00118
u695154284
1505223451
Python
Python3
py
Runtime Error
0
0
765
import sys d = [(1, 0), (-1, 0), (0, 1), (0, -1)] def dfs(x, y, c): judged[x][y] = True for dx, dy in d: if 0 <= x + dx < H and 0 <= y + dy < W and (not judged[x + dx][y + dy]) and orchard[x + dx][y + dy] == c: dfs(x + dx, y + dy, c) if __name__ == '__main__': while True: H, W = list(map(int, input().split())) if H == 0 and W == 0: break orchard = [input() for i in range(H)] judged = [[False for i in range(W)] for j in range(H)] # print(orchard) ans = 0 for i in range(0, H): for j in range(0, W): if not judged[i][j]: ans += 1 dfs(i, j, orchard[i][j]) print(ans) input()
Traceback (most recent call last): File "/tmp/tmpprjfk6tr/tmptuxjp_gs.py", line 15, in <module> H, W = list(map(int, input().split())) ^^^^^^^ EOFError: EOF when reading a line
s261530839
p00118
u618725557
1509889516
Python
Python3
py
Runtime Error
0
0
603
def infection(i, j): if farm[i][j] == moji: farm[i][j] = '+'; if j + 1 < W : infection(i, j + 1) if i + 1 < H : infection(i + 1, j) if j - 1 >= 0 :infection(i, j - 1) if i - 1 >= 0 :infection(i - 1, j) while(1): farm = [] cnt = 0; H, W = list(map(int, input().split())) if H == 0 and W == 0: break for i in range(H): farm.append(list(input())) for i in range(H): for j in range(W): if farm[i][j] == '+': continue cnt+=1 moji = farm[i][j] infection(i, j) print(cnt)
Traceback (most recent call last): File "/tmp/tmprwue0wpa/tmpnl4u97lr.py", line 12, in <module> H, W = list(map(int, input().split())) ^^^^^^^ EOFError: EOF when reading a line
s214074519
p00118
u618725557
1509889560
Python
Python3
py
Runtime Error
0
0
603
def infection(i, j): if farm[i][j] == moji: farm[i][j] = '+' if j + 1 < W : infection(i, j + 1) if i + 1 < H : infection(i + 1, j) if j - 1 >= 0 :infection(i, j - 1) if i - 1 >= 0 :infection(i - 1, j) while(1): farm = [] cnt = 0 H, W = list(map(int, input().split())) if H == 0 and W == 0: break for i in range(H): farm.append(list(input())) for i in range(H): for j in range(W): if farm[i][j] == '+': continue cnt += 1 moji = farm[i][j] infection(i, j) print(cnt)
Traceback (most recent call last): File "/tmp/tmpej66lxkg/tmpidp2rlzq.py", line 12, in <module> H, W = list(map(int, input().split())) ^^^^^^^ EOFError: EOF when reading a line
s632549410
p00118
u618725557
1509889653
Python
Python3
py
Runtime Error
0
0
603
def infection(i, j): if farm[i][j] == moji: farm[i][j] = '+' if j + 1 < W : infection(i, j + 1) if i + 1 < H : infection(i + 1, j) if j - 1 >= 0 :infection(i, j - 1) if i - 1 >= 0 :infection(i - 1, j) while(1): farm = [] cnt = 0 H, W = list(map(int, input().split())) if H == 0 and W == 0: break for i in range(H): farm.append(list(input())) for i in range(H): for j in range(W): if farm[i][j] == '+': continue cnt += 1 moji = farm[i][j] infection(i, j) print(cnt)
Traceback (most recent call last): File "/tmp/tmppaw9x30n/tmpbvq36nrf.py", line 12, in <module> H, W = list(map(int, input().split())) ^^^^^^^ EOFError: EOF when reading a line
s865775379
p00118
u618725557
1509889899
Python
Python3
py
Runtime Error
0
0
629
def infection(i, j,H, W, moji): if farm[i][j] == moji: farm[i][j] = '+' if j + 1 < W : infection(i, j + 1,H,W,moji) if i + 1 < H : infection(i + 1, j,H,W,moji) if j - 1 >= 0 :infection(i, j - 1,H,W,moji) if i - 1 >= 0 :infection(i - 1, j,H,W,moji) while(1): farm = [] cnt = 0 H, W = list(map(int, input().split())) if H == 0 and W == 0: break for i in range(H): farm.append(list(input())) for i in range(H): for j in range(W): if farm[i][j] == '+': continue cnt += 1 infection(i, j,H,W,moji) print(cnt)
Traceback (most recent call last): File "/tmp/tmpo3gwpiw_/tmpy0iu55tz.py", line 12, in <module> H, W = list(map(int, input().split())) ^^^^^^^ EOFError: EOF when reading a line
s737578014
p00118
u618725557
1509889912
Python
Python3
py
Runtime Error
0
0
632
def infection(i, j,H, W, moji): if farm[i][j] == moji: farm[i][j] = '+' if j + 1 < W : infection(i, j + 1,H,W,moji) if i + 1 < H : infection(i + 1, j,H,W,moji) if j - 1 >= 0 :infection(i, j - 1,H,W,moji) if i - 1 >= 0 :infection(i - 1, j,H,W,moji) while(True): farm = [] cnt = 0 H, W = list(map(int, input().split())) if H == 0 and W == 0: break for i in range(H): farm.append(list(input())) for i in range(H): for j in range(W): if farm[i][j] == '+': continue cnt += 1 infection(i, j,H,W,moji) print(cnt)
Traceback (most recent call last): File "/tmp/tmpr1vg6o44/tmp0gb8r08n.py", line 12, in <module> H, W = list(map(int, input().split())) ^^^^^^^ EOFError: EOF when reading a line
s659556503
p00118
u618725557
1509890106
Python
Python3
py
Runtime Error
0
0
605
def infection(i, j): if farm[i][j] == moji: farm[i][j] = '+' if j + 1 < W : infection(i, j + 1) if i + 1 < H : infection(i + 1, j) if j - 1 >= 0 :infection(i, j - 1) if i - 1 >= 0 :infection(i - 1, j) while True: farm = [] cnt = 0 H, W = list(map(int, input().split())) if H == 0 and W == 0: break for i in range(H): farm.append(list(input())) for i in range(H): for j in range(W): if farm[i][j] == '+': continue cnt += 1 moji = farm[i][j] infection(i, j) print(cnt)
Traceback (most recent call last): File "/tmp/tmpy_pbhrd4/tmpc5xuv6qu.py", line 12, in <module> H, W = list(map(int, input().split())) ^^^^^^^ EOFError: EOF when reading a line
s901289578
p00118
u043254318
1526744858
Python
Python3
py
Runtime Error
0
0
1020
def search(table, visited, i, j, c): visited[i][j] = True if table[i-1][j] == c and visited[i-1][j] == False: search(table, visited, i-1, j, c) if table[i+1][j] == c and visited[i+1][j] == False: search(table, visited, i+1, j, c) if table[i][j-1] == c and visited[i][j-1] == False: search(table, visited, i, j-1, c) if table[i][j+1] == c and visited[i][j+1] == False: search(table, visited, i, j+1, c) return while True: H,W = [int(i) for i in input().split()] if H == 0 and W == 0: break visited = [[False for i in range(W+2)] for j in range(H+2)] table = [["." for i in range(W+2)] for j in range(H+2)] for i in range(1, H+1): s = input() for j in range(1, W+1): table[i][j] = s[j-1] ans = 0 for i in range(1, H+1): for j in range(1, W+1): if visited[i][j] == False: ans = ans + 1 search(table, visited, i, j, table[i][j]) print(ans)
Traceback (most recent call last): File "/tmp/tmpg0sni4pl/tmpc6a_1tv5.py", line 16, in <module> H,W = [int(i) for i in input().split()] ^^^^^^^ EOFError: EOF when reading a line
s267399255
p00118
u352394527
1527713967
Python
Python3
py
Runtime Error
0
0
581
while True: h, w = map(int, input().split()) if not h: break mp = [list("X" + input() + "X") for _ in range(h)] mp.insert(0, ["X"] * (w + 2)) mp.append(["X"] * (w + 2)) direct = ((0, 1), (0, -1), (1, 0), (-1, 0)) def search(x, y, target): mp[y][x] = "X" for dx, dy in direct: nx, ny = x + dx, y + dy if mp[ny][nx] == target: search(nx, ny, target) ans = 0 for x in range(1, w + 1): for y in range(1, h + 1): target = mp[y][x] if target != "X": search(x, y, target) ans += 1 print(ans)
Traceback (most recent call last): File "/tmp/tmpu40vx9_k/tmp_0cqawc1.py", line 2, in <module> h, w = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line