結果

問題 No.179 塗り分け
ユーザー caleicalei
提出日時 2020-01-01 19:11:08
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 665 bytes
コンパイル時間 479 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 78,592 KB
最終ジャッジ日時 2024-05-02 05:00:43
合計ジャッジ時間 11,344 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 43 ms
54,144 KB
testcase_02 WA -
testcase_03 AC 40 ms
53,504 KB
testcase_04 WA -
testcase_05 AC 110 ms
76,784 KB
testcase_06 WA -
testcase_07 AC 336 ms
77,952 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 297 ms
78,592 KB
testcase_13 AC 50 ms
62,208 KB
testcase_14 AC 58 ms
67,456 KB
testcase_15 AC 42 ms
53,376 KB
testcase_16 WA -
testcase_17 AC 40 ms
53,376 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 331 ms
77,824 KB
testcase_21 AC 349 ms
77,664 KB
testcase_22 AC 364 ms
77,696 KB
testcase_23 WA -
testcase_24 AC 350 ms
77,896 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 330 ms
77,820 KB
testcase_28 WA -
testcase_29 AC 382 ms
77,952 KB
testcase_30 WA -
testcase_31 AC 335 ms
77,824 KB
testcase_32 WA -
testcase_33 AC 348 ms
77,952 KB
testcase_34 WA -
testcase_35 AC 314 ms
77,952 KB
testcase_36 AC 44 ms
53,760 KB
testcase_37 AC 42 ms
53,504 KB
testcase_38 AC 40 ms
53,760 KB
testcase_39 AC 43 ms
53,760 KB
testcase_40 AC 47 ms
60,928 KB
testcase_41 AC 40 ms
53,376 KB
testcase_42 AC 42 ms
54,400 KB
testcase_43 AC 78 ms
76,416 KB
testcase_44 AC 115 ms
76,800 KB
testcase_45 AC 66 ms
67,840 KB
権限があれば一括ダウンロードができます

ソースコード

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 i+y>=h or j+x>=w:return False
            if g[i][j] in ['.','R','B']:continue
            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):
    for y in range(h):
        if x==y==0:continue
        res=check(x,y)
        if res:
            print('YES')
            exit()
print('NO')
0