結果

問題 No.179 塗り分け
ユーザー bug maker / ばぐめいかー@Python学習者bug maker / ばぐめいかー@Python学習者
提出日時 2023-07-08 00:15:09
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 534 bytes
コンパイル時間 93 ms
コンパイル使用メモリ 10,956 KB
実行使用メモリ 8,204 KB
最終ジャッジ日時 2023-09-29 01:53:53
合計ジャッジ時間 11,885 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,848 KB
testcase_01 AC 16 ms
8,036 KB
testcase_02 AC 16 ms
7,844 KB
testcase_03 WA -
testcase_04 AC 16 ms
7,704 KB
testcase_05 AC 16 ms
8,140 KB
testcase_06 AC 35 ms
7,632 KB
testcase_07 AC 16 ms
8,072 KB
testcase_08 AC 412 ms
7,708 KB
testcase_09 AC 421 ms
7,748 KB
testcase_10 AC 422 ms
7,844 KB
testcase_11 AC 356 ms
7,708 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 16 ms
8,204 KB
testcase_16 AC 16 ms
7,856 KB
testcase_17 AC 16 ms
7,968 KB
testcase_18 AC 415 ms
7,748 KB
testcase_19 AC 398 ms
7,884 KB
testcase_20 AC 16 ms
8,164 KB
testcase_21 AC 16 ms
8,088 KB
testcase_22 WA -
testcase_23 AC 441 ms
7,632 KB
testcase_24 WA -
testcase_25 AC 417 ms
7,712 KB
testcase_26 AC 408 ms
7,716 KB
testcase_27 WA -
testcase_28 AC 413 ms
7,844 KB
testcase_29 WA -
testcase_30 AC 423 ms
7,708 KB
testcase_31 WA -
testcase_32 AC 421 ms
7,796 KB
testcase_33 WA -
testcase_34 AC 412 ms
7,828 KB
testcase_35 WA -
testcase_36 WA -
testcase_37 AC 15 ms
8,040 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 16 ms
8,192 KB
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

H, W = map(int, input().split())

D = [list(input()) for h in range(H)]

count = sum(D[h].count("#") for h in range(H))

if count == 0 or count % 2 == 1:
    print("NO")
    exit()

for h in range(H):
    for w in range(W):


        for i in range(H-h):
            for j in range(-w, W-w):
                if D[h][w] == "#" and D[h+i][w+j] == "#":
                    D[h][w], D[h+i][w+j] = ".", "."

count = sum(D[h].count("#") for h in range(H))

if count == 0:
    print("YES")
else:                    
    print("NO")          
0