結果

問題 No.179 塗り分け
ユーザー Ryushi-techRyushi-tech
提出日時 2020-06-24 20:43:17
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 623 bytes
コンパイル時間 242 ms
コンパイル使用メモリ 86,840 KB
実行使用メモリ 76,424 KB
最終ジャッジ日時 2023-09-16 21:20:27
合計ジャッジ時間 6,215 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
71,272 KB
testcase_01 AC 63 ms
71,344 KB
testcase_02 AC 64 ms
71,620 KB
testcase_03 AC 66 ms
71,356 KB
testcase_04 AC 62 ms
71,596 KB
testcase_05 AC 68 ms
71,128 KB
testcase_06 AC 65 ms
71,616 KB
testcase_07 AC 66 ms
75,740 KB
testcase_08 AC 72 ms
76,032 KB
testcase_09 WA -
testcase_10 AC 76 ms
76,104 KB
testcase_11 AC 73 ms
76,424 KB
testcase_12 TLE -
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 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(1, w):
        tmp = []
        cnt = 0
        for e in E:
            z = e + x * 1000 + y
            if e in tmp:
                continue
            elif z in E:
                cnt += 1
                tmp.append(z)
        if l // 2 == cnt:
            print("YES")
            exit()
print("NO")
0