s_id
stringlengths
10
10
p_id
stringlengths
6
6
u_id
stringlengths
10
10
date
stringlengths
10
10
language
stringclasses
1 value
original_language
stringclasses
11 values
filename_ext
stringclasses
1 value
status
stringclasses
1 value
cpu_time
stringlengths
1
5
memory
stringlengths
1
7
code_size
stringlengths
1
6
code
stringlengths
1
539k
s196783072
p03574
u062459048
1560480598
Python
Python (3.4.3)
py
Runtime Error
157
12548
1682
H, W = map(int, input().split()) import numpy as np x = np.empty((H,W), dtype=object) for i in range(H): x[i,] = map(int, input().split()) temp_list = [] for i in range(H): for j in range(W): if x[i,j] == "#": continue elif i == 0 and j == 0: temp_list = [x[i,j+1],x[i+1,j],x[i+1,j+1]] cou...
s371782793
p03574
u623687794
1560461064
Python
Python (3.4.3)
py
Runtime Error
18
3064
423
h,w=map(int,input().split()) field=[] for i in range(n): field.append(input()) def check(a,b): num=0 if field[a][b]=="#": return for i in range(a-1,a+2): for j in range(b-1,b+2): try: if field[i][j]=="#": num+=1 except: pass return num for i in range(h): for j i...
s648549368
p03574
u062459048
1560438744
Python
Python (3.4.3)
py
Runtime Error
301
21264
1426
H, W = map(int, input().split()) import numpy as np x = np.zeros((H,W)) for i in range(H): x[i,] = map(int, input().split()) temp_list = [] for i in range(H): for j in range(W): if x[i,j] == "#": continue elif i == 0 and j == 0: temp_list = [x[i,j+1],x[i+1,j:j+1]] counts = temp_list.count...
s374607079
p03574
u701318346
1560028098
Python
Python (3.4.3)
py
Runtime Error
23
3448
6995
H, W = map(int, input().split()) S = [input() for _ in range(H)] S_ans = [[0 for i in range(W)] for j in range(H)] for j in range(H): for i in range(W): if S[j][i] == '#': S_ans[j][i] = '#' # 左端のケース if j == 0: # 上下端のケース if i == 0 and i ==...
s437701094
p03574
u463655976
1559999101
Python
Python (3.4.3)
py
Runtime Error
17
2940
442
H, W = map(int, input().split()) Ss = [[-1 if c == "#" else 0 for c in input()] for _ in range(H)] def plus(i, j): if 0 <= i < H and 0 <= j < W: if Ss[i][j] >= 0: Ss[i][j] += 1 for i in range(H): for j in range(W): for x, y in ((x,y) for x in range(-1, 2) for y in range(-1, 2): if x != 0 or y...
s853734195
p03574
u172111219
1559873882
Python
PyPy3 (2.4.0)
py
Runtime Error
180
38896
518
h,w = map(int,input().split()) s = [[x for x in input()] for _ in range(h)] ls = ['.' for i in range(w)] s.insert(0,ls) s.insert(-1,ls) for i in range(h+2): s[i].insert(0,".") s[i].insert(-1,".") for j in range(1,h+1): for k in range(1,w+1): if s[i][j] == ".": ls = [ls[j-1][...
s974651651
p03574
u313402971
1559328900
Python
Python (3.4.3)
py
Runtime Error
17
3064
392
import numpy as np H,W = (int(n) for n in input().split()) arr =np.zeros((H,W),dtype=int) mines = [] for h in range(H): row = list(input()) for w in range(W): if(row[w]=="#"): arr[h-1:h+2,w-1:w+2] += 1 mines.append((h,w)) arr = arr.astype(str) for mine in mines: ...
s567439323
p03574
u078777263
1559325643
Python
Python (3.4.3)
py
Runtime Error
18
3064
1115
H,W = map(int,input().split()) matrix = [] for i in range(H): matrix.append(list(input())) for h in range(H): for w in range(W): if matrix[h][w] != '#': matrix[h][w] = str(check_nmine(h,w,matrix)) for i in matrix: print("".join(i)) def check_nmine(h,w,matrix): cou...
s129796367
p03574
u078777263
1559325375
Python
Python (3.4.3)
py
Runtime Error
18
3064
1214
H,W = map(int,input().split()) # make iremono matrix = [] for i in range(H): matrix.append(list(input())) #rows = sample_input.split("\n") #matrix = [list(r) for r in rows] ans = matrix.copy() for h in range(H): for w in range(W): if matrix[h][w] != '#': ans[h][w] = str(check_nmine(h,w,...
s955776434
p03574
u220345792
1558223086
Python
Python (3.4.3)
py
Runtime Error
18
3064
512
H, W = map(int, input().split()) data = [] for i in range(H): S.append(input()) # 参考https://atcoder.jp/contests/abc075/submissions/5409794 for i in range(H): for j in range(W): if S[i][j] == ".": cnt = 0 if i != 0: cnt += S[i-1][min(0, j-1) : min(j+1, W-1) + 1].count("#") cnt += S[i][m...
s266964584
p03574
u722189950
1558143870
Python
Python (3.4.3)
py
Runtime Error
22
3192
964
#https://atcoder.jp/contests/abc075/tasks/abc075_b?lang=ja H, W = map(int, input().split()) s = [list(input()) for _ in range(H)] for i in range(H): for j in range(W): count = 0 if s[i][j] == ".": if i > 0 and j > 0 and s[i-1][j-1] == "#": # count +=1 if i > 0...
s403524042
p03574
u743154453
1558120680
Python
Python (3.4.3)
py
Runtime Error
44
3064
539
h, w = map(int,input().split()) s = [] dx = [-1,0,1,-1,1,-1,0,1] dy = [1,1,1,0,0,-1,-1,-1] for _ in range(h): s.append(input()) type(s[1][1]) for i in range(h): for j in range(w): if s[i][j] == '.': num = 0 for k in range(8): ni = i + dx[k] nj = j + dy[k] if ni < 0 or h <=...
s648235804
p03574
u743154453
1558120078
Python
Python (3.4.3)
py
Runtime Error
43
3064
530
h, w = map(int,input().split()) s = [] dx = [-1,0,1,-1,1,-1,0,1] dy = [1,1,1,0,0,-1,-1,-1] for _ in range(h): s.append(input()) type(s[1][1]) for i in range(h): for j in range(w): if s[i][j] == '.': num = 0 for k in range(8): ni = i + dx[k] nj = j + dy[k] if ni < 0 or h <=...
s889721308
p03574
u590253847
1558048829
Python
Python (3.4.3)
py
Runtime Error
25
3188
1028
H,W=map(int,input().split()) Ws=W+2 Hs=H+2 root= [[0] * Ws for i in range(Hs)] c=0 for i in range(H): I ="" I = input() print(I) for j in range(W): print("youso is ",I[j]) k = I[j] root[i+1][j+1]=k root2= [[0] * W for i in range(H)] for i in range(H): for j in range(W):...
s199082106
p03574
u108377418
1557895661
Python
Python (3.4.3)
py
Runtime Error
28
3572
903
def main(): h, w = map(int, input().split()) grid = [] for height in range(0, h): grid.append(list(input())) replaced = [] for height in range(0, h): replaced.append([0] * w) dx = [0, 0, 1, 1, 1, -1, -1, -1] dy = [1, -1, 1, -1, 0, 1, -1, 0] for height in range(0, h): ...
s250688521
p03574
u845937249
1557806048
Python
Python (3.4.3)
py
Runtime Error
18
3064
626
# スペース区切りの整数の入力 h, w = map(int, input().split()) # 2次元行列のリストを作る。 list1 = [[0 for i in range(h)] for j in range(w)] print(list1) #list1[1][2] = 1 #list1[0][0] = "#" #list1[1][1] = "." #print(list1) #print(list1[-1][-1]) #print(list1[0][0]) #list1[0:] = [int(input()) for i in range(h)] #print(list1) s = [0] * w ...
s422013489
p03574
u020373088
1557660967
Python
Python (3.4.3)
py
Runtime Error
18
3064
349
h, w = map(int, input().split()) s = ["a"*(w+2)] + ["a" + input() + "a" for i in range(h)] + ["a"*(w+2)] for i in range(1, h+1): for j in range(1, w+1): if s[i][j] != "#": c = [s[i-1][j-1], s[i-1][j], s[i-1][j+1], s[i][j-1], s[i][j+1], s[i+1][j-1], s[i+1][j], s[i+1][j+1]] s[i][j] = str(c.count("#")) ...
s764293706
p03574
u548545174
1556314200
Python
Python (3.4.3)
py
Runtime Error
31
3572
504
import copy H, W = map(int, input().split()) S = [list(input()) for _ in range(H)] ans = copy.deepcopy(S) dx = [1, 1, 0, -1, -1, -1, 0, 1] dy = [0, -1, -1, -1, 0, 1, 1, 1] for i in range(H): for j in range(W): if S[i][j] == ".": cnt = 0 for dir in range(8): try: ...
s788116323
p03574
u103902792
1556300785
Python
Python (3.4.3)
py
Runtime Error
18
3064
450
H,W= map(int,input().split()) mine = [list(input()) for i in range(H)] def count(ch): return 1 if ch == '#' else 0 for i in range(H): for j in range(W): num = 0 if mine[i][j] == '#': continue else: for k in range(-1,2): for l in range(-1,2): num += (1 if mine[i+k][j+l]=='...
s821725069
p03574
u103902792
1556300741
Python
Python (3.4.3)
py
Runtime Error
18
3064
427
H,W= map(int,input().split()) mine = [list(input()) for i in range(H)] def count(ch): return 1 if ch == '#' else 0 for i in range(H): for j in range(W): num = 0 if mine[i][j] == '#': continue else: for k in range(-1,2): for l in range(-1,2): num += (1 if mine[i+k][j+l]=='...
s752535404
p03574
u103902792
1556299148
Python
Python (3.4.3)
py
Runtime Error
27
3680
1582
H,W= map(int,input().split()) mine = [list(input()) for i in range(H)] def count(ch): return 1 if ch == '#' else 0 for i in range(H): for j in range(W): if mine[i][j] == '#': continue else: num = 0 if (i == 0): if(j == 0): mine[0][0] = count(mine[0][1]) + count(mine[1][...
s965841737
p03574
u247623772
1555041693
Python
Python (3.4.3)
py
Runtime Error
17
2940
259
h,w=map(int,input().split()) s=[input() for _ in range(h)] for i in range(h): l = "" for j in range(w): if s[i][j] == "#": l += "#" else: l += sum(s[t][max(0,j-1):min(w,j+2)].count("#") for t in [max(0,i-1):min(h,i+2)]) print(l)
s078461457
p03574
u771532493
1554663632
Python
Python (3.4.3)
py
Runtime Error
24
3188
472
h,w=map(int,input().split()) l=[[0]*(w+2)] for i in range(h): a=list(input()) a.insert(0,0) a.append(0) l.append(a) l.append([0]*(w+2)) pointx=[-1,0,1] pointy=[-1,0,1] for i in range(1,h+1): for j in range(1,w+1): if l[i][j]=='.': count=0 for k in pointx: for m in pointy: if ...
s508148968
p03574
u771532493
1554663411
Python
Python (3.4.3)
py
Runtime Error
24
3188
470
h,w=map(int,input().split()) l=[[0]*(w+2)] for i in range(h): a=list(input()) a.insert(0,0) a.append(0) l.append(a) l.append([0]*(w+2)) pointx=[-1,0,1] pointy=[-1,0,1] for i in range(1,h+1): for j in range(1,w+1): count=0 if l[i][j]=='.': for k in pointx: for m in pointy: if l[...
s408304036
p03574
u633355062
1554510336
Python
Python (3.4.3)
py
Runtime Error
18
3064
364
h,w=map(int,input().split()) s=[list(input()) for _ in range(h)] for i in range(h): for j in range(w): if s[i][j]=='#': continue cnt=0 for dx in [-1,0,1]: for dy in [-1,0,1]: if not(0<=dx+i<=h and 0<=dy+j<=w): continue if s[i+dx][j+dy]=='#': cnt+=1 s[i]...
s337172680
p03574
u227476288
1552938215
Python
Python (3.4.3)
py
Runtime Error
23
3576
5063
#ABC 075 B - Minesweeper H, W = input().split() H = int(H) W = int(W) S = [input() for i in range(H)] if H == 1: for w in range(1,W-1): s = S[0][w] if s == '.': count = 0 if S[0][w-1] == '#': count+=1 if S[0][w+1] == '#': count+=1 S[0] = S[0][:w] + st...
s223370870
p03574
u227476288
1552937888
Python
Python (3.4.3)
py
Runtime Error
23
3448
4480
#ABC 075 B - Minesweeper H, W = input().split() H = int(H) W = int(W) S = [input() for i in range(H)] if H == 1: for w in range(1,W-1): s = S[0][w] if s == '.': count = 0 if S[0][w-1] == '#': count+=1 if S[0][w+1] == '#': count+=1 S[0] = S[0][:w] + st...
s607363561
p03574
u227476288
1552937219
Python
Python (3.4.3)
py
Runtime Error
23
3448
3860
#ABC 075 B - Minesweeper H, W = input().split() H = int(H) W = int(W) S = [input() for i in range(H)] for w in range(1,W-1): s = S[0][w] if s == '.': count = 0 if S[0][w-1] == '#': count+=1 if S[0][w+1] == '#': count+=1 if S[1][w-1] == '#': count+=1 if S[1][w] == '#': c...
s225726780
p03574
u367130284
1552548222
Python
PyPy3 (2.4.0)
py
Runtime Error
166
38256
367
from numpy import* a,b=map(int,input().split()) c=["0"]*(b+2) x=[list("0"+input().replace(".","0").replace("#","1")+"0")for i in range(a)] x.insert(0,c) x.append(c) x=array(x).astype(int) for s in range(1,1+a): tmp="" for t in range(1,1+b): if x[s][t]==1: tmp+="#" else: t...
s330772666
p03574
u375616706
1552351024
Python
Python (3.4.3)
py
Runtime Error
29
3064
689
# python template for atcoder1 import sys sys.setrecursionlimit(10**9) H, W = map(int, input().split()) grid = [["#"]*(W+2) for _ in range(H+2)] for i in range(1, H+1): s = input() for j, c in enumerate(s): grid[i][j+1] = c cntGrid = [[0]*(W+2) for _ in range(H+2)] for i in range(1, H+1): for j ...
s090846510
p03574
u282228874
1552336317
Python
Python (3.4.3)
py
Runtime Error
23
3192
1898
import sys sys.setrecursionlimit(10**9+7) h,w = map(int,input().split()) s = [input() for i in range(h)] for i in range(h): ans = '' for j in range(w): if s[i][j] == '#': ans += '#' else: if i != 0 and j!= 0 and i != h-1 and j!= w-1: up = s[i-1][j-1:j+2]....
s539814175
p03574
u282228874
1552336100
Python
Python (3.4.3)
py
Runtime Error
23
3192
1873
h,w = map(int,input().split()) s = [input() for i in range(h)] for i in range(h): ans = '' for j in range(w): if s[i][j] == '#': ans += '#' else: if i != 0 and j!= 0 and i != h-1 and j!= w-1: up = s[i-1][j-1:j+2].count('#') parallel = s[i][...
s330236988
p03574
u282228874
1552335586
Python
Python (3.4.3)
py
Runtime Error
22
3192
1741
h,w = map(int,input().split()) s = [input() for i in range(h)] for i in range(h): ans = '' for j in range(w): if s[i][j] == '#': ans += '#' else: if i != 0 and j!= 0 and i != h-1 and j!= w-1: up = s[i-1][j-1:j+2].count('#') pa = s[i][j-1:j+...
s463000050
p03574
u282228874
1552335345
Python
Python (3.4.3)
py
Runtime Error
23
3192
1749
h,w = map(int,input().split()) s = [input() for i in range(h)] for i in range(h): ans = '' for j in range(w): if s[i][j] == '#': ans += '#' else: if i != 0 and j!= 0 and i != h-1 and j!= w-1: up = s[i-1][j-1:j+2].count('#') pa = s[i][j-1:j+...
s631623604
p03574
u393512980
1552243952
Python
Python (3.4.3)
py
Runtime Error
17
3064
417
h, w = map(int, input().split()) f = [input() for _ in range(h)] for i in range(h): for j in range(w): if f[i][w] == '#': print('#', end = "") continue cnt = 0 for k in range(i-1, i+2): if k < 0 or h <= k: continue for l in range(j-1, j+2): if l < 0 or w <= l: ...
s647272643
p03574
u251123951
1552023829
Python
Python (3.4.3)
py
Runtime Error
23
3192
1057
h,w=map(int,input().split()) masu=[] up=1 down=1 left=1 right=1 for i in range(h): masu.append([i for i in input()]) for i in range(h): for j in range(w): bakudan=0 if masu[i][j]==".": if i==0:up=0 elif i==h-1:down=0 if j==0:left=0 elif j==w-1:righ...
s721941117
p03574
u160244242
1551933047
Python
Python (3.4.3)
py
Runtime Error
22
3064
691
n, m = map(int, input().split()) lst = [input() for _ in range(n)] def check(lst, i, j, n, m): if i == 0: row_lst = [i, i+1] elif i == n-1: row_lst = [i-1, i] else: row_lst = [i-1, i, i+1] if j == 0: col_lst = [j, j+1] elif j == m-1: col_lst = [j-1, j] el...
s820143978
p03574
u370331385
1550989876
Python
Python (3.4.3)
py
Runtime Error
24
3380
2440
a = input().split() H = int(a[0]) W = int(a[1]) S = [] ans_list = [[0]*W]*H print(ans_list) print(type(1)) print(type(ans_list[0][0])) for i in range(H): s = input().split() s = list(s[0]) S.append(s) def counter1(i,j):#上 if(S[i-1][j]=='#'): ans_list[i][j] += 1 def counter2(i,j):#下 if(S[i+1][j]=='#')...
s171348383
p03574
u013408661
1550627810
Python
Python (3.4.3)
py
Runtime Error
18
3064
538
h,w=map(int,input().split()) for i in range(h): line=(str(input())) line2=list(line) mapdata.append(line2) result=[] k=[] def get_bomb(i,j): count=0 for x in (i-1,i,i+1): for y in (j-1,j,j+1): if 0<=x<=h-1 and 0<=y<=w-1: if mapdata[x][y]=='#': count+=1 return count for i in range...
s557443952
p03574
u013408661
1550627580
Python
Python (3.4.3)
py
Runtime Error
17
3064
539
h,w=map(int,input().split()) result=[] k=[] def get_bomb(i,j): count=0 for x in (i-1,i,i+1): for y in (j-1,j,j+1): if 0<=x<=h-1 and 0<=y<=w-1: if mapdata[x][y]=='#': count+=1 return count for i in range(h): line=(str(input())) line2=list(line) mapdata.append(line2) for i in range...
s642473372
p03574
u013408661
1550627517
Python
Python (3.4.3)
py
Runtime Error
19
3064
523
h,w=map(int,input().split()) result=[] k=[] def get_bomb(i,j): count=0 for x in (i-1,i,i+1): for y in (j-1,j,j+1): if 0<=x<=h-1 and 0<=y<=w-1: if mapdata[x][y]=='#': count+=1 return count for i in range(h): line=list(str(input())) mapdata.append(line) for i in range(h): for j in ...
s987498566
p03574
u013408661
1550627231
Python
Python (3.4.3)
py
Runtime Error
18
3064
518
h,w=map(int,input().split()) result=[] k=[] def get_bomb(i,j): count=0 for x in (i-1,i,i+1): for y in (j-1,j,j+1): if 0<=x<=h-1 and 0<=y<=w-1: if mapdata[x][y]=='#': count+=1 return count for i in range(h): line=list(input()) mapdata.append(line) for i in range(h): for j in range...
s393428419
p03574
u013408661
1550626930
Python
Python (3.4.3)
py
Runtime Error
23
3064
524
h,w=map(int,input().split()) mapdata=[] result=[] k=[] def get_bomb(i,j): count=0 for x in (i-1,i,i+1): for y in (j-1,j,j+1): if 0<=x<=h-1 and 0<=y<=w-1: if mapdata[x][y]=='#': count+=1 return count for i in range(h): line=list(input()) mapdata.append(line) for i in range(h): for...
s404276994
p03574
u013408661
1550626465
Python
Python (3.4.3)
py
Runtime Error
17
2940
496
h,w=map(int,input().split()) mapdata=[] result=[] k=[] def get_bomb(i,j): count=0 for x in (i-1.i,i+1): for y in (j-1,j,j+1): if 0<=x<=h-1 and 0<=y<=w-1: if mapdata[x][y]=='#': count+=1 return count for i in range(h): line=list(input()) mapdata.append(line) for i in range(h): for...
s094813841
p03574
u962819039
1550195864
Python
Python (3.4.3)
py
Runtime Error
23
3444
708
from sys import stdin h, w = [int(x) for x in stdin.readline().rstrip().split()] matrix = [stdin.readline().rstrip() for _ in range(h)] for i in range(h): matrix[i] = [matrix[i][x:x+1] for x in range(len(matrix[i]))] matrix[i] = [0 if x == '.' else x for x in matrix[i]] for i in range(h): for j in range(w):...
s708208878
p03574
u962819039
1550194749
Python
Python (3.4.3)
py
Runtime Error
18
3064
638
from sys import stdin h, w = [int(x) for x in stdin.readline().rstrip().split()] matrix = [stdin.readline().rstrip() for _ in range(h)] for i in range(h): matrix[i] = [matrix[i][x:x+1] for x in range(len(matrix[i]))] matrix[i] = [0 if x == '.' else x for x in matrix[i]] for i in range(h): for j in range(w):...
s795330960
p03574
u655975843
1550193808
Python
Python (3.4.3)
py
Runtime Error
23
3320
3885
h, w = map(int, input().split()) s = [] for i in range(h): s.append(list(input())) t = [] for i in range(h): temp = [] for j in range(w): count = 0 if s[i][j] != '#': if i == 0: if j == 0: if s[i][j + 1] == '#': count +=...
s938754262
p03574
u794173881
1549951341
Python
Python (3.4.3)
py
Runtime Error
32
3192
1330
h,w = map(int,input().split()) s =[input() for i in range(h)] for i in range(h): for j in range(w): count = 0 if s[i][j]==".": for k in [[0,1],[1,0],[-1,0],[0,-1],[1,1],[-1,-1],[1,-1],[-1,1]]: if 0<=k[0]+i<h and 0<=k[1]+j<w: if s[k[0]+i][k[1]+j]=="#": count = count +1 ...
s903075911
p03574
u333139319
1549901394
Python
Python (3.4.3)
py
Runtime Error
26
3644
4034
[h,w] = [int(i) for i in input().split()] s = [] for i in range(h): s.append(input()) ans1 = [] if h != 1 and w != 1: for i in range(h): ans = [] #上下のエラーを排除 if i != 0 and i != h-1: for j in range(w): #左右のエラーを排除 if j != 0 and j != w-1: ...
s828710719
p03574
u333139319
1549900043
Python
Python (3.4.3)
py
Runtime Error
26
3648
2481
[h,w] = [int(i) for i in input().split()] s = [] for i in range(h): s.append(input()) ans1 = [] for i in range(h): ans = [] #上下のエラーを排除 if i != 0 and i != h-1: for j in range(w): #左右のエラーを排除 if j != 0 and j != w-1: if s[i][j] == ".": ans.a...
s520732349
p03574
u802977614
1549652312
Python
Python (3.4.3)
py
Runtime Error
21
3444
384
h,w=map(int,input().split()) s=[list(input().replace(".","0")) for i in range(h)] for i in range(h): for j in range(w): if s[i][j]=="#": for k in range(-1,2): for l in range(-1,2): if 0<=i+k<=h and 0<=j+l<=w and s[i+k][j+l]!="#": s[i+k][j+l]=str(int(s[i+k][j+l])+1) for i in ran...
s001429145
p03574
u635339675
1548841238
Python
Python (3.4.3)
py
Runtime Error
27
3704
2134
a,b=map(int,input().split()) c=[] for i in range(a): c.append([i for i in input()]) #print(c) #print(c[0][0]) d=[] for i in range(b): d.append([]) for j in range(a): for i in range(b): if c[j][i]=="#": d[j].append("#") else: e=0 if j==0 and i==b-1: if c[0][b-2]=="#": e=e+1 if c[1][b-1]=="#...
s048841379
p03574
u529518602
1548620446
Python
Python (3.4.3)
py
Runtime Error
27
3700
1998
H, W = map(int, input().split()) S = [list(input()) for i in range(H)] ans = [] def one_c(i,j): c_tmp = 0 if S[i][j] == '#': c_tmp += 1 return c_tmp def two_c1(i,j): c_tmp = 0 if S[i][j-1] == '#': c_tmp += 1 if S[i][j] == '#': c_tmp += 1 return c_tmp def two_c2(i,j): c_tmp = 0 if ...
s244521133
p03574
u529518602
1548620081
Python
Python (3.4.3)
py
Runtime Error
27
3700
1936
H, W = map(int, input().split()) S = [list(input()) for i in range(H)] ans = [] def one_c(i,j): c_tmp = 0 if S[i][j] == '#': c_tmp += 1 return c_tmp def two_c1(i,j): c_tmp = 0 if S[i][j-1] == '#': c_tmp += 1 if S[i][j] == '#': c_tmp += 1 return c_tmp def two_c2(i,j): c_tmp = 0 if ...
s028093458
p03574
u861466636
1548027465
Python
Python (3.4.3)
py
Runtime Error
152
12444
651
import numpy as np h, w = map(int, input().split()) num_array = np.zeros((h, w)) space_array = np.ones((h, w)) mine_map = np.array( ((0 if i == "." else 1 for i in input())) for j in range(h)) space_array = mine_map.copy() for i, s in enumerate(mine_map): for j, m in enumerate(s): if m == 1: # m=mass ...
s014865358
p03574
u865067466
1547244841
Python
Python (3.4.3)
py
Runtime Error
18
3064
551
import numpy as np H, W = map(int, input().split(' ')) in_table = [] for h in range(H): line = [*input()] in_table.append(line) result_table = np.zeros((H, W), dtype=np.int8) for y, line in enumerate(in_table): for x, cell in enumerate(line): if cell == '#': result_table[y-1:y+1+1...
s496718950
p03574
u726439578
1546473057
Python
Python (3.4.3)
py
Runtime Error
24
3188
1038
h,w=map(int,input().split()) ms=[] for i in range(h): m=input() ms.append(list(m)) count=0 for i in range(h): for j in range(w): if ms[i][j]==".": if i>0 and j>0: if ms[i-1][j-1]=="#": count+=1 if i>0 : if ms[i-1][j]=="#": ...
s329156462
p03574
u726439578
1546464941
Python
Python (3.4.3)
py
Runtime Error
18
3064
1019
h,w=map(int,input().split()) ms=[] for i in range(3): m=input() ms.append(list(m)) count=0 for i in range(h): for j in range(w): if ms[i][j]==".": if i>0 and j>0 : if ms[i-1][j-1]=="#": count+=1 if i>0 : if ms[i-1][j]=="#": ...
s536173511
p03574
u505420467
1545968150
Python
Python (3.4.3)
py
Runtime Error
18
3064
408
g,r=map(int,input().split()) A=["."]*(r+2) for i in range(g): w="."+input()+"." A.append(w) A.append("."*(r+2)) for i in range(1,g+1): for j in range(1,r+1): if A[i][j]==".": B=[] for m in [i-1,i,i+1]: for k in [j-1,j,j+1]: B.append(A[m][k]) A[i]=A[i][1:r+1:].replace(".",st...
s871212800
p03574
u186838327
1545813911
Python
Python (3.4.3)
py
Runtime Error
23
3192
1454
h, w = map(int, input().split()) s = [0] * h for i in range(h): s[i] = str(input()) t = [[0]*w]*h for j in range(h): if j == 0: for k in range(w): if k == 0: u = s[0][1] + s[1][0] + s[1][1] elif k == w-1: u = s[0][k-1] +s[1][k-1] + s[1][k] ...
s348689372
p03574
u023229441
1545582672
Python
Python (3.4.3)
py
Runtime Error
18
3064
333
g,r=map(int,input().split()) A=["."*r] for i in range(g): w="."+input()+"." A.append(w) A.append("."*r) B=[] for i in range(1,g+1): for j in range(1,r+1): if A[i][j]==".": for m in [i-1,i,i+1]: for k in [j-1,j,j+1]: B=append(A[m][k]) A[i][j]=B.count("#") for i in range(g): prin...
s056678573
p03574
u993642190
1544656825
Python
Python (3.4.3)
py
Runtime Error
27
3064
827
def draw_map(count_map, row_index, col_index) : for i in range(row_index-1, row_index+2) : if (i < 0 or len(count_map) <= i) : continue for j in range(col_index-1, col_index+2) : if (j < 0 or len(count_map[0]) <= j) : continue count_map[i][j] += 1 return count_map H,W = [int(i) fo...
s175751956
p03574
u037098269
1543550407
Python
Python (3.4.3)
py
Runtime Error
23
3448
4994
h,w = map(int, input().split()) m_list = [] for i in range(h): m_list.append([i for i in input()]) for m in range(h): for i in range(w): if m == 0: if i == 0: if m_list[m][i] != "#": m_list[m][i] = 0 x = m_list[m][i] ...
s801341991
p03574
u330039499
1543471590
Python
Python (2.7.3)
py
Runtime Error
157
7168
457
H, W = map(int, raw_input().split()) S = [raw_input() for i in range(H)] C = [[0] * W for i in range(H)] for i in range(H): for j in range(W): for di in range(-1, 1): if i + di < 0 or H <= i + di: continue for dj in range(-1, 1): if j + dj < 0 or W <= ...
s070269537
p03574
u363407238
1542595231
Python
Python (3.4.3)
py
Runtime Error
21
3064
432
h,w = map(int,input().split()) s = ['-' * (w + 2)] for i in range(h): s.append('-' + input() + '-') s.append('-' * (w + 2)) for hi in range(1,h+1): ans='' for wi in range(1,h+1): if s[hi][wi] == '#': ans += '#' else: c = [s[hi-1][wi-1],s[hi][wi-1],s[hi+1][wi-1],s[hi...
s385507390
p03574
u848647227
1542408368
Python
Python (3.4.3)
py
Runtime Error
23
3320
3738
a,b = map(int,input().split(" ")) ar = [list(input()) for i in range(a)] br = [["" for j in range(b)] for k in range(a)] for c in range(a): for d in range(b): count = 0 if ar[c][d] == "#": br[c][d] = "#" else: if c == 0: if d == 0: ...
s820535998
p03574
u448743361
1542100921
Python
Python (3.4.3)
py
Runtime Error
17
2940
693
h,w=map(int,input().split()) s=[] for i in range(h): s.append(str(input())) slist=[list(s[i]) for i in range(h)] ans=[[0 for i in range(w+2)] for j in range(h+2)] for in range(h): for j in range(w): if(slist[i][j]=='#'): ans[i][j] += 1 ans[i][j+1] += 1 ans[i][j+2] +...
s945184302
p03574
u052332717
1541915289
Python
Python (3.4.3)
py
Runtime Error
22
3260
6189
h,w = map(int,input().split()) mine_list = [list(input()) for i in range(h)] for id1 in range(h): outcome = '' for id2 in range(w): if mine_list[id1][id2] == '.': count = 0 if id1 == 0: if id2 == 0: ...
s574387668
p03574
u920299620
1540946923
Python
Python (3.4.3)
py
Runtime Error
30
3192
2117
H,W=map(int,input().split()) field=[[0]*W for i in range(H)] tmp_str=input() if(tmp_str[0]=="#"): field[0][0]="#" field[0][1]+=1 field[1][1]+=1 field[1][0]+=1 for i in range(1,W-1): if(tmp_str[i]=="#"): for k in range(0,2): for l in range(-1,2): try: ...
s485911897
p03574
u920299620
1540946660
Python
Python (3.4.3)
py
Runtime Error
17
3064
2115
H,W=map(int,input().split()) field=[[0]*W for i in range(H)] tmp_str=input() if(tmp_str[0]=="#"): field[0][0]="#" field[0][1]+=1 field[1][1]+=1 field[1][0]+=1 for i in range(1,W-1): if(tmp_str[i]=="#"): for k in range(0,2): for l in range(-1,2): try: ...
s050353489
p03574
u920299620
1540946268
Python
Python (3.4.3)
py
Runtime Error
32
3192
2176
H,W=map(int,input().split()) field=[[0]*W for i in range(H)] tmp_str=input() if(tmp_str[0]=="#"): field[0][0]="#" field[0][1]+=1 field[1][1]+=1 field[1][0]+=1 for i in range(1,W-1): if(tmp_str[i]=="#"): for k in range(0,2): for l in range(-1,2): try: ...
s502836552
p03574
u447528293
1540561268
Python
Python (3.4.3)
py
Runtime Error
29
3572
651
H, W = [int(s) for s in input().rstrip().split()] sqare = [list('.' * (W+2)) for _ in range(H+2)] for i in range(1, H+1): S = list(input().rstrip()) sqare[i][1:H+1] = S bomb = [[0 for _ in range(W+2)] for _ in range(H+2)] for i in range(1, H+1): for j in range(1, W+1): if sqare[i][j] != '#': ...
s064521759
p03574
u447528293
1540560455
Python
Python (3.4.3)
py
Runtime Error
30
3572
670
H, W = [int(s) for s in input().rstrip().split()] sqare = [list('.' * (W+2)) for _ in range(H+2)] for i in range(1, H+1): S = list(input().rstrip()) sqare[i][1:H+1] = S bomb = [[0 for _ in range(W+2)] for _ in range(H+2)] for i in range(1, H+1): for j in range(1, W+1): for x in range(i-1, i+2): ...
s664973267
p03574
u447528293
1540559122
Python
Python (3.4.3)
py
Runtime Error
31
3572
673
H, W = [int(s) for s in input().rstrip().split()] sqare = [list('.' * (W+2)) for _ in range(H+2)] for i in range(1, H+1): S = list(input().rstrip()) sqare[i][1:H+1] = S bomb = [[0 for _ in range(W+2)] for _ in range(H+2)] for i in range(1, H+1): for j in range(1, W+1): for x in range(i-1, i+2):...
s516032631
p03574
u513081876
1539221449
Python
Python (3.4.3)
py
Runtime Error
154
12732
520
import numpy as np ans = [] H, W = map(int, input().split()) S = [] S.append('.'*(W+2)) for i in range(H): S.append('.'+input() + '.') S.append('.'*(W+2)) for y in range(1, H+1): for x in range(1, W+1): if S[y][x] == '.': cnt = S[y][x-1].count('#')+S[y][x+1].count('#')+S[y-1][x-1:x+2].count...
s467218892
p03574
u426108351
1539119937
Python
Python (3.4.3)
py
Runtime Error
27
3064
698
H, W = map(int, input().split()) S = ["..................................................."] for i in range(H): S.append(input()) for i in range(H+1): S[i] = '.' + S[i] + '.' S.append("...................................................") ans = [[0] * W for i in range(H)] for i in range(1,H+1): for j in ra...
s067144969
p03574
u064408584
1538453027
Python
Python (3.4.3)
py
Runtime Error
233
12472
281
import numpy as np h,w=map(int, input().split()) a=[list(input()) for i in range(h)] a=np.array(a) for i in range(h): for j in range(w): if a[i][j]=='.': a[i][j]=sum(sum(a[max(i-1,0):min(i+2,w),max(j-1,0):min(j+2,w)]=='#')) for i in a: print(''.join(i))
s354011604
p03574
u589087860
1538354224
Python
Python (3.4.3)
py
Runtime Error
22
3320
3370
h, w = map(int, input().split()) s = [] for i in range(h): s.append(list(input())) #print(s) count = 0 for i in range(h): for j in range(w): count = 0 if s[i][j] == "#": pass elif i == 0 and j == 0: if s[i][j + 1] == "#": count += 1 ...
s686648916
p03574
u017810624
1536988231
Python
Python (3.4.3)
py
Runtime Error
22
3188
557
h,w=map(int,input().split()) l=[list(input()) for i in range(h)] for x in range(h): for y in range(w): if l[x][y]=='.': c=0 if x>0 and y>0: if l[x-1][y-1]=='#':c+=1 if x>0: if l[x-1][y]=='#':c+=1 if x>0 and y+1<h: if l[x-1][y+1]=='#':c+=1 if y>0: if l[x][y-1]=='#':c+=1 if y+1<h: ...
s993827561
p03574
u967835038
1535918630
Python
Python (3.4.3)
py
Runtime Error
18
3316
2086
h,w=map(int,input().split()) s=[] ans='' anslist=[] minelist=[] for _ in range(h): s.append(list(str(input()))) for i in range(h): for j in range(w): if (s[i])[j]=='#': ans=ans+'#' else: if j==0: if i==0: minelist.append((s[1])[0]) ...
s811417653
p03574
u200239931
1531581800
Python
Python (3.4.3)
py
Runtime Error
22
3320
3590
def getinputdata(): # 配列初期化 array_result = [] data = input() array_result.append(data.split(" ")) flg = 1 try: while flg: data = input() if(data != ""): array_result.append(data.split(" ")) else: ...
s361507225
p03574
u200239931
1531579509
Python
Python (3.4.3)
py
Runtime Error
23
3448
5965
def getinputdata(): # 配列初期化 array_result = [] data = input() array_result.append(data.split(" ")) flg = 1 try: while flg: data = input() if(data != ""): array_result.append(data.split(" ")) else: ...
s757721195
p03574
u200239931
1531578792
Python
Python (3.4.3)
py
Runtime Error
23
3448
6850
def getinputdata(): # 配列初期化 array_result = [] data = input() array_result.append(data.split(" ")) flg = 1 try: while flg: data = input() if(data != ""): array_result.append(data.split(" ")) else: ...
s661678812
p03574
u050698451
1531280534
Python
Python (3.4.3)
py
Runtime Error
19
3192
516
H,W = map(int, input().split()) board = [] for i in range(0,H): board.append(input()) board = list(board) dx = [1, 0, -1, 0, 1, -1, -1, 1] dy = [0, 1, 0, -1, 1, 1, -1, -1] for i in range(0,H): for j in range(0,W): if board[i][j] == '#': continue num = 0 for k in range(0, 8): ni = i + dy[k] nj = j + dx[...
s812530025
p03574
u503283842
1531265504
Python
Python (3.4.3)
py
Runtime Error
27
3448
3450
x=input().split() h=int(x[0]) w=int(x[1]) inp=[0]*h*w for i in range(h): x=input() y=0 r=i*w for j in x: if j=='#': inp[r+y]='#' if h==w and w==1: break if r+y==0: if inp[r+y+1]!='#': inp[r+y+1]+=1 ...
s360117403
p03574
u503283842
1531259264
Python
Python (3.4.3)
py
Runtime Error
29
3324
3398
x=input().split() h=int(x[0]) w=int(x[1]) inp=[0]*h*w for i in range(h): x=input() y=0 r=i*w for j in x: if j=='#': inp[r+y]='#' if r+y==0: if inp[r+y+1]!='#': inp[r+y+1]+=1 if inp[r+y+w]!='#': inp[r+...
s476235522
p03574
u986269893
1531256891
Python
Python (3.4.3)
py
Runtime Error
29
3064
433
hw=input().split() h=int(hw[0]) w=int(hw[1]) mx=[1,1,0,-1,-1,-1,0,1] my=[0,1,1,1,0,-1,-1,-1] grid=[] for t in range(h): row=list(input()) grid.append(row) for i in range(w): for j in range(h): if grid[j][i]==".": ctr=0 for k in range(8): adx=i+mx[k] ady=j+my[k] if adx>=0 and adx<w and ady>=0 and ...
s852970005
p03574
u506302470
1529866037
Python
Python (3.4.3)
py
Runtime Error
17
2940
750
#include<bits/stdc++.h> using namespace std; int N,M; char m[55][55]; int main(){ scanf("%d%d",&N,&M); for(int i=0;i<N;i++){ scanf("%s",m[i+1]+1); } for(int i=1;i<=N;i++){ for(int j=1;j<=M;j++){ int cnt=0; if(m[i][j]=='#')putchar('#'); else { ...
s293931024
p03574
u136395536
1528109538
Python
Python (3.4.3)
py
Runtime Error
18
3064
686
H,W = (int(i) for i in input().split()) original = [input() for i in range(H)] sujimaru = [[0 for i in range(W+2)for j in range(H+2)]] for j in range(H): for i in range(W): if(original[i][j] == "#"): sujimaru[i][j] += 1 sujimaru[i+1][j] += 1 sujimaru[i+2][j] += 1 ...
s055388391
p03574
u136395536
1528109487
Python
Python (3.4.3)
py
Runtime Error
18
3064
686
H,W = (int(i) for i in input().split()) original = [input() for i in range(H)] sujimaru = [[0 for i in range(W+2)for j in range(H+2)]] for j in range(H): for i in range(W): if(original[i][j] == "#"): sujimaru[i][j] += 1 sujimaru[i+1][j] += 1 sujimaru[i+2][j] += 1 ...
s871892695
p03574
u411858517
1527980724
Python
Python (3.4.3)
py
Runtime Error
29
3064
558
W, H=map(int,input().split()) arr = [input() for j in range(W)] ans = ['' for i in range(H)] for i in range(0, W): for j in range(0, H): bomb_num = 0 if arr[i][j] == '#': ans[i] += '#' else: for k in (-1, 0, 1): for l in (-1, 0, 1): ...
s721732607
p03574
u493813116
1521899882
Python
Python (3.4.3)
py
Runtime Error
18
3064
679
# ABC 075 B # H, W = 4, 3 # S = "#.."\ # "..#"\ # ".#."\ # ".#." H, W = map(int, input().split()) S = '' for _ in range(H): S += input() def cell_of(x, y): return S[W*x + y] def neighbor_indice_of(x, y): return [ (x+m, y+n) for m in range(-1, 2) for n in range(-1...
s520081605
p03574
u499259667
1520214287
Python
Python (3.4.3)
py
Runtime Error
20
3316
437
h,w=map(int,input().split()) lis=[] for _ in range(h): lis.append(list(input())) for hi in range(h): for wi in range(w): if lis[hi][wi]==".": c=0 for x,y in [[1,1],[1,0],[1,-1],[0,1],[0,-1],[-1,1],[-1,0],[-1,-1]]: try: if lis[hi+x][y+y]=="#": c+=1 finally: ...
s866930260
p03574
u667024514
1519679856
Python
Python (3.4.3)
py
Runtime Error
19
3064
1211
n,m = map(int,input().split()) lis = [] for i in range(n): a = list(input()) for l in range(m): lis.append(a[l]) for t in range(15): if lis[t] == ".": cou = 0 try: if lis[t-(m+1)] == "#": cou += 1 except: cou = cou try: ...
s517424034
p03574
u319612498
1519443274
Python
Python (3.4.3)
py
Runtime Error
18
3064
464
h,w=map(int,input().split()) a="" for i in range(w+2): a=a+"a" S=[a] for i in range(h): S.append("a"+input()+"a") S.append(a) for i in range(1,h+1): for j in range(1,w+1): if S[i][j]==".": num=0 for u in range(-1,2): for v in range(-1,2): i...
s253923857
p03574
u030726788
1518989069
Python
Python (3.4.3)
py
Runtime Error
33
3064
568
h,w=map(int,input().split()) lis=[] outp=[[0 for i in range(w)] for j in range(h)] outs=[""]*h for i in range(h): lis.append(input()) for i in range(h): for j in range(w): if(lis[i][j]=="#"): for k in range(-1,2): for l in range(-1,2): if(i+k>=0 and i+k<w ...
s791927292
p03574
u756988562
1518676489
Python
Python (3.4.3)
py
Runtime Error
22
3576
3235
H,W = map(int,input().split(" ")) S = [] for i in range(H): S.append(list(input())) for i in range(H): for j in range(W): if S[i][j] == ".": S[i][j] = 0 if H == 1 and W == 1: print(S[0][0]) elif H == 1: if S[0][0] == "#": if S[0][1]!="#": S[0][1]+= 1 if S[0][H]== "#": ...
s287352333
p03574
u756988562
1518675718
Python
Python (3.4.3)
py
Runtime Error
22
3448
2609
H,W = map(int,input().split(" ")) S = [] for i in range(H): S.append(list(input())) for i in range(H): for j in range(W): if S[i][j] == ".": S[i][j] = 0 if H == 1 and W == 1: print(S[0][0]) else: #4隅の処理 if S[0][0] == "#": if S[1][0] !="#": S[1][0]+= 1 if S[0][1] !...
s130864396
p03574
u756988562
1518675365
Python
Python (3.4.3)
py
Runtime Error
21
3448
2326
H,W = map(int,input().split(" ")) S = [] for i in range(H): S.append(list(input())) for i in range(H): for j in range(W): if S[i][j] == ".": S[i][j] = 0 #4隅の処理 if S[0][0] == "#": if S[1][0] !="#": S[1][0]+= 1 if S[0][1] !="#": S[0][1]+= 1 if S[1][1] !="#": S[1][1]+= 1 if S[0][W-1...
s889392223
p03574
u586577600
1515623218
Python
Python (3.4.3)
py
Runtime Error
25
3700
1282
h, w = map(int, input().split()) ss = [list(input()) for i in range(h)] s = list(map(lambda x: list(map(lambda y: 1 if y == '#' else 0, x)), ss)) def calc(x, y): if (x+1) == 1 and (y+1) == 1: return s[x+1][y] + s[x][y+1] + s[x+1][y+1] elif (x+1) == h and (y+1) == 1: return s[x-1][y] + s[x][y+1]...