摘要: #include #include using namespace std; typedef long long ll; int n; void bfs(ll x){ queue q; q.push(x); while( !q.empty() ){ ll t = q.front(); q.pop(); if(t % n == 0){ cout... 阅读全文
posted @ 2019-07-30 18:42 zuo_ti_jia 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 又是给一个迷宫找最短路径,不过不同的是要把路径输出 思路:先写一个正常的BFS,但是多加入一个数组,记录每个点的上一个点,到达最后一个点时再DFS向上搜索路径 阅读全文
posted @ 2019-07-30 18:16 zuo_ti_jia 阅读(190) 评论(0) 推荐(0) 编辑