#30871: python AC BFS


forkidlai (forkidlai)

學校 : 不指定學校
編號 : 192336
來源 : [220.130.18.196]
最後登入時間 :
2024-02-06 15:07:01
c124. 00532 - Dungeon Master -- UVa532 | From: [211.21.129.5] | 發表日期 : 2022-06-17 15:02

# 3D 迷宮, BFS
# 可走的位置標示0,不可走標示-1,起點標示1,加入qlist.append([z,y,x])待走清單
# 逐一從qlist取待走檢查下一步,上下左右上下樓6個位置檢查標示 = 0 ,則可走,下一位置標示=目前位置標示+1,此點加入qlist
# 前述檢查下一步[z,y,x]若 = 目的地位置,則ans=目前位置標示(已走步數),break
 
ZeroJudge Forum