結果

問題 No.179 塗り分け
ユーザー mkawa2mkawa2
提出日時 2019-10-26 22:26:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,534 ms / 3,000 ms
コード長 834 bytes
コンパイル時間 1,628 ms
コンパイル使用メモリ 86,980 KB
実行使用メモリ 91,260 KB
最終ジャッジ日時 2023-09-30 21:15:43
合計ジャッジ時間 24,537 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 86 ms
71,332 KB
testcase_01 AC 88 ms
71,492 KB
testcase_02 AC 88 ms
71,564 KB
testcase_03 AC 87 ms
71,584 KB
testcase_04 AC 94 ms
76,036 KB
testcase_05 AC 265 ms
80,908 KB
testcase_06 AC 102 ms
77,360 KB
testcase_07 AC 1,082 ms
84,800 KB
testcase_08 AC 998 ms
84,576 KB
testcase_09 AC 1,000 ms
84,628 KB
testcase_10 AC 122 ms
77,616 KB
testcase_11 AC 118 ms
77,240 KB
testcase_12 AC 1,473 ms
91,260 KB
testcase_13 AC 102 ms
77,372 KB
testcase_14 AC 101 ms
77,040 KB
testcase_15 AC 84 ms
71,372 KB
testcase_16 AC 86 ms
71,576 KB
testcase_17 AC 87 ms
71,372 KB
testcase_18 AC 150 ms
78,136 KB
testcase_19 AC 169 ms
80,540 KB
testcase_20 AC 1,302 ms
89,116 KB
testcase_21 AC 1,154 ms
87,032 KB
testcase_22 AC 1,127 ms
85,060 KB
testcase_23 AC 117 ms
77,076 KB
testcase_24 AC 1,091 ms
85,488 KB
testcase_25 AC 119 ms
77,616 KB
testcase_26 AC 280 ms
78,532 KB
testcase_27 AC 1,292 ms
86,452 KB
testcase_28 AC 185 ms
77,976 KB
testcase_29 AC 1,445 ms
89,388 KB
testcase_30 AC 694 ms
82,732 KB
testcase_31 AC 1,483 ms
91,156 KB
testcase_32 AC 499 ms
80,184 KB
testcase_33 AC 1,471 ms
90,004 KB
testcase_34 AC 408 ms
80,616 KB
testcase_35 AC 1,534 ms
89,660 KB
testcase_36 AC 87 ms
71,368 KB
testcase_37 AC 86 ms
71,604 KB
testcase_38 AC 88 ms
71,328 KB
testcase_39 AC 88 ms
71,296 KB
testcase_40 AC 94 ms
76,284 KB
testcase_41 AC 87 ms
71,384 KB
testcase_42 AC 93 ms
76,080 KB
testcase_43 AC 134 ms
77,964 KB
testcase_44 AC 281 ms
78,720 KB
testcase_45 AC 112 ms
77,560 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 j + dj < 0 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