AtCoder Beginner Contest 096

Submission #6108656

Source codeソースコード

h,w=map(int,input().split())
ss=[list(input()) for i in range(h)]
f=True
s=[["."]*(w+2)]
s.extend(ss)
for i in range(1,h+1):
    s[i].insert(0,".")
    s[i].append(".")
s.append(["."]*(w+2))

for i in range(1,h+1):
    for j in range(1,w+1):
        if s[i][j]=="#":
            if s[i-1][j]!="#" and s[i+1][j]!="#" and s[i][j-1]!="#" and s[i][j+1]!="#":
                f=False
if f:
    print("Yes")
else:
    print("No")

Submission

Task問題 C - Grid Repainting 2
User nameユーザ名 hase
Created time投稿日時
Language言語 PyPy3 (2.4.0)
Status状態 AC
Score得点 300
Source lengthソースコード長 445 Byte
File nameファイル名
Exec time実行時間 191 ms
Memory usageメモリ使用量 39024 KB

Test case

Set

Set name Score得点 / Max score Cases
Sample - sample_01.txt,sample_02.txt,sample_03.txt
All 300 / 300 in01.txt,in02.txt,in03.txt,in04.txt,in05.txt,in06.txt,in07.txt,in08.txt,in09.txt,in10.txt,sample_01.txt,sample_02.txt,sample_03.txt

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
in01.txt AC 173 ms 38640 KB
in02.txt AC 179 ms 38640 KB
in03.txt AC 172 ms 38512 KB
in04.txt AC 173 ms 38512 KB
in05.txt AC 176 ms 38640 KB
in06.txt AC 176 ms 38640 KB
in07.txt AC 178 ms 38896 KB
in08.txt AC 176 ms 38640 KB
in09.txt AC 191 ms 39024 KB
in10.txt AC 182 ms 38896 KB
sample_01.txt AC 174 ms 38256 KB
sample_02.txt AC 173 ms 38256 KB
sample_03.txt AC 167 ms 38256 KB