結果

問題 No.179 塗り分け
ユーザー NoneNone
提出日時 2021-05-01 09:21:02
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 861 bytes
コンパイル時間 271 ms
コンパイル使用メモリ 87,052 KB
実行使用メモリ 78,564 KB
最終ジャッジ日時 2023-09-26 21:39:40
合計ジャッジ時間 7,177 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,592 KB
testcase_01 AC 69 ms
71,280 KB
testcase_02 AC 67 ms
71,304 KB
testcase_03 AC 71 ms
71,468 KB
testcase_04 AC 70 ms
71,176 KB
testcase_05 AC 99 ms
77,420 KB
testcase_06 AC 81 ms
76,572 KB
testcase_07 WA -
testcase_08 AC 134 ms
77,916 KB
testcase_09 AC 135 ms
77,904 KB
testcase_10 AC 110 ms
77,436 KB
testcase_11 AC 110 ms
77,464 KB
testcase_12 AC 136 ms
77,516 KB
testcase_13 AC 71 ms
71,392 KB
testcase_14 AC 75 ms
75,564 KB
testcase_15 AC 69 ms
71,384 KB
testcase_16 AC 68 ms
71,552 KB
testcase_17 WA -
testcase_18 AC 112 ms
77,896 KB
testcase_19 AC 109 ms
77,584 KB
testcase_20 AC 144 ms
77,776 KB
testcase_21 AC 167 ms
78,168 KB
testcase_22 AC 219 ms
78,348 KB
testcase_23 AC 109 ms
77,500 KB
testcase_24 AC 153 ms
78,204 KB
testcase_25 AC 112 ms
77,476 KB
testcase_26 AC 118 ms
77,632 KB
testcase_27 AC 146 ms
78,564 KB
testcase_28 AC 120 ms
77,556 KB
testcase_29 AC 148 ms
78,232 KB
testcase_30 AC 134 ms
78,204 KB
testcase_31 AC 146 ms
78,264 KB
testcase_32 AC 126 ms
77,704 KB
testcase_33 AC 145 ms
78,224 KB
testcase_34 AC 122 ms
77,888 KB
testcase_35 AC 149 ms
77,944 KB
testcase_36 AC 70 ms
71,436 KB
testcase_37 AC 69 ms
71,356 KB
testcase_38 AC 73 ms
71,280 KB
testcase_39 AC 72 ms
71,416 KB
testcase_40 AC 71 ms
71,264 KB
testcase_41 AC 72 ms
71,120 KB
testcase_42 AC 69 ms
71,540 KB
testcase_43 AC 84 ms
76,664 KB
testcase_44 AC 100 ms
77,824 KB
testcase_45 AC 79 ms
76,344 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

H,W=map(int,input().split())
grid=[[0]*W for _ in range(H)]
for h in range(H):
    for w,s in enumerate(input().rstrip()):
        grid[h][w]=s

for h0 in range(-H,H):
    for w0 in range(-W,W):
        if (h0,w0)==(0,0):
            continue
        flg=0
        used=[[0]*W for _ in range(H)]
        for h in range(H):
            for w in range(W):
                if grid[h][w]==".":
                    continue
                if grid[h][w]=="#":
                    if used[h][w]==1:
                        continue
                    if not (h+h0<0 or w+w0<0 or h+h0>=H or w+w0>=W or grid[h+h0][w+w0]=="."):
                        used[h+h0][w+w0]=1
                        continue
                flg=1
                break
            if flg==1:
                break
        if flg==0:
            print("YES")
            exit()
print("NO")

0