結果

問題 No.179 塗り分け
ユーザー convexineqconvexineq
提出日時 2020-12-13 13:53:25
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,044 bytes
コンパイル時間 274 ms
コンパイル使用メモリ 81,788 KB
実行使用メモリ 76,156 KB
最終ジャッジ日時 2023-10-20 03:41:11
合計ジャッジ時間 4,408 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 47 ms
53,400 KB
testcase_01 AC 46 ms
53,400 KB
testcase_02 AC 40 ms
53,400 KB
testcase_03 AC 40 ms
53,400 KB
testcase_04 AC 40 ms
53,400 KB
testcase_05 AC 66 ms
75,280 KB
testcase_06 AC 41 ms
53,400 KB
testcase_07 WA -
testcase_08 AC 77 ms
75,440 KB
testcase_09 AC 91 ms
75,824 KB
testcase_10 AC 50 ms
61,596 KB
testcase_11 AC 50 ms
61,596 KB
testcase_12 AC 101 ms
75,916 KB
testcase_13 AC 41 ms
53,400 KB
testcase_14 AC 45 ms
59,160 KB
testcase_15 AC 40 ms
53,400 KB
testcase_16 AC 40 ms
53,400 KB
testcase_17 AC 39 ms
53,400 KB
testcase_18 AC 51 ms
63,824 KB
testcase_19 AC 51 ms
63,824 KB
testcase_20 AC 103 ms
75,936 KB
testcase_21 AC 105 ms
76,076 KB
testcase_22 AC 160 ms
75,980 KB
testcase_23 AC 48 ms
61,448 KB
testcase_24 AC 86 ms
75,864 KB
testcase_25 AC 42 ms
61,516 KB
testcase_26 AC 69 ms
75,740 KB
testcase_27 AC 84 ms
75,860 KB
testcase_28 AC 68 ms
75,756 KB
testcase_29 AC 93 ms
76,156 KB
testcase_30 AC 78 ms
75,800 KB
testcase_31 AC 90 ms
75,936 KB
testcase_32 AC 57 ms
75,116 KB
testcase_33 AC 94 ms
76,120 KB
testcase_34 AC 82 ms
75,772 KB
testcase_35 AC 90 ms
75,952 KB
testcase_36 AC 35 ms
53,400 KB
testcase_37 AC 36 ms
53,400 KB
testcase_38 AC 35 ms
53,400 KB
testcase_39 AC 35 ms
53,400 KB
testcase_40 AC 35 ms
53,400 KB
testcase_41 AC 35 ms
53,400 KB
testcase_42 AC 36 ms
53,400 KB
testcase_43 AC 50 ms
63,620 KB
testcase_44 AC 58 ms
75,056 KB
testcase_45 AC 39 ms
59,160 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
# Your code here!
import sys
read = sys.stdin.read
readline = sys.stdin.readline

#n,m = map(int,readline().split())
#*a, = map(int,readline().split())
#*b, = map(int,readline().split())

#h,w,n,k = map(int,input().split())

def check(a,b):
    valid = [vi[:] for vi in V]
    for i in range(h):
        for j in range(w):
            if valid[i][j]:
                if i+a >= h or j+b >= w or valid[i+a][j+b]==0:
                    return 0
                else:
                    valid[i+a][j+b] = 0
    return 1
    
h,w = map(int,input().split())
b = [input() for _ in range(h)]
V = [[1 if b[i][j]== "#" else 0 for j in range(w)] for i in range(h)]

ok = 0
for i in range(h):
    for j in range(w):
        if i==j==0: continue
        if check(i,j):
            ok = 1
            break
    if ok: break

for i in range(h): V[i] = V[i][::-1]
for i in range(h):
    for j in range(w):
        if i==j==0: continue
        if check(i,j):
            ok = 1
            break
    if ok: break

print("YES" if ok else "NO")
0