优先队列,按照当前已经消灭的怪兽数量倒序排列,限制每个位置访问的次数防止循环 #include<iostream> #include<vector> #include<cmath> #include<algorithm> #include<queue> using namespace std; int cmp(int a, int b) { return a > b; } struct Node { int x, y, step, cnt;//位置x,y,当前步数,当前消灭的怪兽个数 bool operator<...