結果

問題 No.179 塗り分け
ユーザー Woo-Cie
提出日時 2019-03-23 11:38:40
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 1,020 bytes
コンパイル時間 155 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 51,048 KB
最終ジャッジ日時 2024-09-22 03:52:10
合計ジャッジ時間 22,599 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 6
other AC * 3 TLE * 4 -- * 33
権限があれば一括ダウンロードができます

ソースコード

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