結果
| 問題 |
No.179 塗り分け
|
| コンテスト | |
| ユーザー |
maatanbeta
|
| 提出日時 | 2017-05-18 10:47:23 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,241 bytes |
| コンパイル時間 | 136 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 11,008 KB |
| 最終ジャッジ日時 | 2024-10-03 03:44:31 |
| 合計ジャッジ時間 | 14,274 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 6 |
| other | AC * 35 WA * 5 |
ソースコード
from copy import deepcopy
def search(yi, xi):
SC = deepcopy(S)
yt = 0
while(yt < H):
xt = 0
while(xt < W):
if SC[yt][xt] == "#":
try:
if SC[yt+yi][xt+xi] == "#":
SC[yt+yi][xt+xi] = "$"
else:
return False
except IndexError:
return False
xt += 1
yt += 1
return True
H, W = list(map(int, input().split()))
S = [0] * H
for i in range(H):
S[i] = list(input())
printed = False
y = 0
while(y < H):
x = 0
while(x < W):
if S[y][x] == "#":
yi = 0
while(y + yi < H):
xi = 0
while(x + xi < W):
if yi != 0 or xi != 0:
if S[y+yi][x+xi] == "#":
if search(yi, xi):
yi, xi = float("inf"), float("inf")
print("YES")
printed = True
xi += 1
yi += 1
y, x = float("inf"), float("inf")
x += 1
y += 1
if y >= H and not printed:
print("NO")
maatanbeta