結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
7,760 KB
testcase_01 AC 16 ms
8,304 KB
testcase_02 AC 16 ms
7,936 KB
testcase_03 AC 16 ms
7,708 KB
testcase_04 AC 17 ms
7,976 KB
testcase_05 AC 16 ms
8,272 KB
testcase_06 AC 102 ms
7,880 KB
testcase_07 AC 16 ms
8,216 KB
testcase_08 AC 942 ms
8,176 KB
testcase_09 AC 885 ms
8,192 KB
testcase_10 TLE -
testcase_11 AC 2,391 ms
8,216 KB
testcase_12 AC 2,985 ms
8,260 KB
testcase_13 WA -
testcase_14 AC 17 ms
7,792 KB
testcase_15 AC 16 ms
8,052 KB
testcase_16 AC 16 ms
7,776 KB
testcase_17 AC 16 ms
8,272 KB
testcase_18 AC 2,051 ms
8,324 KB
testcase_19 AC 1,549 ms
8,316 KB
testcase_20 AC 16 ms
8,196 KB
testcase_21 AC 16 ms
8,152 KB
testcase_22 AC 1,121 ms
8,316 KB
testcase_23 AC 1,515 ms
8,164 KB
testcase_24 AC 1,074 ms
8,288 KB
testcase_25 AC 1,106 ms
8,228 KB
testcase_26 AC 1,283 ms
8,124 KB
testcase_27 AC 1,672 ms
8,324 KB
testcase_28 AC 1,879 ms
8,124 KB
testcase_29 AC 2,015 ms
8,332 KB
testcase_30 AC 2,122 ms
8,328 KB
testcase_31 AC 2,283 ms
8,264 KB
testcase_32 AC 2,312 ms
8,260 KB
testcase_33 AC 2,357 ms
8,240 KB
testcase_34 AC 2,709 ms
8,180 KB
testcase_35 AC 2,586 ms
8,220 KB
testcase_36 AC 16 ms
7,840 KB
testcase_37 AC 16 ms
8,048 KB
testcase_38 AC 16 ms
7,728 KB
testcase_39 AC 16 ms
7,924 KB
testcase_40 AC 17 ms
7,784 KB
testcase_41 AC 15 ms
8,096 KB
testcase_42 AC 16 ms
7,704 KB
testcase_43 AC 46 ms
7,940 KB
testcase_44 AC 230 ms
7,752 KB
testcase_45 AC 21 ms
7,968 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):
        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