結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,852 KB
testcase_01 AC 17 ms
8,168 KB
testcase_02 AC 17 ms
7,800 KB
testcase_03 AC 16 ms
7,776 KB
testcase_04 AC 17 ms
7,836 KB
testcase_05 AC 15 ms
8,108 KB
testcase_06 AC 102 ms
7,800 KB
testcase_07 AC 16 ms
8,148 KB
testcase_08 AC 924 ms
8,196 KB
testcase_09 AC 885 ms
8,164 KB
testcase_10 TLE -
testcase_11 AC 2,374 ms
8,156 KB
testcase_12 AC 2,968 ms
8,256 KB
testcase_13 WA -
testcase_14 AC 16 ms
7,808 KB
testcase_15 AC 16 ms
8,224 KB
testcase_16 AC 16 ms
7,784 KB
testcase_17 AC 17 ms
8,164 KB
testcase_18 AC 2,066 ms
7,792 KB
testcase_19 AC 1,508 ms
8,208 KB
testcase_20 AC 16 ms
8,144 KB
testcase_21 AC 16 ms
8,216 KB
testcase_22 AC 1,114 ms
8,268 KB
testcase_23 AC 1,536 ms
8,260 KB
testcase_24 AC 1,059 ms
8,316 KB
testcase_25 AC 1,102 ms
8,376 KB
testcase_26 AC 1,305 ms
8,288 KB
testcase_27 AC 1,601 ms
8,332 KB
testcase_28 AC 1,882 ms
8,176 KB
testcase_29 AC 2,047 ms
8,288 KB
testcase_30 AC 2,210 ms
8,264 KB
testcase_31 AC 2,357 ms
8,240 KB
testcase_32 AC 2,390 ms
8,160 KB
testcase_33 AC 2,336 ms
8,248 KB
testcase_34 AC 2,514 ms
8,288 KB
testcase_35 AC 2,568 ms
8,176 KB
testcase_36 AC 16 ms
7,832 KB
testcase_37 AC 16 ms
8,100 KB
testcase_38 AC 16 ms
7,940 KB
testcase_39 AC 16 ms
7,708 KB
testcase_40 AC 16 ms
7,808 KB
testcase_41 AC 15 ms
8,100 KB
testcase_42 AC 16 ms
7,752 KB
testcase_43 AC 45 ms
7,828 KB
testcase_44 AC 230 ms
7,832 KB
testcase_45 AC 21 ms
7,960 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