使用BFS #include <iostream> #include<vector> #include<queue> #include<string> using namespace std; struct State{ int x,y,hp; int step; State(int x_,int y_,int hp_,int step_):x(x_),y(y_),hp(hp_),step(step_){} }; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n,m...