随笔分类 -  算法 / DFS/递归/回溯

摘要:1.bfs没法回溯,会出现应该能到达的位置被访问 2.多起点 struct pp{ int x; int y; int step; int vis[10][10]; }; int dx[4]={0,0,1,-1}; int dy[4]={1,-1,0,0}; int m; int n; int vi 阅读全文
posted @ 2022-10-04 19:32 lwx_R 阅读(32) 评论(0) 推荐(0) 编辑
摘要:int l; int len; vector<string> v; vector<string> letterCasePermutation(string s) { len=s.size(); l=0; transform(s.begin(),s.end(),s.begin(),::toupper) 阅读全文
posted @ 2022-09-13 18:59 lwx_R 阅读(29) 评论(0) 推荐(0) 编辑
摘要:dfs时把条件回溯到上一个节点 1.求Cnm LC77 int vis[25]; vector<int> v; vector<vector<int>> ans; vector<vector<int>> combine(int n, int k) { /* CNM dfs一个没访问且大于i的数 */ 阅读全文
posted @ 2022-09-13 18:58 lwx_R 阅读(30) 评论(0) 推荐(0) 编辑
摘要:[http://ybt.ssoier.cn:8088/problem_show.php?pid=1211]() #include <iostream> #include <algorithm> #include <cstring> #include <cstdio> #include <map> # 阅读全文
posted @ 2022-02-22 19:56 lwx_R 阅读(44) 评论(0) 推荐(0) 编辑
摘要:[http://ybt.ssoier.cn:8088/problem_show.php?pid=1199]() 一本通 1199 #include <iostream> #include <cstring> #include <cstdio> #define maxn 10000005 typede 阅读全文
posted @ 2022-02-22 19:54 lwx_R 阅读(23) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <algorithm> #include <cstring> #include <cstdio> #include <map> #include <queue> #include <set> #include <iterator> #incl 阅读全文
posted @ 2022-02-22 19:49 lwx_R 阅读(55) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <algorithm> #include <cstring> #include <cstdio> #include <map> #include <queue> #include <set> #include <iterator> #incl 阅读全文
posted @ 2022-02-22 19:42 lwx_R 阅读(34) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <algorithm> #include <cstring> #include <cstdio> #include <map> #include <stack> #include <queue> #include <set> #include 阅读全文
posted @ 2022-02-13 16:48 lwx_R 阅读(315) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <algorithm> #include <cstring> #include <cstdio> #include <map> #include <queue> #include <set> #include <iterator> #incl 阅读全文
posted @ 2022-02-13 16:47 lwx_R 阅读(107) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示