結果

問題 No.179 塗り分け
ユーザー Ryushi-techRyushi-tech
提出日時 2020-06-24 19:56:36
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 605 bytes
コンパイル時間 292 ms
コンパイル使用メモリ 87,244 KB
実行使用メモリ 77,620 KB
最終ジャッジ日時 2023-09-15 03:31:20
合計ジャッジ時間 19,834 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,340 KB
testcase_01 AC 69 ms
71,328 KB
testcase_02 AC 69 ms
71,200 KB
testcase_03 AC 70 ms
71,120 KB
testcase_04 AC 74 ms
71,564 KB
testcase_05 AC 72 ms
71,360 KB
testcase_06 AC 88 ms
76,324 KB
testcase_07 AC 73 ms
75,780 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 2,789 ms
76,932 KB
testcase_11 AC 2,206 ms
77,116 KB
testcase_12 AC 2,184 ms
77,080 KB
testcase_13 WA -
testcase_14 AC 70 ms
71,608 KB
testcase_15 AC 70 ms
71,252 KB
testcase_16 AC 69 ms
71,356 KB
testcase_17 AC 69 ms
71,368 KB
testcase_18 AC 534 ms
77,196 KB
testcase_19 AC 387 ms
76,940 KB
testcase_20 AC 75 ms
76,000 KB
testcase_21 AC 74 ms
76,092 KB
testcase_22 AC 99 ms
76,480 KB
testcase_23 AC 224 ms
76,836 KB
testcase_24 AC 90 ms
76,464 KB
testcase_25 AC 96 ms
76,468 KB
testcase_26 AC 133 ms
76,320 KB
testcase_27 AC 230 ms
76,456 KB
testcase_28 AC 389 ms
76,992 KB
testcase_29 AC 489 ms
76,944 KB
testcase_30 AC 640 ms
77,024 KB
testcase_31 AC 712 ms
77,104 KB
testcase_32 AC 824 ms
77,192 KB
testcase_33 AC 777 ms
77,052 KB
testcase_34 AC 1,040 ms
77,620 KB
testcase_35 AC 1,187 ms
77,172 KB
testcase_36 AC 72 ms
71,592 KB
testcase_37 AC 74 ms
71,476 KB
testcase_38 AC 72 ms
71,596 KB
testcase_39 AC 71 ms
71,480 KB
testcase_40 AC 71 ms
71,520 KB
testcase_41 AC 70 ms
71,412 KB
testcase_42 AC 71 ms
71,160 KB
testcase_43 AC 79 ms
76,208 KB
testcase_44 AC 100 ms
76,732 KB
testcase_45 AC 78 ms
76,340 KB
権限があれば一括ダウンロードができます

ソースコード

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 or not D:
    print("NO")
    exit()

flg = False
m = max(D)
hw = h * w // 2 + 1
for i in range(1, min(m, hw)):
    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