上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 20 下一页
摘要: 例题:P3366 【模板】最小生成树 - 洛谷 | 计算机科学教育新生态 (luogu.com.cn) Kruskal #include <bits/stdc++.h> #define debug(a) cout<<#a<<"="<<a<<'\n'; using namespace std; usi 阅读全文
posted @ 2023-12-24 12:42 Ke_scholar 阅读(10) 评论(0) 推荐(0) 编辑
摘要: 例题素数密度 template<typename T> struct segment_sieve { vector<bool> is_prime, is_prime_small; vector<T> prime; segment_sieve() { is_prime.resize(1000010); 阅读全文
posted @ 2023-12-16 16:27 Ke_scholar 阅读(4) 评论(0) 推荐(0) 编辑
摘要: bool isPrime(int x) { if (x <= 3) return x > 1; if (x % 6 != 1 && x % 6 != 5) return false; int n = sqrt(x); for (int i = 5; i <= n; i += 6) if (x % i 阅读全文
posted @ 2023-12-16 15:07 Ke_scholar 阅读(2) 评论(0) 推荐(0) 编辑
摘要: #include <bits/stdc++.h> using namespace std; struct toposort { vector<vector<int>> e; vector<int> tp , din; int n ; toposort() {} toposort(int n) { t 阅读全文
posted @ 2023-12-12 23:09 Ke_scholar 阅读(18) 评论(0) 推荐(0) 编辑
摘要: P1525 [NOIP2010 提高组] 关押罪犯 - 洛谷 | 计算机科学教育新生态 (luogu.com.cn) 种类并查集 #include <bits/stdc++.h> #define debug(a) cout<<#a<<"="<<a<<'\n'; using namespace std 阅读全文
posted @ 2023-12-12 17:24 Ke_scholar 阅读(20) 评论(0) 推荐(0) 编辑
摘要: include <bits/stdc++.h> using namespace std; struct LCA { int n; vector<int> dep; vector<vector<int>> e; vector<array<int, 21>> fa; LCA() {} LCA(int n 阅读全文
posted @ 2023-12-12 02:08 Ke_scholar 阅读(8) 评论(0) 推荐(0) 编辑
摘要: struct DIJ { using i64 = long long; using PII = pair<i64, i64>; vector<i64> dis; vector<vector<PII>> G; DIJ() {} DIJ(int n) { dis.assign(n + 1, 1e18); 阅读全文
posted @ 2023-12-09 23:44 Ke_scholar 阅读(7) 评论(0) 推荐(0) 编辑
摘要: struct Matrix { i64 N; vector<vector<i64>> A; Matrix() { N = 0;} Matrix(int n) { N = n; A.resize(N + 1); for (int i = 0; i <= N; i ++) A[i].resize(N + 阅读全文
posted @ 2023-12-05 15:20 Ke_scholar 阅读(14) 评论(0) 推荐(0) 编辑
摘要: #include <bits/stdc++.h> using namespace std; struct trie { int n; vector<array<int, 26>> trans; vector<int> cnt; trie() : n(0) { new_node(); } int ne 阅读全文
posted @ 2023-12-04 12:51 Ke_scholar 阅读(16) 评论(0) 推荐(0) 编辑
摘要: 哈尔滨华德学院-新生编程挑战赛 A-签到_哈尔滨华德学院-新生编程挑战赛(同步赛) (nowcoder.com) 签到 #include <bits/stdc++.h> #define debug(a) cout<<#a<<"="<<a<<'\n'; using namespace std; usi 阅读全文
posted @ 2023-12-03 17:02 Ke_scholar 阅读(6) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 20 下一页