結果

問題 No.179 塗り分け
ユーザー mkawa2mkawa2
提出日時 2019-10-26 22:25:27
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 813 bytes
コンパイル時間 258 ms
コンパイル使用メモリ 86,916 KB
実行使用メモリ 92,684 KB
最終ジャッジ日時 2023-10-12 21:11:38
合計ジャッジ時間 22,267 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 85 ms
71,636 KB
testcase_01 AC 87 ms
71,616 KB
testcase_02 AC 89 ms
71,264 KB
testcase_03 WA -
testcase_04 AC 87 ms
71,708 KB
testcase_05 AC 267 ms
79,156 KB
testcase_06 AC 90 ms
71,508 KB
testcase_07 AC 1,049 ms
85,176 KB
testcase_08 AC 1,011 ms
85,020 KB
testcase_09 AC 1,022 ms
84,772 KB
testcase_10 AC 98 ms
76,324 KB
testcase_11 AC 97 ms
76,392 KB
testcase_12 WA -
testcase_13 AC 104 ms
77,480 KB
testcase_14 AC 104 ms
77,064 KB
testcase_15 AC 86 ms
71,508 KB
testcase_16 AC 86 ms
71,636 KB
testcase_17 AC 89 ms
71,508 KB
testcase_18 AC 140 ms
77,608 KB
testcase_19 AC 134 ms
77,272 KB
testcase_20 AC 1,315 ms
89,616 KB
testcase_21 AC 1,135 ms
87,280 KB
testcase_22 AC 1,118 ms
87,444 KB
testcase_23 AC 98 ms
76,348 KB
testcase_24 AC 1,091 ms
85,180 KB
testcase_25 AC 107 ms
77,672 KB
testcase_26 AC 289 ms
80,264 KB
testcase_27 AC 1,302 ms
87,548 KB
testcase_28 AC 181 ms
78,044 KB
testcase_29 AC 1,429 ms
88,840 KB
testcase_30 AC 686 ms
81,980 KB
testcase_31 AC 1,496 ms
89,756 KB
testcase_32 AC 501 ms
82,284 KB
testcase_33 AC 1,493 ms
91,532 KB
testcase_34 AC 387 ms
79,168 KB
testcase_35 AC 1,531 ms
92,684 KB
testcase_36 AC 86 ms
71,464 KB
testcase_37 AC 87 ms
71,704 KB
testcase_38 AC 87 ms
71,260 KB
testcase_39 AC 86 ms
71,636 KB
testcase_40 AC 93 ms
76,248 KB
testcase_41 AC 87 ms
71,256 KB
testcase_42 AC 92 ms
76,240 KB
testcase_43 AC 135 ms
78,040 KB
testcase_44 AC 285 ms
78,680 KB
testcase_45 AC 113 ms
77,776 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from copy import deepcopy

sys.setrecursionlimit(10 ** 6)

def main():
    h, w = map(int, input().split())
    t0 = [[-1 if c == "#" else 0 for c in input()] for _ in range(h)]
    for di in range(h):
        for dj in range(-w+1,w):
            flag=True
            t = deepcopy(t0)
            br = False
            for i in range(h):
                for j in range(w):
                    if t[i][j] != -1: continue
                    t[i][j] = 1
                    if i + di >= h or j + dj >= w or t[i + di][j + dj] != -1:
                        br = True
                        break
                    flag=False
                    t[i + di][j + dj] = 2
                if br: break
            if br or flag: continue
            print("YES")
            exit()
    print("NO")

main()
0