結果

問題 No.179 塗り分け
ユーザー MIKI TakushiMIKI Takushi
提出日時 2019-01-03 17:20:05
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 835 bytes
コンパイル時間 318 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 11,264 KB
最終ジャッジ日時 2024-05-03 02:12:54
合計ジャッジ時間 34,786 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
10,624 KB
testcase_01 AC 27 ms
10,880 KB
testcase_02 AC 28 ms
10,880 KB
testcase_03 AC 27 ms
10,752 KB
testcase_04 AC 28 ms
10,624 KB
testcase_05 AC 214 ms
10,752 KB
testcase_06 AC 28 ms
10,880 KB
testcase_07 WA -
testcase_08 AC 1,923 ms
11,008 KB
testcase_09 WA -
testcase_10 AC 29 ms
10,880 KB
testcase_11 AC 28 ms
10,624 KB
testcase_12 AC 1,653 ms
10,752 KB
testcase_13 AC 30 ms
10,880 KB
testcase_14 AC 32 ms
10,752 KB
testcase_15 AC 29 ms
11,008 KB
testcase_16 AC 28 ms
10,752 KB
testcase_17 AC 29 ms
10,752 KB
testcase_18 AC 70 ms
10,880 KB
testcase_19 AC 64 ms
10,880 KB
testcase_20 AC 1,800 ms
11,008 KB
testcase_21 AC 2,038 ms
10,880 KB
testcase_22 AC 2,209 ms
11,008 KB
testcase_23 AC 29 ms
11,008 KB
testcase_24 AC 1,993 ms
10,880 KB
testcase_25 AC 46 ms
11,136 KB
testcase_26 WA -
testcase_27 AC 1,926 ms
11,008 KB
testcase_28 WA -
testcase_29 AC 1,919 ms
10,880 KB
testcase_30 WA -
testcase_31 AC 1,943 ms
10,880 KB
testcase_32 AC 542 ms
11,008 KB
testcase_33 AC 1,898 ms
11,008 KB
testcase_34 WA -
testcase_35 AC 1,936 ms
10,880 KB
testcase_36 AC 29 ms
10,752 KB
testcase_37 AC 26 ms
10,752 KB
testcase_38 AC 26 ms
10,752 KB
testcase_39 AC 28 ms
10,752 KB
testcase_40 AC 29 ms
10,880 KB
testcase_41 AC 29 ms
10,880 KB
testcase_42 AC 29 ms
10,880 KB
testcase_43 AC 63 ms
10,880 KB
testcase_44 AC 243 ms
10,880 KB
testcase_45 AC 34 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-
from copy import deepcopy

h,w = map(int, input().split())
s = [list(input()) for _ in range(h)]

def check(dh,dw):
    s2 = deepcopy(s)
    for hi in range(h):
        for wi in range(w):
            if h>hi+dh>=0 and w>wi+dw>=0:
                if s2[hi][wi]=="#" and s2[hi+dh][wi+dw]=="#":
                    s2[hi][wi] = "r"
                    s2[hi+dh][wi+dw] = "b"
                elif s2[hi][wi]=="#":
                    return False
            elif s2[hi][wi]=="#":
                return False
    for hi in range(h):
        for wi in range(w):
            if s2[hi][wi]=="#":
                return False
    return True

for dh in range(h):
    for dw in range(w):
        if dh==0 and dw==0:
            continue
        if check(dh,dw):
            print("YES")
            exit()
print("NO")
0