結果

問題 No.179 塗り分け
ユーザー caleicalei
提出日時 2020-01-01 19:21:13
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 675 bytes
コンパイル時間 345 ms
コンパイル使用メモリ 82,184 KB
実行使用メモリ 79,304 KB
最終ジャッジ日時 2024-05-02 05:14:05
合計ジャッジ時間 5,303 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
53,504 KB
testcase_01 WA -
testcase_02 AC 44 ms
53,504 KB
testcase_03 WA -
testcase_04 AC 45 ms
53,632 KB
testcase_05 WA -
testcase_06 AC 49 ms
59,264 KB
testcase_07 AC 1,347 ms
79,304 KB
testcase_08 AC 54 ms
62,336 KB
testcase_09 AC 54 ms
62,208 KB
testcase_10 AC 56 ms
63,616 KB
testcase_11 AC 55 ms
63,488 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 43 ms
53,340 KB
testcase_17 AC 42 ms
53,376 KB
testcase_18 AC 58 ms
63,872 KB
testcase_19 AC 58 ms
63,616 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 61 ms
65,280 KB
testcase_24 WA -
testcase_25 AC 56 ms
62,848 KB
testcase_26 AC 56 ms
63,880 KB
testcase_27 WA -
testcase_28 AC 59 ms
64,768 KB
testcase_29 WA -
testcase_30 AC 57 ms
64,512 KB
testcase_31 WA -
testcase_32 AC 55 ms
64,512 KB
testcase_33 WA -
testcase_34 AC 59 ms
64,000 KB
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

# 2020/01/01
# 解答かんにんぐ

from copy import deepcopy

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


def check(x,y):
    g=deepcopy(s)
    flag=False
    for i in range(h):
        for j in range(w):
            if g[i][j] in ['.','R','B']:continue
            if i+y>=h or j+x>=w:return False
            if g[i][j]==g[i+y][j+x]=='#':
                flag=True
                g[i][j]='R'
                g[i+y][j+x]='B'
            else:return False
    return flag


for x in range(-w,w+1):
    for y in range(-h,h+1):
        if x==y==0:continue
        res=check(x,y)
        if res:
            print('YES')
            exit()
print('NO')
0