結果
| 問題 | No.179 塗り分け |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-08-23 14:06:57 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,467 bytes |
| 記録 | |
| コンパイル時間 | 428 ms |
| コンパイル使用メモリ | 85,088 KB |
| 実行使用メモリ | 86,924 KB |
| 最終ジャッジ日時 | 2026-05-05 09:48:10 |
| 合計ジャッジ時間 | 21,190 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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')