結果

問題 No.179 塗り分け
ユーザー CsTarepandaCsTarepanda
提出日時 2019-04-20 20:28:02
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 614 bytes
コンパイル時間 134 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-04-09 21:05:28
合計ジャッジ時間 34,585 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,880 KB
testcase_01 AC 28 ms
10,880 KB
testcase_02 AC 28 ms
10,880 KB
testcase_03 AC 28 ms
10,880 KB
testcase_04 AC 28 ms
10,880 KB
testcase_05 AC 213 ms
10,880 KB
testcase_06 AC 28 ms
10,880 KB
testcase_07 WA -
testcase_08 AC 1,935 ms
10,880 KB
testcase_09 WA -
testcase_10 AC 29 ms
10,880 KB
testcase_11 AC 29 ms
10,880 KB
testcase_12 AC 1,737 ms
10,880 KB
testcase_13 AC 32 ms
10,880 KB
testcase_14 AC 31 ms
10,880 KB
testcase_15 AC 29 ms
10,880 KB
testcase_16 AC 28 ms
11,008 KB
testcase_17 WA -
testcase_18 AC 72 ms
10,880 KB
testcase_19 AC 68 ms
10,880 KB
testcase_20 AC 1,851 ms
10,880 KB
testcase_21 AC 1,972 ms
10,880 KB
testcase_22 AC 2,048 ms
10,880 KB
testcase_23 AC 29 ms
10,880 KB
testcase_24 AC 1,965 ms
10,880 KB
testcase_25 AC 48 ms
10,880 KB
testcase_26 WA -
testcase_27 AC 1,941 ms
10,880 KB
testcase_28 WA -
testcase_29 AC 1,949 ms
10,880 KB
testcase_30 WA -
testcase_31 AC 1,977 ms
10,880 KB
testcase_32 AC 545 ms
10,880 KB
testcase_33 AC 1,953 ms
10,880 KB
testcase_34 WA -
testcase_35 AC 1,983 ms
10,880 KB
testcase_36 AC 28 ms
11,008 KB
testcase_37 AC 27 ms
10,880 KB
testcase_38 AC 28 ms
10,880 KB
testcase_39 AC 27 ms
10,880 KB
testcase_40 AC 28 ms
10,880 KB
testcase_41 AC 27 ms
10,880 KB
testcase_42 AC 27 ms
10,880 KB
testcase_43 AC 64 ms
10,880 KB
testcase_44 AC 248 ms
10,880 KB
testcase_45 AC 35 ms
11,008 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools
import copy
h, w = map(int, input().split())

field = [list(input()) for _ in range(h)]

def check(y, x):
    m = copy.deepcopy(field)
    for red_y in range(h):
        for red_x in range(w):
            if m[red_y][red_x] == "#":
                m[red_y][red_x] = "@"
                nx = red_x + x
                ny = red_y + y
                if ny >= h or nx >= w or m[ny][nx] != "#":
                    return False
                m[ny][nx] = "@"
    return True



for i in range(h):
    for j in range(w):
        if check(i, j):
            print("YES")
            exit()
print("NO")
0