马和兵各自维护自己的一个visited数组防止重复,然后bfs层序遍历即可。python BFS 过了85%, 不知道C++的话能不能100% ……
1 3

相关推荐

牛客网
牛客网在线编程
牛客网题解
牛客企业服务