結果

問題 No.179 塗り分け
ユーザー Ryushi-techRyushi-tech
提出日時 2020-06-24 22:25:56
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 647 bytes
コンパイル時間 291 ms
コンパイル使用メモリ 86,928 KB
実行使用メモリ 77,376 KB
最終ジャッジ日時 2023-09-16 21:24:10
合計ジャッジ時間 8,707 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,456 KB
testcase_01 AC 75 ms
71,412 KB
testcase_02 AC 76 ms
71,588 KB
testcase_03 AC 77 ms
71,260 KB
testcase_04 AC 76 ms
71,092 KB
testcase_05 AC 77 ms
71,244 KB
testcase_06 AC 84 ms
76,216 KB
testcase_07 AC 77 ms
75,924 KB
testcase_08 AC 84 ms
76,396 KB
testcase_09 AC 84 ms
76,592 KB
testcase_10 AC 89 ms
76,080 KB
testcase_11 AC 88 ms
76,228 KB
testcase_12 AC 584 ms
77,376 KB
testcase_13 AC 75 ms
71,452 KB
testcase_14 AC 75 ms
71,244 KB
testcase_15 AC 76 ms
71,448 KB
testcase_16 AC 76 ms
71,064 KB
testcase_17 AC 74 ms
71,100 KB
testcase_18 AC 100 ms
76,396 KB
testcase_19 AC 96 ms
76,284 KB
testcase_20 AC 80 ms
76,080 KB
testcase_21 AC 77 ms
75,804 KB
testcase_22 AC 117 ms
76,452 KB
testcase_23 AC 86 ms
76,188 KB
testcase_24 AC 122 ms
76,464 KB
testcase_25 AC 82 ms
76,288 KB
testcase_26 AC 105 ms
76,192 KB
testcase_27 AC 237 ms
77,160 KB
testcase_28 AC 106 ms
76,292 KB
testcase_29 AC 348 ms
76,992 KB
testcase_30 AC 225 ms
76,964 KB
testcase_31 AC 464 ms
76,964 KB
testcase_32 AC 197 ms
77,276 KB
testcase_33 AC 414 ms
77,156 KB
testcase_34 AC 185 ms
77,124 KB
testcase_35 AC 526 ms
77,036 KB
testcase_36 AC 77 ms
71,288 KB
testcase_37 AC 75 ms
71,456 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 AC 77 ms
71,240 KB
testcase_41 AC 76 ms
71,368 KB
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

cnt = 0
D = set()
for i in range(h):
    for j in range(w):
        if S[i][j] == "#":
            D.add(i * 1000 + j)

l = len(D)
if l & 1 or not D:
    print("NO")
    exit()
E = sorted(list(D))

for x in range(h):
    for y in range(-w, w):
        tmp = set()
        cnt = 0
        for e in E:
            z = e + x * 1000 + y
            if e in tmp:
                continue
            elif z in D:
                cnt += 1
                tmp.add(z)
        #print(z, tmp)
        if l // 2 == cnt:
            print("YES")
            exit()
print("NO")
0