摘要: 点击查看代码 #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 阅读(70) 评论(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 阅读(40) 评论(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 阅读(32) 评论(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 阅读(30) 评论(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 阅读(50) 评论(0) 推荐(0)