結果

問題 No.179 塗り分け
ユーザー mkawa2mkawa2
提出日時 2019-10-26 22:04:46
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 791 bytes
コンパイル時間 235 ms
コンパイル使用メモリ 10,936 KB
実行使用メモリ 8,604 KB
最終ジャッジ日時 2023-10-12 20:37:07
合計ジャッジ時間 35,684 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,388 KB
testcase_01 AC 18 ms
8,428 KB
testcase_02 AC 17 ms
8,384 KB
testcase_03 AC 18 ms
8,384 KB
testcase_04 AC 17 ms
8,460 KB
testcase_05 AC 210 ms
8,456 KB
testcase_06 AC 18 ms
8,420 KB
testcase_07 WA -
testcase_08 AC 2,003 ms
8,572 KB
testcase_09 WA -
testcase_10 AC 19 ms
8,388 KB
testcase_11 AC 19 ms
8,528 KB
testcase_12 AC 1,746 ms
8,404 KB
testcase_13 AC 22 ms
8,496 KB
testcase_14 AC 21 ms
8,492 KB
testcase_15 AC 18 ms
8,440 KB
testcase_16 AC 18 ms
8,484 KB
testcase_17 AC 18 ms
8,400 KB
testcase_18 AC 59 ms
8,516 KB
testcase_19 AC 57 ms
8,580 KB
testcase_20 AC 1,866 ms
8,508 KB
testcase_21 AC 2,025 ms
8,516 KB
testcase_22 AC 2,094 ms
8,388 KB
testcase_23 AC 20 ms
8,368 KB
testcase_24 AC 1,996 ms
8,412 KB
testcase_25 AC 36 ms
8,584 KB
testcase_26 WA -
testcase_27 AC 2,003 ms
8,588 KB
testcase_28 WA -
testcase_29 AC 1,989 ms
8,460 KB
testcase_30 WA -
testcase_31 AC 1,983 ms
8,440 KB
testcase_32 AC 557 ms
8,564 KB
testcase_33 AC 2,013 ms
8,520 KB
testcase_34 WA -
testcase_35 AC 1,995 ms
8,604 KB
testcase_36 AC 18 ms
8,492 KB
testcase_37 AC 18 ms
8,356 KB
testcase_38 AC 18 ms
8,380 KB
testcase_39 AC 18 ms
8,356 KB
testcase_40 AC 18 ms
8,332 KB
testcase_41 AC 18 ms
8,512 KB
testcase_42 AC 18 ms
8,420 KB
testcase_43 AC 53 ms
8,380 KB
testcase_44 AC 237 ms
8,516 KB
testcase_45 AC 24 ms
8,436 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):
            if (di, dj) == (0, 0): continue
            t = deepcopy(t0)
            br = False
            for i in range(h):
                for j in range(w):
                    if t[i][j] != -1: continue
                    if i + di >= h or j + dj >= w or t[i + di][j + dj] != -1:
                        br = True
                        break
                    t[i][j] = 1
                    t[i + di][j + dj] = 2
                if br: break
            if br: continue
            print("YES")
            exit()
    print("NO")

main()
0