結果

問題 No.179 塗り分け
ユーザー cmycmy
提出日時 2022-06-13 12:59:08
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 879 bytes
コンパイル時間 180 ms
コンパイル使用メモリ 81,728 KB
実行使用メモリ 75,848 KB
最終ジャッジ日時 2023-10-25 22:21:52
合計ジャッジ時間 3,969 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
53,528 KB
testcase_01 AC 34 ms
53,528 KB
testcase_02 AC 34 ms
53,528 KB
testcase_03 AC 34 ms
53,528 KB
testcase_04 AC 33 ms
53,528 KB
testcase_05 AC 56 ms
72,400 KB
testcase_06 AC 35 ms
53,528 KB
testcase_07 WA -
testcase_08 AC 64 ms
75,540 KB
testcase_09 WA -
testcase_10 AC 41 ms
59,472 KB
testcase_11 AC 41 ms
59,472 KB
testcase_12 AC 69 ms
75,536 KB
testcase_13 AC 35 ms
53,528 KB
testcase_14 AC 37 ms
59,320 KB
testcase_15 AC 34 ms
53,528 KB
testcase_16 AC 34 ms
53,528 KB
testcase_17 WA -
testcase_18 AC 43 ms
61,716 KB
testcase_19 AC 44 ms
61,716 KB
testcase_20 AC 70 ms
75,616 KB
testcase_21 AC 74 ms
75,540 KB
testcase_22 AC 90 ms
75,848 KB
testcase_23 AC 40 ms
59,320 KB
testcase_24 AC 69 ms
75,512 KB
testcase_25 AC 39 ms
59,324 KB
testcase_26 WA -
testcase_27 AC 71 ms
75,548 KB
testcase_28 WA -
testcase_29 AC 68 ms
75,536 KB
testcase_30 WA -
testcase_31 AC 71 ms
75,640 KB
testcase_32 AC 56 ms
74,928 KB
testcase_33 AC 72 ms
75,564 KB
testcase_34 WA -
testcase_35 AC 72 ms
75,548 KB
testcase_36 AC 34 ms
53,528 KB
testcase_37 AC 34 ms
53,528 KB
testcase_38 AC 34 ms
53,528 KB
testcase_39 AC 33 ms
53,528 KB
testcase_40 AC 34 ms
53,528 KB
testcase_41 AC 33 ms
53,528 KB
testcase_42 AC 34 ms
53,528 KB
testcase_43 AC 39 ms
61,372 KB
testcase_44 AC 45 ms
69,568 KB
testcase_45 AC 36 ms
53,528 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys


def input():
    return sys.stdin.readline().strip()


def main():
    h, w = map(int, input().split())
    s = [input() for _ in range(h)]

    for dh in range(h):
        for dw in range(w):
            fail = False
            filled = [[0]*w for _ in range(h)]
            for i in range(h):
                for j in range(w):
                    if not (s[i][j] == "#" and not filled[i][j]):
                        continue
                    filled[i][j] = True

                    ii, jj = i+dh, j+dw
                    if ii < h and jj < w and s[ii][jj] == "#" and not filled[ii][jj]:
                        filled[ii][jj] = True
                    else:
                        fail = True
                        break
                if fail:
                    break
            else:
                return "YES"

    return "NO"


print(main())
0