基本的BFS搜索1.记得每次都要清空队列,因为忘清空了卡了很久2.hdu和poj上的数据输入方式是不一样的 #include<iostream> #include<queue> #include<cstdio> #include<string.h> using namespace std; const int N = 1e5+5; int vis[N], step[N]; queue <int> q; int BFS(int n, int k){ int now, next; vis[n] = 1; step[n] = 0; q.pu...