結果

問題 No.179 塗り分け
ユーザー todo_2marikotodo_2mariko
提出日時 2019-03-12 21:29:47
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 664 bytes
コンパイル時間 176 ms
コンパイル使用メモリ 10,712 KB
実行使用メモリ 8,332 KB
最終ジャッジ日時 2023-09-05 20:27:50
合計ジャッジ時間 3,322 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 15 ms
8,120 KB
testcase_02 WA -
testcase_03 AC 15 ms
7,708 KB
testcase_04 WA -
testcase_05 AC 16 ms
8,128 KB
testcase_06 WA -
testcase_07 AC 16 ms
8,156 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 87 ms
7,844 KB
testcase_11 AC 78 ms
8,124 KB
testcase_12 AC 76 ms
8,200 KB
testcase_13 AC 15 ms
7,772 KB
testcase_14 AC 16 ms
7,872 KB
testcase_15 AC 16 ms
8,272 KB
testcase_16 AC 16 ms
7,880 KB
testcase_17 AC 16 ms
8,104 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 16 ms
8,204 KB
testcase_21 AC 16 ms
8,324 KB
testcase_22 AC 39 ms
8,260 KB
testcase_23 AC 48 ms
8,300 KB
testcase_24 AC 37 ms
8,176 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 48 ms
7,708 KB
testcase_28 WA -
testcase_29 AC 57 ms
8,316 KB
testcase_30 WA -
testcase_31 AC 62 ms
8,196 KB
testcase_32 WA -
testcase_33 AC 63 ms
8,332 KB
testcase_34 WA -
testcase_35 AC 67 ms
8,180 KB
testcase_36 AC 16 ms
7,804 KB
testcase_37 AC 15 ms
8,108 KB
testcase_38 AC 14 ms
7,936 KB
testcase_39 AC 15 ms
7,924 KB
testcase_40 AC 15 ms
7,712 KB
testcase_41 AC 15 ms
8,108 KB
testcase_42 AC 16 ms
7,920 KB
testcase_43 AC 18 ms
7,764 KB
testcase_44 AC 23 ms
7,844 KB
testcase_45 AC 15 ms
7,792 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

a, b = map(int, input().split(' '))
sq = [input().strip() for i in range(a)]
sq2 = [c for k in sq for c in k]
ans = 'NO'

if ('#' not in sq2) or sq2.count('#') % 2 == 1:
    print('NO')
    exit()
 
for h in range(a):
    for w in range(b):
        if not h == 0 and w == 0:
            sq3 = list('0'*len(sq2)) 
            for t in range(len(sq2)):
                if sq2[t] == '#' and t < t+w+(b*h) < a*b:
                    if sq2[t+w+(b*h)] == '#' and sq3[t]=='0':
                        sq3[t] = '1'
                        sq3[t+w+(b*h)] = '1'

            if sq2.count('#') == sq3.count('1'):
                ans = 'YES'
                break

print(ans)
0