結果

問題 No.179 塗り分け
ユーザー Woo-CieWoo-Cie
提出日時 2019-03-23 11:38:40
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 1,020 bytes
コンパイル時間 87 ms
コンパイル使用メモリ 11,924 KB
実行使用メモリ 46,724 KB
最終ジャッジ日時 2023-10-22 02:12:21
合計ジャッジ時間 21,030 ms
ジャッジサーバーID
(参考情報)
judge9 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 503 ms
46,724 KB
testcase_01 AC 496 ms
42,376 KB
testcase_02 AC 497 ms
42,376 KB
testcase_03 AC 502 ms
42,376 KB
testcase_04 AC 500 ms
42,376 KB
testcase_05 AC 885 ms
42,376 KB
testcase_06 AC 496 ms
42,376 KB
testcase_07 TLE -
testcase_08 TLE -
testcase_09 TLE -
testcase_10 AC 508 ms
42,376 KB
testcase_11 AC 511 ms
42,376 KB
testcase_12 TLE -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
# -*- coding: utf-8-*-
import numpy as np
if __name__ == '__main__':
    h, w = map(int, input().split(" "))
    l = []
    for i in range(h):
        l.append(list(input()))
    l = np.array(l)
    for i in range(h):
        for j in range(w):
            if i == 0 and j == 0:
                continue
            tl = np.copy(l)
            flag = True
            flag2 = False
            for a in range(h):
                for b in range(w):
                    if tl[a, b] == "#":
                        if a+i >= h:
                            flag = False
                        elif b+j >= w:
                            flag = False
                        elif tl[a+i, b+j] == "#":
                            tl[a,b] = "."
                            tl[a+i, b+j] = "."
                            flag2 = True
                        else:
                            flag = False
            if flag and flag2:
                print("YES")
                exit()
    print("NO")

0