結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,808 KB
testcase_01 AC 16 ms
8,100 KB
testcase_02 AC 16 ms
7,744 KB
testcase_03 WA -
testcase_04 AC 16 ms
7,800 KB
testcase_05 AC 16 ms
8,244 KB
testcase_06 AC 81 ms
7,936 KB
testcase_07 AC 16 ms
8,156 KB
testcase_08 WA -
testcase_09 AC 902 ms
8,252 KB
testcase_10 AC 2,584 ms
8,228 KB
testcase_11 AC 2,012 ms
8,360 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 16 ms
8,212 KB
testcase_16 AC 16 ms
7,796 KB
testcase_17 AC 16 ms
8,280 KB
testcase_18 AC 1,454 ms
8,144 KB
testcase_19 AC 1,321 ms
8,160 KB
testcase_20 AC 16 ms
8,172 KB
testcase_21 AC 17 ms
8,160 KB
testcase_22 AC 983 ms
8,272 KB
testcase_23 AC 1,181 ms
8,360 KB
testcase_24 AC 958 ms
8,016 KB
testcase_25 AC 956 ms
8,220 KB
testcase_26 AC 1,090 ms
8,180 KB
testcase_27 WA -
testcase_28 AC 1,408 ms
8,212 KB
testcase_29 WA -
testcase_30 AC 1,531 ms
8,300 KB
testcase_31 WA -
testcase_32 AC 1,605 ms
8,252 KB
testcase_33 WA -
testcase_34 AC 1,818 ms
8,232 KB
testcase_35 WA -
testcase_36 AC 16 ms
7,848 KB
testcase_37 AC 16 ms
8,248 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 16 ms
8,296 KB
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
権限があれば一括ダウンロードができます

ソースコード

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):
        sq3 = list('0'*len(sq2)) 
        for t in range(len(sq2)):
            if sq2[t] == '#':
                if sq2[w+b*h] == '#' and 0 < w+b*h <= b:
                    sq3[t] = '1'
                    sq3[w+b*h] = '1'
        if sq2.count('#') == sq3.count('1'):
            ans = 'YES'
            break

print(ans)
0