結果

問題 No.179 塗り分け
ユーザー Konton7Konton7
提出日時 2019-05-19 23:27:16
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 825 bytes
コンパイル時間 140 ms
コンパイル使用メモリ 12,028 KB
実行使用メモリ 10,476 KB
最終ジャッジ日時 2023-10-17 08:01:57
合計ジャッジ時間 7,433 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,156 KB
testcase_01 AC 29 ms
10,156 KB
testcase_02 AC 29 ms
10,156 KB
testcase_03 AC 28 ms
10,156 KB
testcase_04 AC 27 ms
10,156 KB
testcase_05 AC 39 ms
10,192 KB
testcase_06 AC 28 ms
10,184 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 134 ms
10,476 KB
testcase_11 AC 118 ms
10,452 KB
testcase_12 AC 2,741 ms
10,452 KB
testcase_13 AC 27 ms
10,156 KB
testcase_14 AC 27 ms
10,156 KB
testcase_15 AC 27 ms
10,156 KB
testcase_16 WA -
testcase_17 AC 28 ms
10,156 KB
testcase_18 AC 58 ms
10,328 KB
testcase_19 AC 54 ms
10,324 KB
testcase_20 AC 376 ms
10,324 KB
testcase_21 AC 34 ms
10,204 KB
testcase_22 AC 42 ms
10,208 KB
testcase_23 AC 36 ms
10,264 KB
testcase_24 AC 33 ms
10,200 KB
testcase_25 AC 29 ms
10,208 KB
testcase_26 WA -
testcase_27 AC 50 ms
10,252 KB
testcase_28 WA -
testcase_29 AC 64 ms
10,280 KB
testcase_30 WA -
testcase_31 AC 74 ms
10,296 KB
testcase_32 AC 93 ms
10,352 KB
testcase_33 AC 110 ms
10,340 KB
testcase_34 WA -
testcase_35 AC 119 ms
10,340 KB
testcase_36 AC 27 ms
10,156 KB
testcase_37 AC 27 ms
10,156 KB
testcase_38 AC 27 ms
10,156 KB
testcase_39 AC 27 ms
10,156 KB
testcase_40 AC 27 ms
10,156 KB
testcase_41 AC 27 ms
10,156 KB
testcase_42 AC 28 ms
10,156 KB
testcase_43 AC 28 ms
10,164 KB
testcase_44 AC 31 ms
10,184 KB
testcase_45 AC 27 ms
10,156 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

h, w = [ int(v) for v in input().split() ]

field = []
paint_list = []


for i in range(h):
    s = input()
    for j in range(len(s)):
        if s[j] == "#":
            paint_list.append((i,j))
move_list = []

for i in range((h+1)//2):
    for j in range((w+1)//2):
        move_list.append((i,j))
move_list = move_list[1:]


def paint(inlist):
    global paint_list
    y, x = inlist[0], inlist[1]
    red_list = []
    blue_list = []
    result = 0
    for i in paint_list:
        if i not in blue_list:
            red_list.append(i)
            j = (i[0]+y,i[1]+x)
            if j in paint_list:
                blue_list.append(j)
            else:
                result = -1
                break
    return result
ans = "NO"
for i in move_list:
    if paint(i) == 0:
        ans = "YES"
        break
print(ans)
0