結果
| 問題 | No.179 塗り分け |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-08-23 14:06:57 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,467 bytes |
| コンパイル時間 | 233 ms |
| コンパイル使用メモリ | 82,048 KB |
| 実行使用メモリ | 83,456 KB |
| 最終ジャッジ日時 | 2024-10-15 18:13:48 |
| 合計ジャッジ時間 | 19,349 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 6 |
| other | AC * 38 WA * 2 |
ソースコード
H, W = map(int, input().split())
S = [[1 if i == '#' else 0 for i in input()] for _ in range(H)]
from copy import deepcopy
for i in range(H):
for j in range(-W + 1, W):
if i == 0 and j <= 0:
continue
else:
s = deepcopy(S)
B = True
for h in range(H):
if B:
for w in range(W):
if s[h][w] == 1:
s[h][w] = 0
if h + i < H and 0 <= w + j < W and s[h + i][w + j]:
s[h + i][w + j] = 0
else:
B = False
break
else:
break
if B:
print('YES')
exit()
if H == 1 and W == 1 and S[0][0] == 0:
print('YES')
else:
print('NO')