結果
| 問題 |
No.424 立体迷路
|
| ユーザー |
ヒッキープログラミングするスレ
|
| 提出日時 | 2016-09-23 00:10:16 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 872 bytes |
| コンパイル時間 | 90 ms |
| コンパイル使用メモリ | 12,800 KB |
| 実行使用メモリ | 11,008 KB |
| 最終ジャッジ日時 | 2024-11-17 15:16:10 |
| 合計ジャッジ時間 | 1,477 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 2 RE * 2 |
| other | AC * 2 WA * 1 RE * 18 |
ソースコード
h, w = list(map(int, input().split()))
sy, sx, gy, gx = list(map(int, input().split()))
b = []
for _ in range(h):
b.append(input().strip())
f = [[True] * w for _ in range(h)]
t = [[sy - 1, sx - 1]]
f[sy - 1][sx - 1] = False
while len(t) > 0:
s = []
for y, x in t:
if x > 0:
if f[y][x - 1]:
f[y][x - 1] = False
s.append([y, x - 1])
if y > 0:
if f[y - 1][x]:
f[y - 1][x] = False
s.append([y - 1, x])
if x < w - 1:
if f[y][x + 1]:
f[y][x + 1] = False
s.appen([y, x + 1])
if y < h - 1:
if f[y + 1][x]:
f[y + 1][x] = False
s.append([y + 1, x])
t = s
if f[gy - 1][gx - 1] == False:
break
print('NO' if f[gy - 1][gx - 1] else 'YES')
ヒッキープログラミングするスレ