結果

問題 No.179 塗り分け
ユーザー Ryushi-techRyushi-tech
提出日時 2020-06-24 19:49:49
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 567 bytes
コンパイル時間 92 ms
コンパイル使用メモリ 10,784 KB
実行使用メモリ 16,316 KB
最終ジャッジ日時 2023-09-14 15:42:00
合計ジャッジ時間 5,976 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
16,316 KB
testcase_01 AC 15 ms
8,136 KB
testcase_02 AC 15 ms
7,848 KB
testcase_03 AC 15 ms
7,820 KB
testcase_04 AC 15 ms
7,960 KB
testcase_05 AC 15 ms
8,212 KB
testcase_06 AC 135 ms
7,740 KB
testcase_07 RE -
testcase_08 AC 17 ms
7,796 KB
testcase_09 AC 18 ms
7,948 KB
testcase_10 TLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

h, w = map(int, input().split())
S = []
for i in range(h):
    S.append(input())

cnt = 0
D = set()
for ss in S:
    for s in ss:
        cnt += 1
        if s == "#":
            D.add(cnt)

l = len(D)
if l & 1:
    print("NO")
    exit()

flg = False
m = max(D)
for i in range(1, m):
    cnt = 0
    tmp = []
    for d in D:
        if d in tmp:
            continue
        elif d + i in D:
            cnt += 1
            tmp.append(d + i)
    #print(i, cnt, tmp)
    if l // 2 == cnt:
        #print(i,cnt,tmp)
        flg = True
print("YES" if flg else "NO")

0