C++深度搜索优先解法: #include<iostream> #include<vector> #include<algorithm> #include<math.h> using namespace std; struct room { int adt; int chd; double pri; room(int a, int c, double p) : adt(a), chd(c), pri(p) {} }; ...