上一页 1 2 3 4 5 6 7 8 ··· 26 下一页
摘要: 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 1e6 + 10; int n; vector<int> primes; bool st[N]; void get_prim 阅读全文
posted @ 2022-08-07 23:38 wKingYu 阅读(47) 评论(0) 推荐(0) 编辑
摘要: DFS 求方案个数 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 100 + 10; int n, m, x, y; bool st[N][N]; int res; in 阅读全文
posted @ 2022-08-07 22:42 wKingYu 阅读(19) 评论(0) 推荐(0) 编辑
摘要: Flood Fill 的 DFS 写法 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 100 + 10; int n, m; char g[N][N]; bool st[ 阅读全文
posted @ 2022-08-07 22:31 wKingYu 阅读(20) 评论(0) 推荐(0) 编辑
摘要: DFS + 去重 复杂度 $O(n^{2})$ 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 100 + 10; int n; char g[N][N]; int xa, 阅读全文
posted @ 2022-08-07 22:19 wKingYu 阅读(16) 评论(0) 推荐(0) 编辑
摘要: A* 算法 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; typedef pair<int,string> PIS; const int N = 1e6 + 10; string start; in 阅读全文
posted @ 2022-08-07 13:36 wKingYu 阅读(27) 评论(0) 推荐(0) 编辑
摘要: A* 算法 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; typedef pair<int,int> PII; typedef pair<int,PII> PIPII; const int N = 阅读全文
posted @ 2022-08-06 18:24 wKingYu 阅读(6) 评论(0) 推荐(0) 编辑
摘要: 双向广搜 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 10 + 10; int n; string A, B; string a[N], b[N]; queue<str 阅读全文
posted @ 2022-08-06 12:38 wKingYu 阅读(22) 评论(0) 推荐(0) 编辑
摘要: DFS + LCA 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 1000 + 10; int n, m; int l[N], r[N], p[N]; int d[N]; 阅读全文
posted @ 2022-08-06 10:38 wKingYu 阅读(13) 评论(0) 推荐(0) 编辑
摘要: 二分 + BFS 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 20000 + 10; int n, m; int h[N], e[N], ne[N], w[N], id 阅读全文
posted @ 2022-08-05 23:38 wKingYu 阅读(13) 评论(0) 推荐(0) 编辑
摘要: 双端队列 BFS 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 500 + 10; const int INF = 0x3f3f3f3f; #define x first 阅读全文
posted @ 2022-08-05 22:41 wKingYu 阅读(20) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 26 下一页