結果

問題 No.179 塗り分け
ユーザー ssmkzkssmkzk
提出日時 2019-03-13 02:39:05
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 837 bytes
コンパイル時間 706 ms
コンパイル使用メモリ 10,936 KB
実行使用メモリ 8,404 KB
最終ジャッジ日時 2023-09-05 20:30:59
合計ジャッジ時間 4,365 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
8,208 KB
testcase_01 AC 16 ms
8,252 KB
testcase_02 AC 15 ms
8,120 KB
testcase_03 AC 15 ms
7,876 KB
testcase_04 AC 16 ms
8,304 KB
testcase_05 AC 16 ms
8,128 KB
testcase_06 AC 16 ms
8,104 KB
testcase_07 RE -
testcase_08 AC 22 ms
8,304 KB
testcase_09 WA -
testcase_10 AC 17 ms
8,360 KB
testcase_11 AC 18 ms
8,232 KB
testcase_12 AC 1,176 ms
8,180 KB
testcase_13 AC 16 ms
7,816 KB
testcase_14 AC 16 ms
7,792 KB
testcase_15 AC 15 ms
8,128 KB
testcase_16 AC 16 ms
8,132 KB
testcase_17 AC 15 ms
7,844 KB
testcase_18 AC 18 ms
8,256 KB
testcase_19 AC 18 ms
8,328 KB
testcase_20 AC 16 ms
8,180 KB
testcase_21 AC 16 ms
8,152 KB
testcase_22 AC 31 ms
7,800 KB
testcase_23 AC 16 ms
8,096 KB
testcase_24 AC 27 ms
7,792 KB
testcase_25 AC 16 ms
8,080 KB
testcase_26 WA -
testcase_27 AC 55 ms
7,796 KB
testcase_28 WA -
testcase_29 AC 88 ms
7,876 KB
testcase_30 WA -
testcase_31 AC 92 ms
7,836 KB
testcase_32 AC 39 ms
8,344 KB
testcase_33 AC 148 ms
7,760 KB
testcase_34 WA -
testcase_35 AC 179 ms
8,404 KB
testcase_36 AC 15 ms
7,788 KB
testcase_37 AC 15 ms
8,212 KB
testcase_38 AC 15 ms
7,864 KB
testcase_39 AC 15 ms
7,796 KB
testcase_40 AC 16 ms
7,840 KB
testcase_41 AC 15 ms
8,180 KB
testcase_42 AC 15 ms
7,812 KB
testcase_43 AC 17 ms
7,816 KB
testcase_44 AC 25 ms
7,844 KB
testcase_45 AC 16 ms
7,844 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

H, W = map(int, input().split())

black_l = []
count = 0

for i in range(H):
    l = list(input())
    for j in range(W):
        if l[j] == "#":
            black_l.append(H * i + j)
            count += 1

if count % 2 == 0:
    num = count // 2
else:
    print("NO")
    sys.exit()

for i in range(H):
    for j in range(W):
        if i == j == 0:
            continue
        nowuse = list(black_l)
        while True:
            if (nowuse[0] % H) + j > W - 1:
                break
            ck_nom = nowuse[0] + j + i * H
            try:
                nowuse.remove(ck_nom)
                nowuse.pop(0)
            except:
                # print(i,j)
                # print(nowuse)
                break
            if len(nowuse) == 0:
                print("YES")
                sys.exit()

print("NO")

0