結果

問題 No.179 塗り分け
ユーザー 👑 KazunKazun
提出日時 2020-11-18 02:24:00
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 621 ms / 3,000 ms
コード長 599 bytes
コンパイル時間 299 ms
コンパイル使用メモリ 87,112 KB
実行使用メモリ 79,544 KB
最終ジャッジ日時 2023-09-30 21:35:31
合計ジャッジ時間 15,801 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,484 KB
testcase_01 AC 77 ms
71,440 KB
testcase_02 AC 86 ms
76,504 KB
testcase_03 AC 78 ms
71,284 KB
testcase_04 AC 94 ms
76,772 KB
testcase_05 AC 169 ms
77,920 KB
testcase_06 AC 169 ms
78,940 KB
testcase_07 AC 275 ms
78,148 KB
testcase_08 AC 294 ms
78,436 KB
testcase_09 AC 303 ms
78,572 KB
testcase_10 AC 466 ms
78,680 KB
testcase_11 AC 425 ms
78,584 KB
testcase_12 AC 414 ms
78,304 KB
testcase_13 AC 91 ms
76,212 KB
testcase_14 AC 86 ms
76,612 KB
testcase_15 AC 74 ms
71,388 KB
testcase_16 AC 76 ms
71,388 KB
testcase_17 AC 75 ms
71,352 KB
testcase_18 AC 470 ms
79,132 KB
testcase_19 AC 472 ms
79,072 KB
testcase_20 AC 438 ms
78,788 KB
testcase_21 AC 381 ms
78,436 KB
testcase_22 AC 515 ms
78,672 KB
testcase_23 AC 530 ms
78,976 KB
testcase_24 AC 351 ms
78,920 KB
testcase_25 AC 381 ms
79,252 KB
testcase_26 AC 445 ms
79,408 KB
testcase_27 AC 467 ms
78,812 KB
testcase_28 AC 584 ms
79,544 KB
testcase_29 AC 590 ms
78,920 KB
testcase_30 AC 576 ms
79,284 KB
testcase_31 AC 621 ms
78,820 KB
testcase_32 AC 551 ms
79,036 KB
testcase_33 AC 573 ms
78,536 KB
testcase_34 AC 619 ms
79,240 KB
testcase_35 AC 586 ms
78,936 KB
testcase_36 AC 75 ms
71,396 KB
testcase_37 AC 76 ms
71,364 KB
testcase_38 AC 77 ms
71,292 KB
testcase_39 AC 81 ms
76,332 KB
testcase_40 AC 83 ms
76,516 KB
testcase_41 AC 76 ms
71,376 KB
testcase_42 AC 91 ms
76,656 KB
testcase_43 AC 134 ms
77,552 KB
testcase_44 AC 188 ms
78,556 KB
testcase_45 AC 121 ms
77,848 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

H,W=map(int,input().split())
S=[input() for _ in range(H)]

Flag=0
for y in range(0,H+1):
    for x in range(-(W-1),W):
        if x==y==0:
            continue

        T=[[int(S[y][x]=="#") for x in range(W)] for y in range(H)]
        G=1
        K=0

        for b in range(H):
            for a in range(W):
                if T[b][a]:
                    if 0<=b+y<H and 0<=a+x<W and T[b+y][a+x]:
                        T[b][a]=T[b+y][a+x]=0
                        K=1
                    else:
                        G=0
        Flag|=G&K

if Flag:
    print("YES")
else:
    print("NO")

0