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
s135223525
p03574
u151305655
1575239036
Python
Python (3.4.3)
py
Runtime Error
18
2940
470
h,w = map(int,input().split()) Array = [list(map(str,input())) for _ in range(h)] 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 Array[i][j]='#': continue num=0 for d in range(8): ni = i+dy[d] nj = j+dx[d] if ni<0 or h<=ni: cont...
s177079529
p03574
u151305655
1575238895
Python
Python (3.4.3)
py
Runtime Error
17
3060
470
h,w = map(int,input().split()) Array = [list(map(int,input())) for _ in range(h)] 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 Array[i][j]='#': continue num=0 for d in range(8): ni = i+dy[d] nj = j+dx[d] if ni<0 or h<=ni: cont...
s172633222
p03574
u151305655
1575238800
Python
Python (3.4.3)
py
Runtime Error
17
2940
479
h,w = map(int,input().split()) Array = [list(map(int,input().split())) for _ in range(h)] 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 Array[i][j]='#': continue num=0 for d in range(8): ni = i+dy[d] nj = j+dx[d] if ni<0 or h<=ni: ...
s973646511
p03574
u151305655
1575238708
Python
Python (3.4.3)
py
Runtime Error
17
2940
483
h,w = map(int,input().split()) Array = [list(map(int,input().split())) for _ in range(h)] 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 Array[i][j]='#': continue num=0 for d in range(8): ni = i+dy[d] nj = j+dx[d] if ni<0 or h<=ni: ...
s889833776
p03574
u151305655
1575238661
Python
Python (3.4.3)
py
Runtime Error
18
2940
484
h,w = map(int,input().split()) Array = [list(map(int, input().split())) for _ in range(h)] 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 Array[i][j]='#': continue num=0 for d in range(8): ni = i+dy[d] nj = j+dx[d] if ni<0 or h<=ni: ...
s960458539
p03574
u151305655
1575238645
Python
Python (3.4.3)
py
Runtime Error
17
3060
485
h,w = map(int, input().split()) Array = [list(map(int, input().split())) for _ in range(h)] 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 Array[i][j]='#': continue num=0 for d in range(8): ni = i+dy[d] nj = j+dx[d] if ni<0 or h<=ni: ...
s384780442
p03574
u151305655
1575238599
Python
Python (3.4.3)
py
Runtime Error
17
2940
501
h,w = map(int, input().split()) Array = [list(map(int, input().split())) for _ in range(h)] 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 Array[i][j]='#': continue num=0 for d in range(8): ni = i+dy[d] nj = j+dx[d] if ni<0 or h<...
s976432193
p03574
u151305655
1575238475
Python
Python (3.4.3)
py
Runtime Error
17
3060
507
h,w = map(int, input().split()) Array = [list(map(int, input().split())) for _ in range(h)] 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 Array[i][j]='#': continue num=0 for d in range(8): ni = i+dy[d] nj = j+dx[d] if ni<0 or h<...
s963165054
p03574
u151305655
1575238423
Python
Python (3.4.3)
py
Runtime Error
17
2940
494
h,w = int(input()) Array = [list(map(int, input().split())) for _ in range(h)] 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 Array[i][j]='#': continue num=0 for d in range(8): ni = i+dy[d] nj = j+dx[d] if ni<0 or h<=ni: ...
s150843277
p03574
u151305655
1575238380
Python
Python (3.4.3)
py
Runtime Error
17
2940
494
h,w = int(input()) Array = [list(map(int, input().split())) for _ in range(h)] 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 Array[i][j]='#': continue num=0 for d in range(8): ni = i+dx[d] nj = j+dy[d] if ni<0 or h<=ni: ...
s294118321
p03574
u151305655
1575238363
Python
Python (3.4.3)
py
Runtime Error
17
2940
494
h,w = int(input()) Array = [list(map(int, input().split())) for _ in range(h)] 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 Array[i][j]='#': continue num=0 for d in range(8): ni = i+dx[d] nj = j+dj[d] if ni<0 or h<=ni: ...
s972776665
p03574
u088974156
1574836156
Python
Python (3.4.3)
py
Runtime Error
17
3060
246
h,w=map(int,input().split()) s=[int for _ in range (h)] for i in range(h): l="" for j in range(w): if s[i][j]=="#": l+="#" else: l+=str(sum([t[max(0,j-1):min(w,j+2)].count("#") for t in s[max(0,i-1):min(h,i+2)]])) print(l)
s688235506
p03574
u088974156
1574836123
Python
Python (3.4.3)
py
Runtime Error
17
3060
246
h,w=map(int,input().split()) s=[int for _ in range (h)] for i in range(h): l="" for j in range(w): if s[i][j]=="#": l+="#" else: l+=str(sum([t[max(0,j-1):min(w,j+2)].count("#") for t in s[max(0,i-1):min(h,i+2)]])) print(l)
s251117994
p03574
u727787724
1573857882
Python
Python (3.4.3)
py
Runtime Error
24
3448
5945
h,w=map(int,input().split()) s=[] cnt=0 for i in range(h): s.append(list(input())) if h==1 and w==1: if s[0][0]=='#': print('#') else: print(0) elif h==1: for i in range(w): if s[0][i]=='#': continue if i==0: if s[0][i+1]=='#': cnt+...
s475902637
p03574
u727787724
1573857794
Python
Python (3.4.3)
py
Runtime Error
23
3448
5945
h,w=map(int,input().split()) s=[] cnt=0 for i in range(h): s.append(list(input())) if h==1 and w==1: if s[0][0]=='#': print('#') else: print(0) elif h==1: for i in range(w): if s[0][i]=='#': continue if i==0: if s[0][i+1]=='#': cnt+...
s696256348
p03574
u727787724
1573857669
Python
Python (3.4.3)
py
Runtime Error
23
3448
5945
h,w=map(int,input().split()) s=[] cnt=0 for i in range(h): s.append(list(input())) if h==1 and w==1: if s[0][0]=='#': print('#') else: print(0) elif h==1: for i in range(w): if s[0][i]=='#': continue if i==0: if s[0][i+1]=='#': cnt+...
s562539090
p03574
u727787724
1573856566
Python
Python (3.4.3)
py
Runtime Error
23
3320
4727
h,w=map(int,input().split()) s=[] cnt=0 for i in range(h): s.append(list(input())) if h==1 and w==1: if s[0][0]=='#': print('#') else: print(0) else: for j in range(h): for k in range(w): if j==0: if s[j][k]=='#': continue ...
s331559737
p03574
u727787724
1573856282
Python
Python (3.4.3)
py
Runtime Error
23
3320
4149
h,w=map(int,input().split()) s=[] cnt=0 for i in range(h): s.append(list(input())) for j in range(h): for k in range(w): if j==0: if s[j][k]=='#': continue else: if k==0: if s[j][k+1]=='#': cnt+=1 ...
s159538954
p03574
u348868667
1573788926
Python
Python (3.4.3)
py
Runtime Error
24
3064
593
H,W = map(int,input().split()) S = [list(input()) for i in range(H)] S.insert(0,[0]*W) S.append([0]*W) for i in range(len(S)): S[i].insert(0,0) S[i].append(0) dx = [1,0,-1,0,1,-1,-1,1] dy = [0,1,0,-1,1,1,-1,-1] tmp = [[0] * W for i in range(H)] for i in range(1,H+1): for j in range(1,W+1): if S[i][j...
s808539159
p03574
u469063372
1573018243
Python
Python (3.4.3)
py
Runtime Error
22
3320
3337
h, w = list(map(int, input().split())) s = [input() for i in range(h)] ans = [[0] * w for i in range(h)] for i in range(h): for j in range(w): count = 0 # print(i, j) if s[i][j] == '#': ans[i][j] = '#' continue if i == 0: if j == 0: ...
s282343971
p03574
u768896740
1572710622
Python
Python (3.4.3)
py
Runtime Error
27
3572
896
h, w = map(int, input().split()) mine_area = [] output = [[0 for _ in range(w)] for _ in range(h)] def check_num(i, j): a = i - 1 b = i + 1 c = j - 1 d = j + 1 if i == 0: a = i elif i == h-1: b = i if j == 0: c = j elif j == w-1: d = j count = 0 ...
s341165329
p03574
u638282348
1572576774
Python
PyPy3 (2.4.0)
py
Runtime Error
179
38324
465
import numpy as np h, w = map(int, input().rstrip("\n").split()) array = np.array([[" "] * (w + 2)] + [list(" " + input().rstrip("\n") + " ") for _ in range(h)] + [[" "] * (w + 2)]) list_ = [] for i in range(1, h + 1): for j in range(1, w + 1): if array[i][j] == "#": list_.append("#") ...
s587642569
p03574
u814986259
1571807816
Python
Python (3.4.3)
py
Runtime Error
17
3064
731
H,W=map(int,input().split()) s=[list(input()) for i in range(H)] for i in range(H): ans=[0]*W for i in range(W): if s[i][j]=="#": ans[j]=="#" continue count=0 if i > 0: if s[i-1][j]=="#": count+=1 if j > 0: if s[i-1][j-1]=="#": count+=1 if j < W-1:...
s708546377
p03574
u755363325
1570336633
Python
PyPy3 (2.4.0)
py
Runtime Error
252
46188
6013
import sys h, w = map(int,input().split()) s = [] for i in range(h): s.append(list(input())) ans = [[] for _ in range(h)] if h == 1 and w == 1: print(s[0][0]) sys.exit() elif h == 1 and w == 2: if s[0][0] == ".": if s[0][1] == "#": ans[0].append(1) else: ans[0].ap...
s672810086
p03574
u755363325
1570335782
Python
PyPy3 (2.4.0)
py
Runtime Error
231
44268
5137
h, w = map(int,input().split()) s = [] for i in range(h): s.append(list(input())) ans = [[] for _ in range(h)] for i in range(h): if i == 0: for j in range(w): if j == 0: if s[i][j] == ".": count = 0 if s[i][j+1] == "#": ...
s417255989
p03574
u027929618
1569988261
Python
Python (3.4.3)
py
Runtime Error
18
3064
530
h,w=map(int,input().split()) list2=[[0 for i in range(w)]for j in range(h)] list1 = [input().split() for _ in range(w)] dx=[-1,-1,-1,0,0,1,1,1] dy=[-1,0,1,-1,1,-1,0,1] for j in range(h): for i in range(w): if list1[j][i]=="#": for k in range(8): xk=i+dx[k] yk=j+dy[k] if xk>=0 and xk<w and yk>=0...
s287660761
p03574
u027929618
1569988202
Python
Python (3.4.3)
py
Runtime Error
18
3064
530
h,w=map(int,input().split()) list2=[[0 for i in range(w)]for j in range(h)] list1 = [input().split() for _ in range(h)] dx=[-1,-1,-1,0,0,1,1,1] dy=[-1,0,1,-1,1,-1,0,1] for j in range(h): for i in range(w): if list1[j][i]=="#": for k in range(8): xk=i+dx[k] yk=j+dy[k] if xk>=0 and xk<w and yk>=0...
s658692187
p03574
u027929618
1569988130
Python
Python (3.4.3)
py
Runtime Error
17
2940
531
h,w=map(int,input().split()) list2=[[0 for i in range(w)]for j in range(h)] list1 = [for _ in range(h) input().split()[] dx=[-1,-1,-1,0,0,1,1,1] dy=[-1,0,1,-1,1,-1,0,1] for j in range(h): for i in range(w): if list1[j][i]=="#": for k in range(8): xk=i+dx[k] yk=j+dy[k] if xk>=0 and xk<w and yk>=...
s116077072
p03574
u381246791
1569437441
Python
Python (3.4.3)
py
Runtime Error
17
3064
840
# -*- coding:utf-8 -*- H,W=map(int,input().split()) boxes=list() boxes[0]=[0]*W boxes[H+1]=[0]*W for i in range(H): boxes[i+1]=list() boxes[i+1][0]=0 bowes[i+1][W+1]=0 x=input() for j in range(W): if x[j]=='.': boxes[i+1][j+1]=0 elif x[j]=='#': boxes[i+1][j+1]=1 answer=list() for n in rang...
s106125572
p03574
u820052258
1569436160
Python
Python (3.4.3)
py
Runtime Error
25
3572
1173
h,w=map(int,input().split()) s=[] c = [[0] * w for i in range(h)] s.append(input()) for i in range(h): if i<h-1: s.append(input()) for j in range(w): p=[] if s[i][j] == '#': c[i][j] = '#' else: if i ==0: if j==0: p=s[i][j:j+...
s857366751
p03574
u820052258
1569387050
Python
Python (3.4.3)
py
Runtime Error
25
3572
1100
h,w=map(int,input().split()) s=[] c = [[0] * w for i in range(h)] s.append(input()) for i in range(h): if i<h-1: s.append(input()) for j in range(w): p=[] if i ==0: if j==0: p=s[i][j:j+2]+s[i+1][j:j+2] elif 0<j<w-1: p=s[i][j-1:j+2]+...
s125257446
p03574
u820052258
1569386483
Python
Python (3.4.3)
py
Runtime Error
26
3572
1075
h,w=map(int,input().split()) s=[] c = [[0] * w for i in range(h)] s.append(input()) for i in range(h): if i<h-1: s.append(input()) for j in range(w): p=[] if i ==0 and j==0: p=s[i][j:j+2]+s[i+1][j:j+2] elif i==0 and 0<j<w-1: p=s[i][j-1:j+2]+s[i+1][j-1:j+2]...
s697004479
p03574
u820052258
1569386303
Python
Python (3.4.3)
py
Runtime Error
26
3572
1059
h,w=map(int,input().split()) s=[] for i in range(h): s.append(input()) c = [[0] * w for i in range(h)] for i in range(h): for j in range(w): p=[] if i ==0 and j==0: p=s[i][j:j+2]+s[i+1][j:j+2] elif i==0 and 0<j<w-1: p=s[i][j-1:j+2]+s[i+1][j-1:j+2] elif i=...
s457057148
p03574
u420522278
1569034670
Python
Python (3.4.3)
py
Runtime Error
17
3064
489
h,w = map(int, input().split()) m = [] for y in range(h): s = input() l = [] for i in s: if i == '#': l.append(1) else: l.append(0) print(m) for y in range(h): s = '' for x in range(w): bomb = 0 for i,j in ((-1,-1),(-1,0),(-1,1),(0,-1),(0,1),(1,-1),(1,0),(1,1)): if y+j < 0 o...
s083770520
p03574
u152638361
1568350882
Python
Python (3.4.3)
py
Runtime Error
23
3188
1097
H, W = map(int,input().split()) S = [list(input()) for i in range(H)] ansm = [[""]*W for i in range(H)] for i in range(H): for j in range(W): cnt = 0 if S[i][j]=="#": ansm[i][j]="#" else: if i>0 and j>0: if S[i-1][j-1]=="#": cnt +=1...
s644460435
p03574
u152638361
1568350711
Python
Python (3.4.3)
py
Runtime Error
24
3188
1097
H, W = map(int,input().split()) S = [list(input()) for i in range(H)] ansm = [[""]*W for i in range(H)] for i in range(H): for j in range(W): cnt = 0 if S[i][j]=="#": ansm[i][j]="#" else: if i>0 and j>0: if S[i-1][j-1]=="#": cnt +=1...
s385969724
p03574
u152638361
1568350615
Python
Python (3.4.3)
py
Runtime Error
23
3188
1097
H, W = map(int,input().split()) S = [list(input()) for i in range(H)] ansm = [[""]*W for i in range(H)] for i in range(H): for j in range(W): cnt = 0 if S[i][j]=="#": ansm[i][j]="#" else: if i>0 and j>0: if S[i-1][j-1]=="#": cnt +=1...
s316134183
p03574
u405660020
1568047008
Python
Python (3.4.3)
py
Runtime Error
31
3188
536
import itertools h, w = map(int, input().split()) s = [list(input()) for _ in range(h)] for i in range(w): for j in range(h): cnt=0 if s[i][j]!="#": for dx,dy in itertools.product([-1,0,1],repeat=2): x=i+dx y=j+dy if x<0 or x>=w: ...
s618647823
p03574
u408791346
1567291812
Python
Python (3.4.3)
py
Runtime Error
22
3188
553
h, w = map(int, input().split()) s = list(list(input()) for _ in range(h)) ans=[] for i in range(h): s[i].insert(0, '.') s[i].insert(-1,'.') s.insert(0, ['.', '.','.', '.', '.', '.', '.']) s.insert(-1,['.', '.','.', '.', '.', '.', '.']) for i in range(1,h+1): for j in range(1,w+1): k = s[i-1][j-...
s945524297
p03574
u703890795
1567231856
Python
Python (3.4.3)
py
Runtime Error
24
3320
1996
#全日本汚いコード選手権Pythonの部 H, W = map(int, input().split()) S = [] for i in range(H): S.append(list(input())) L = [[0 for w in range(W)] for h in range(H)] if S[0][1]=="#": L[0][0]+=1 if S[1][0]=="#": L[0][0]+=1 if S[1][1]=="#": L[0][0]+=1 if S[H-1][1]=="#": L[H-1][0]+=1 if S[H-2][0]=="#": L[H-1][0]+=1 if S[H-2...
s626392647
p03574
u703890795
1567231126
Python
Python (3.4.3)
py
Runtime Error
24
3320
1996
#全日本汚いコード選手権Pythonの部 H, W = map(int, input().split()) S = [] for i in range(H): S.append(list(input())) L = [[0 for w in range(W)] for h in range(H)] if S[0][1]=="#": L[0][0]+=1 if S[1][0]=="#": L[0][0]+=1 if S[1][1]=="#": L[0][0]+=1 if S[W-1][1]=="#": L[W-1][0]+=1 if S[W-2][0]=="#": L[W-1][0]+=1 if S[W-2...
s966035426
p03574
u703890795
1567231025
Python
Python (3.4.3)
py
Runtime Error
24
3320
1996
#全日本汚いコード選手権Pythonの部 H, W = map(int, input().split()) S = [] for i in range(H): S.append(list(input())) L = [[0 for w in range(W)] for h in range(H)] if S[0][1]=="#": L[0][0]+=1 if S[1][0]=="#": L[0][0]+=1 if S[1][1]=="#": L[0][0]+=1 if S[W-1][1]=="#": L[W-1][0]+=1 if S[W-2][0]=="#": L[W-1][0]+=1 if S[W-2...
s772542937
p03574
u617515020
1567170199
Python
Python (3.4.3)
py
Runtime Error
23
3320
2154
H,W = map(int,input().split()) S = [] for i in range(H): S.append(list(input())) if H == 1: if W == 1: if S[0][0] == '.': S[0][0] = str(0) print("".join(S[0])) exit() if W == 2: if S[0][0] == '.' and S[0][1] == '.': S[0][0] = str(0) S[0][1] = str(0) elif S[0][0] == '.' and...
s607790949
p03574
u617515020
1567168298
Python
Python (3.4.3)
py
Runtime Error
23
3192
1392
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] == '.': if i == 0: if j == 0: cnt = S[i][:j+2].count('#') + S[i+1][:j+2].count('#') S[i][j] = str(cnt) elif 0 < j < W - 1: cnt = ...
s976604756
p03574
u077291787
1567062860
Python
Python (3.4.3)
py
Runtime Error
18
3064
819
# ABC075B - Minesweeper def check_neighbors(i: int, j: int) -> int: # count the number of landmines adjacent to S[i][j] ret = 0 for x, y in neighbors: a, b = i + x, j + y if 0 <= a < H and 0 <= b < W: ret += 1 if S[a][b] == "#" else 0 return ret def main(): global S, ne...
s702450780
p03574
u484710012
1566418952
Python
Python (3.4.3)
py
Runtime Error
18
3064
424
H,W = map(int,input().split()) mine_map = [list(input().split()) for x in range(H)] for i in range(H): for j in range(W): count = 0 if mine_map[i][j] == ".": for k in range(-1,2): for l in range(-1,2): if i+k >= 0 and i+k < H and j+l >= 0 and j+l < W: if mine_map[i+k][j+l] ...
s405150521
p03574
u484710012
1566418572
Python
Python (3.4.3)
py
Runtime Error
17
3064
426
H,W = map(int,input().split()) mine_map = [list(input().split()) for x in range(H)] for i in range(H): for j in range(W): count = 0 if mine_map[i][j] == ".": for k in range(-1,2): for l in range(-1,2): if i+k >= 0 and i+k < H and j+l >= 0 and j+l < W: if mine_map[i+k][j+l] ...
s591525629
p03574
u921168761
1566415567
Python
Python (3.4.3)
py
Runtime Error
31
3188
522
H, W = map(int, input().split()) S = [] for _ in range(H): S.append(list(input())) d = [[1, 0], [1, 1], [0, 1], [-1, 1], [-1, 0], [-1, -1], [0, -1], [1, -1]] for i in range(H): for j in range(W): if S[i][j] == '.': cnt = 0 for r in range(8): x = i + d[r][0] ...
s100140800
p03574
u371530330
1566352743
Python
Python (3.4.3)
py
Runtime Error
18
3320
1858
h = int(input()) w = int(input()) s = [list(input() for i in range(h))] t = s.copy() number = [] cnt = 0 for i in range(h) : if 1 <= i and i <= h-2 : for j in range(w) : if j >= 1 and j < w-1 : number = [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]] ...
s818696611
p03574
u371530330
1566340322
Python
Python (3.4.3)
py
Runtime Error
17
2940
1191
h = int(input()) w = int(input()) s = list(input() for i in range(1,h+1) number = [] cnt = 0 for i in range(1,h+1) : if i != 1 and i != h : for j in range(1,w+1) : if j != 1 and j != w : number = [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]] cnt =...
s330207122
p03574
u221280246
1566180860
Python
Python (3.4.3)
py
Runtime Error
18
3060
134
N=int(input()) v=[int(x) for x in input().split()] cnt=0 while cnt<N-1: v.sort() v[0]=(v[0]+v.pop(1))/2 cnt+=1 print(v[0])
s622126981
p03574
u248670337
1566175211
Python
Python (3.4.3)
py
Runtime Error
21
3316
251
h,w=map(int,input().split()) s=[input() for i in range(h)] for i in range(h): l="" for j in range(w): if s[i][j]=="#": l+="#" else: l+=str(sum(t[max(0,j-1):min(w,j+2)].count("#") for t in t[max(0,i-1):min(h,i+2)])) print(l)
s294057565
p03574
u430223993
1566082779
Python
Python (3.4.3)
py
Runtime Error
23
3192
1864
h, w = map(int, input().split()) s = [input() for _ in range(h)] for i, m in enumerate(s): for j in range(w): if m[j] != '#': if w == 1: if i == 0: count = s[1][0].count('#') elif i == h-1: count = s[-2][0].count('#') ...
s652084655
p03574
u430223993
1566076852
Python
Python (3.4.3)
py
Runtime Error
23
3188
1232
h, w = map(int, input().split()) s = [input() for _ in range(h)] for i, m in enumerate(s): for j in range(w): if m[j] != '#': if i == 0: if j == 0: count = s[i+1][:2].count('#') + m[1].count('#') elif j == w-1: count = s[i+1...
s601580688
p03574
u430223993
1566076307
Python
Python (3.4.3)
py
Runtime Error
27
3572
1291
h, w = map(int, input().split()) s = [input() for _ in range(h)] for i, m in enumerate(s): for j in range(w): if m[j] != '#': if i == 0: if j == 0: count = s[i+1][:2].count('#') + m[1].count('#') elif j == w-1: count = s[i+1...
s775367040
p03574
u647767910
1566056619
Python
PyPy3 (2.4.0)
py
Runtime Error
195
40300
3390
h, w = map(int, input().split()) s = [list(input()) for _ in range(h)] ans = [[0] * w for _ in range(h)] for i in range(h): for j in range(w): count = 0 if s[i][j] == '.': if i == 0: if s[i+1][j] == '#': count += 1 if j == 0: ...
s372328733
p03574
u131634965
1566055778
Python
Python (3.4.3)
py
Runtime Error
17
2940
1161
H, W = map(int, input().split()) INPUT = [list(input()) for i in range(H)] OUTPUT = INPUT.copy() for i in range(H): for j in range(W): if INPUT[i][j] == '#': OUTPUT[i][j] = '#'a else: OUTPUT[i][j] = 0 for I in (i-1, i, i+1): if not (I < 0 or H <=...
s580345704
p03574
u131634965
1566055750
Python
Python (3.4.3)
py
Runtime Error
17
2940
581
H, W = map(int, input().split()) INPUT = [list(input()) for i in range(H)] OUTPUT = INPUT.copy() for i in range(H): for j in range(W): if INPUT[i][j] == '#': OUTPUT[i][j] = '#'a else: OUTPUT[i][j] = 0 for I in (i-1, i, i+1): if not (I < 0 or H <=...
s609838471
p03574
u131634965
1566055637
Python
Python (3.4.3)
py
Runtime Error
18
3064
634
H, W = map(int, input().split()) INPUT = [list(input()) for i in range(H)] OUTPUT = INPUT.copy() for i in range(H): for j in range(W): if INPUT[i][j] == '#': OUTPUT[i][j] = '#' continue else: OUTPUT[i][j] = 0 for I in (i-1, i, i+1): ...
s680513934
p03574
u131634965
1566055505
Python
Python (3.4.3)
py
Runtime Error
18
3064
583
H, W = map(int, input().split()) INPUT = [list(input()) for i in range(H)] OUTPUT = INPUT.copy() for i in range(H): for j in range(W): if INPUT[i][j] == '#': OUTPUT[i][j] = '#' else: OUTPUT[i][j] = 0 for I in (i-1, i, i+1): if not (I < 0 or l <...
s850407210
p03574
u896741788
1565989207
Python
Python (3.4.3)
py
Runtime Error
17
3064
452
gyou,retu=map(int,input().split()) l=[input() for _ in range(gyou)] d=[(-1,-1),(-1,0),(-1,1),(0,-1),(0,1),(1,-1),(1,0),(1,1)] for g in range(gyou): preans=str() for r in range(retu): s=0 if l[g][r]=="#": preans += "#" else: for x in range(8): a,b=*d[x] try: if l[g+a...
s313873358
p03574
u131634965
1565980860
Python
Python (3.4.3)
py
Runtime Error
28
3192
1689
h, w=map(int, input().split()) s=[list(input()) for _ in range(h)] def hantei(count,k,l): if s[k][l]=="#": count+=1 return count for i in range(h): for j in range(w): if s[i][j]==".": count=0 if i ==0: if j==0: for k,l in zip([i,i...
s899847657
p03574
u037221289
1565504911
Python
Python (3.4.3)
py
Runtime Error
18
3064
354
H,W=map(int,input().split()) S = [ input() for _ in range(H) ] for h in range(H): L = '' for w in range(W): if S[h][w] == '#': L += '#' else: x = 0 for dh in [ -1, 0, 1]: for dw in [-1, 0, 1]: if 0 <= h + dh < H and 0 <= w + dw < W and S[h+dh][w+dw] == '#': x ...
s419068087
p03574
u797016134
1565191049
Python
Python (3.4.3)
py
Runtime Error
17
3064
299
for i in range(h): for j in range(w): if s[i][j] == "0": for k in range(8): if 0 <= j+y[k] < w and 0 <= i+x[k] < h and s[i+x[k]][j+y[k]] == "#": s[i][j] = str(int(s[i][j])+1) for i in range(h): print("".join(s[i]))
s050978494
p03574
u852517668
1565148026
Python
Python (3.4.3)
py
Runtime Error
174
12484
388
import numpy as np H, W = map(int, input().split()) A = [] for i in range(H): A.append(input()) for i in range(H): for j in range(W): if A[i][j] == '#': print('#', end='') count = 0 for k in range(min(0, i-1), max(i+1, H-1)+1): for l in range(min(0, j-1), max(j+1, W-1)+1): if A[k...
s705926776
p03574
u948524308
1565114365
Python
Python (3.4.3)
py
Runtime Error
23
3192
1272
H,W = map(int,input().split()) S = [input() for i in range(H)] A = [["#"]*W for i in range(H)] for i in range(W): for j in range(H): if S[j][i]==".": if i ==0 and j ==0: A[j][i] =str(S[0][0:2].count("#")+S[1][0:2].count("#")) elif i ==W-1 and j ==0: A...
s471976702
p03574
u380524497
1565108338
Python
Python (3.4.3)
py
Runtime Error
22
3192
2674
h, w = map(int, input().split()) board = [] for i in range(h): line = input() board.append(line) new_board = [] for y in range(h): temp_text = '' if y == 0: for x in range(w): if board[y][x] == '#': temp_text = temp_text + '#' else: if...
s276677704
p03574
u830054172
1565092558
Python
Python (3.4.3)
py
Runtime Error
25
3320
2040
a,b = list(map(int, input().split())) s = [input() for i in range(a)] num = [] for i in range(a): ss = s[i] numm = [] for j in range(b): if ss[j]== ".": numm.append(0) else: numm.append("#") num.append(numm) #四隅の判定 if num[0][0] == 0: if num[0][1] == "#": ...
s377356844
p03574
u466330895
1565030729
Python
Python (3.4.3)
py
Runtime Error
18
3064
2379
## グリッドに関する処理 # ABC075B_Minesweeper ## 考え方:pandasに入れて、df.ilocによる行×列のスライスでうまくやる ## for test # # 1 # height, width = 3, 5 # _s_list = ['.....', '.#.#.', '.....'] # # 2 # height, width = 3, 5 # _s_list = ['#####', '#####', '#####'] # 3 # height, width = 6, 6 # _s_list = ['#####.', '#.#.##', '####.#', '.#..#.', '#.##.....
s227743050
p03574
u466330895
1565027122
Python
Python (3.4.3)
py
Runtime Error
18
3064
802
import pandas as pd height, width = map(int, input().split()) _s_list = [input() for i in range(height)] s_list = [list(ss) for ss in _s_list] df = pd.DataFrame(s_list) ans_list = [] for _h in range(height): for _w in range(width): if _h <= 1: h_s = 0 else: h_s = _h-1 ...
s577047503
p03574
u466330895
1565027009
Python
Python (3.4.3)
py
Runtime Error
17
3064
2088
## グリッドに関する処理 # ABC075B_Minesweeper ## 考え方:pandasに入れて、df.ilocによる行×列のスライスでうまくやる ## for test # # 1 # height, width = 3, 5 # _s_list = ['.....', '.#.#.', '.....'] # # 2 # height, width = 3, 5 # _s_list = ['#####', '#####', '#####'] # # 3 # height, width = 6, 6 # _s_list = ['#####.', '#.#.##', '####.#', '.#..#.', '#.##...
s779041780
p03574
u466330895
1565026854
Python
PyPy3 (2.4.0)
py
Runtime Error
169
38256
2088
## グリッドに関する処理 # ABC075B_Minesweeper ## 考え方:pandasに入れて、df.ilocによる行×列のスライスでうまくやる ## for test # # 1 # height, width = 3, 5 # _s_list = ['.....', '.#.#.', '.....'] # # 2 # height, width = 3, 5 # _s_list = ['#####', '#####', '#####'] # # 3 # height, width = 6, 6 # _s_list = ['#####.', '#.#.##', '####.#', '.#..#.', '#.##...
s101562865
p03574
u466330895
1565019007
Python
Python (3.4.3)
py
Runtime Error
18
3064
1903
## グリッドに関する処理 # ABC075B_Minesweeper ## 考え方:pandasに入れて、df.ilocによる行×列のスライスでうまくやる ## for test # 1 # height, width = 3, 5 # _s_list = ['.....','.#.#.','.....'] ## for submit import pandas as pd height, width = map(int, input().split()) _s_list = [input() for i in range(h)] s_list = [list(ss) for ss in _s_list] # 列×行に1文...
s389680341
p03574
u466330895
1565018877
Python
PyPy3 (2.4.0)
py
Runtime Error
181
38256
1901
## グリッドに関する処理 # ABC075B_Minesweeper ## 考え方:pandasに入れて、df.ilocによる行×列のスライスでうまくやる ## for test # 1 #height, width = 3, 5 #_s_list = ['.....','.#.#.','.....'] ## for submit import pandas as pd height, width = map(int, input().split()) _s_list = [input() for i in range(h)] s_list = [list(ss) for ss in _s_list] # 列×行に1文字ず...
s382471261
p03574
u466330895
1565018805
Python
PyPy3 (2.4.0)
py
Runtime Error
174
38256
1894
## グリッドに関する処理 # ABC075B_Minesweeper ## 考え方:pandasに入れて、df.ilocによる行×列のスライスでうまくやる ## for test # 1 # height, width = 3, 5 # _s_list = ['.....','.#.#.','.....'] ## for submit import pandas as pd h, w = map(int, input().split()) _s_list = [input() for i in range(h)] s_list = [list(ss) for ss in _s_list] # 列×行に1文字ずつ区切ってリス...
s008029501
p03574
u333190709
1564754142
Python
PyPy3 (2.4.0)
py
Runtime Error
169
38640
354
S = [] for _ in range(h): S.append(input()) for i in range(h): ss = '' for j in range(w): if S[i][j] == '#': ss += '#' else: counter = 0 for k in [-1, 0, 1]: for l in [-1, 0, 1]: if 0 <= i+k <= h-1 and 0 <= j+l <= w-1 and S[i+k][j+l] == '#': counter += 1 ...
s069145852
p03574
u528748570
1564586203
Python
Python (3.4.3)
py
Runtime Error
17
3064
591
H, W = map(int, input().split()) M = [["."*W]] M = [[".", *input(), "."] for i in range(H)] M.insert(0,[*("."*(W+2))]) M.append([*("."*(W+2))]) cnt = 0 Ans = [] for i in range(1, H+1): for j in range(1, W+1): if M[i][j] == ".": for k in range(-1, 2): if M[i+k][j-1] == "#": ...
s850997111
p03574
u626337957
1564545461
Python
Python (3.4.3)
py
Runtime Error
19
3064
573
H, W = map(int, input().split()) fields = [['.'] * (W+2)] + [['.'] + list(input()) + ['.'] for _ in range(H)] + [['.'] * (W+2)] for i in range(1, H+1): for j in range(1, W+1): if fields[i][j] == '#': continue else: mine_cnt = 0 if fields[i][j-1] == '#': mine_cnt += 1 if fields...
s044911302
p03574
u626337957
1564545405
Python
Python (3.4.3)
py
Runtime Error
20
3064
570
H, W = map(int, input().split()) fields = [['.'] * (W+2)] + [['.'] + list(input()) + ['.'] for _ in range(W)] + [['.'] * (W+2)] for i in range(1, H+1): for j in range(1, W+1): if fields[i][j] == '#': continue else: mine_cnt = 0 if fields[i][j-1] == '#': mine_cnt += 1 if fields...
s932893948
p03574
u445624660
1564535114
Python
Python (3.4.3)
py
Runtime Error
26
3188
629
# いつもの探索でいいです 終了 h, w = map(int, input().split()) table = [] for _ in range(h): table.append(list(input())) for i in range(h): for j in range(w): if table[i][j] != "#": sub_h = [0] if h==0 else [-1, 0, 1] if 0<i<h-1 else [0, 1] if i==0 else [-1, 0] sub_w = [0] if w==0 else [-1, 0, 1] if 0<j<w-1 el...
s029087754
p03574
u445624660
1564534830
Python
Python (3.4.3)
py
Runtime Error
26
3188
595
# いつもの探索でいいです 終了 h, w = map(int, input().split()) table = [] for _ in range(h): table.append(list(input())) for i in range(h): for j in range(w): if table[i][j] != "#": sub_h = [-1, 0, 1] if 0<i<h-1 else [0, 1] if i==0 else [-1, 0] sub_w = [-1, 0, 1] if 0<j<w-1 else [0, 1] if j==0 else [-1, 0] ...
s395677606
p03574
u668503853
1563860936
Python
Python (3.4.3)
py
Runtime Error
17
3064
728
H,W=map(int,input().split()) S=[list(input()) for i in range(H)] for i in range(H): for j in range(W): if s[i][j]=='#': continue #もし見ている文字が#だったら通過 cnt=0 for k in [-1,0,1]: if i+k<0 or H<=i+k: continue #iが端の時通過 fo...
s877869117
p03574
u668503853
1563860907
Python
Python (3.4.3)
py
Runtime Error
17
3064
728
H,W=map(int,input().split()) S=[list(input()) for i in range(H)] for i in range(H): for j in range(W): if s[i][j]=='#': continue #もし見ている文字が#だったら通過 cnt=0 for k in [-1,0,1]: if i+k<0 or H<=i+k: continue #iが端の時通過 fo...
s693045778
p03574
u668503853
1563860797
Python
Python (3.4.3)
py
Runtime Error
18
3064
728
H,W=map(int,input().split()) S=[list(input()) for i in range(H)] for i in range(H): for j in range(W): if s[i][j]=='#': continue #もし見ている文字が#だったら通過 cnt=0 for k in [-1,0,1]: if i+k<0 or H<=i+k: continue #iが端の時通過 fo...
s324761573
p03574
u083960235
1563595609
Python
Python (3.4.3)
py
Runtime Error
55
5196
1546
import sys, re, os from collections import deque, defaultdict, Counter from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians from itertools import permutations, combinations, product, accumulate from operator import itemgetter, mul from copy import deepcopy from string import ascii_lowercase, ascii_upper...
s461061758
p03574
u214434454
1563475397
Python
Python (3.4.3)
py
Runtime Error
17
3064
413
h,w =map(int,input().split()) s = [input() for i in range(h)] dx = [1,1,1,0,0,-1,-1,-1] dy = [1,-1,0,1,-1,1,-1,0] for i in range(h): for j in range(w): for k in range(8): x = i + dx[k] y = j + dy[k] count = 0 if x >= 0 and x <= h-1 and y >= 0 and y<= w-1 and s...
s128364679
p03574
u214434454
1563472974
Python
Python (3.4.3)
py
Runtime Error
28
3320
2202
h,w =map(int,input().split()) s = [input() for i in range(h)] s_out =[] for i in range(h): s_out.append("") def mine(a): count = 0 for i in range(len(a)): if a[i] == "#": count += 1 return count if h == 1 and w == 1: if s[0][0] == "#": print("#") sys.exit() ...
s628293550
p03574
u214434454
1563471629
Python
Python (3.4.3)
py
Runtime Error
28
3192
1383
h,w =map(int,input().split()) s = [input() for i in range(h)] s_out =[] for i in range(h): s_out.append("") def mine(a): count = 0 for i in range(len(a)): if a[i] == "#": count += 1 return count for i in range(h): for j in range(w): if s[i][j] == "#": ...
s941276029
p03574
u214434454
1563470940
Python
Python (3.4.3)
py
Runtime Error
27
3192
1383
h,w =map(int,input().split()) s = [input() for i in range(h)] s_out =[] for i in range(h): s_out.append("") def mine(a): count = 0 for i in range(len(a)): if a[i] == "#": count += 1 return count for i in range(h): for j in range(w): if s[i][j] == "#": ...
s223525969
p03574
u390901183
1563419307
Python
Python (3.4.3)
py
Runtime Error
150
12432
731
import numpy as np def main(): H, W = list(map(int, input().split())) s = [input() for i in ragne(H)] ans = [] for row in s: ans.append(list(row)) diffs = [(-1, -1), (-1, 0), (-1, 1), (0, -1), (0, 1), (1, -1), (1, 0), (1, 1)] for y in range(H): for x in range(W): ...
s440872309
p03574
u790812284
1563116348
Python
Python (3.4.3)
py
Runtime Error
36
3444
313
h,w=map(int,input().split()) s=[input() for i in range(h)] for i in range(h): for j in range(w): c=0 for a in range(i-1,i+2): for b in range(j-1,j+2): c+=all((min(a,b)>=0,a<h,b<w))and s[a][b]=='#' if s[i][j]=='.':s[i][j]=c for a in s: print(*a,sep='')
s404153713
p03574
u233588813
1562902875
Python
Python (3.4.3)
py
Runtime Error
19
3064
532
a,b=[int(input()) for i in range(2)] c=[str(input()) for i in range(a)] for i in range(a): c[i]="."+c[i]+"." c=["."*(b+2)]+c +["."*(b+2)] d=[["0"for i in range(b)]for j in range(a)] for i in range(1,a+1): for j in range(1,b+1): f=0 for k in range(-1,2): for l in range(-1,2): if c[i+k][j+l]=="#...
s390186518
p03574
u233588813
1562899564
Python
Python (3.4.3)
py
Runtime Error
18
3064
458
a,b=[int(input()) for i in range(2)] c=[str(input()) for i in range(a)] for i in range(a): c[i]="."+c[i]+"." c=["."*(b+2)]+c +["."*(b+2)] d=[[0 for i in range(b)] for j in range(a)] for i in range(1,a+2): for j in range(1,b+2): for k in range(-1.2): for l in range(-1,2): if c[i+k[j+l]]=="#" ...
s837587824
p03574
u221061152
1562475013
Python
Python (3.4.3)
py
Runtime Error
18
3064
718
H,W = map(int,input().split()) grid = [[0 for w in range(W)] for h in range(H)] sharps = [] for h in range(H): row = input() #print(row) for w,r in enumerate(row): #print(w,r) if r == "#": #grid[h][w] = "#" sharps.append([h,w]) if h>=1: grid[h-1][w] += 1 if w>=1: ...
s972907909
p03574
u221061152
1562474952
Python
Python (3.4.3)
py
Runtime Error
18
3064
717
H,W = map(int,input().split()) grid = [[0 for w in range(W)] for h in range(H)] sharps = [] for h in range(H): row = input() print(row) for w,r in enumerate(row): #print(w,r) if r == "#": #grid[h][w] = "#" sharps.append([h,w]) if h>=1: grid[h-1][w] += 1 if w>=1: ...
s281366188
p03574
u221061152
1562474119
Python
Python (3.4.3)
py
Runtime Error
18
3064
610
H,W = map(int,input().split()) grid = [[0]*W]*H for h in range(H): row = input.split() for w,r in enumerate(row): if r == "#": if h>=1: grid[h-1][w] += 1 if w>=1: grid[h-1][w-1] += 1 if w<=W-1: grid[h-1][w+1] += 1 if h<=H-1: grid[h+1][w] += 1 ...
s864146423
p03574
u905268546
1561097252
Python
Python (3.4.3)
py
Runtime Error
17
3064
842
H, W = map(int, input().split()) S = [["."] * (W + 2)] for _ in range(H): S.append([".", *list(input()), "."]) S.append(["."] * (W + 2)) ans = [[-1] * W for _ in range(H)] for i in range(1, H + 1): for j in range(1, W + 1): if S[i][j] == "#": continue cnt = 0 if S[i - 1][j ...
s589289952
p03574
u259861571
1560995178
Python
Python (3.4.3)
py
Runtime Error
17
3064
421
h, w = list(map(int, input().strip().split())) s = [list(input) for i in range(h)] for i in range(h): for j in range(w): if s[i][j] == '#': continue count = 0 for a in range(i-1, i+2): for b in range(j-1, j+2): c += all((min(a,b)>=0, a < h, b < w)) an...
s405221084
p03574
u623687794
1560888920
Python
Python (3.4.3)
py
Runtime Error
17
3064
570
h,w=map(int,input().split()) field=[] nfield=[[] for i in range(h)] 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 nu...
s376516659
p03574
u062459048
1560481232
Python
Python (3.4.3)
py
Runtime Error
158
12512
1674
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] == "#": pass elif i == 0 and j == 0: temp_list = [x[i,j+1],x[i+1,j],x[i+1,j+1]] counts ...