結果

問題 No.179 塗り分け
ユーザー nohakai3nohakai3
提出日時 2022-11-04 20:37:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 634 ms / 3,000 ms
コード長 599 bytes
コンパイル時間 330 ms
コンパイル使用メモリ 86,808 KB
実行使用メモリ 79,548 KB
最終ジャッジ日時 2023-09-25 22:47:45
合計ジャッジ時間 16,009 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,204 KB
testcase_01 AC 74 ms
70,996 KB
testcase_02 AC 86 ms
76,352 KB
testcase_03 AC 74 ms
71,240 KB
testcase_04 AC 89 ms
76,800 KB
testcase_05 AC 164 ms
77,912 KB
testcase_06 AC 167 ms
78,592 KB
testcase_07 AC 275 ms
77,996 KB
testcase_08 AC 299 ms
78,068 KB
testcase_09 AC 304 ms
78,456 KB
testcase_10 AC 463 ms
78,860 KB
testcase_11 AC 416 ms
78,456 KB
testcase_12 AC 412 ms
78,216 KB
testcase_13 AC 86 ms
76,148 KB
testcase_14 AC 83 ms
76,568 KB
testcase_15 AC 73 ms
71,440 KB
testcase_16 AC 74 ms
70,980 KB
testcase_17 AC 73 ms
71,280 KB
testcase_18 AC 468 ms
79,064 KB
testcase_19 AC 474 ms
79,116 KB
testcase_20 AC 443 ms
78,756 KB
testcase_21 AC 375 ms
78,512 KB
testcase_22 AC 514 ms
78,672 KB
testcase_23 AC 531 ms
78,984 KB
testcase_24 AC 349 ms
78,568 KB
testcase_25 AC 387 ms
79,132 KB
testcase_26 AC 446 ms
79,548 KB
testcase_27 AC 463 ms
78,624 KB
testcase_28 AC 574 ms
79,380 KB
testcase_29 AC 586 ms
78,784 KB
testcase_30 AC 585 ms
79,248 KB
testcase_31 AC 634 ms
78,728 KB
testcase_32 AC 550 ms
79,016 KB
testcase_33 AC 572 ms
78,568 KB
testcase_34 AC 626 ms
78,936 KB
testcase_35 AC 584 ms
78,696 KB
testcase_36 AC 73 ms
71,476 KB
testcase_37 AC 73 ms
71,224 KB
testcase_38 AC 73 ms
71,336 KB
testcase_39 AC 79 ms
76,160 KB
testcase_40 AC 84 ms
76,112 KB
testcase_41 AC 76 ms
71,404 KB
testcase_42 AC 91 ms
76,684 KB
testcase_43 AC 136 ms
77,540 KB
testcase_44 AC 186 ms
78,460 KB
testcase_45 AC 120 ms
77,788 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