随笔分类 - 搜索
摘要:AcWing 842. 排列数字 原题链接 #include <iostream> using namespace std; const int N = 10; int n; int path[N]; bool st[N]; void dfs(int u) { if(u == n) { for(in
阅读全文
摘要:AcWing 844. 走迷宫 原题链接 所有边权都一样时才可以用BFS求最短路,一般情况下都要用专门的最短路算法求最短路。 queue $\leftarrow$ 初始状态 while queue不空 { t $\leftarrow$ 队头 拓展 t } #include <iostream> #i
阅读全文

浙公网安备 33010602011771号