#include<iostream> #include<vector> #include<string> #include<algorithm> #include<queue> #include<map> using namespace std; struct ele //记录层数 { string str; int step; }; int BFS(string s) //广度搜索 { map<string, int> visited; ...