上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 26 下一页
摘要: 复杂度 \(O(n)\) 总体复杂度 \(10^{6}\) 点击查看代码 #include<iostream> using namespace std; const int N = 1e6 + 10; typedef long long LL; int primes[N], cnt; int eul 阅读全文
posted @ 2022-05-09 11:53 wKingYu 阅读(46) 评论(0) 推荐(0)
摘要: 复杂度 \(O(\sqrt{n})\) 总体复杂度 \(100 \times \sqrt{2 \times 10^{9}} \approx 4.5 \times 10^{6}\) 点击查看代码 #include<iostream> using namespace std; void solve(in 阅读全文
posted @ 2022-05-09 09:37 wKingYu 阅读(47) 评论(0) 推荐(0)
摘要: 欧几里得算法(辗转相除法) 复杂度 \(O(log(n))\) 总体复杂度 \(10^{5} \times log(2 \times 10^{9}) \approx 4 \times 10^{6}\) 点击查看代码 #include<iostream> using namespace std; in 阅读全文
posted @ 2022-05-08 22:14 wKingYu 阅读(43) 评论(0) 推荐(0)
摘要: 复杂度 \(O(\sqrt{n})\) 总体复杂度 \(100 \times \sqrt{2 \times 10^{9}} \approx 4.5 \times 10^{6}\) 点击查看代码 #include<iostream> #include<unordered_map> using name 阅读全文
posted @ 2022-05-08 21:42 wKingYu 阅读(83) 评论(0) 推荐(0)
摘要: 复杂度 \(O(\sqrt{n})\) 总体复杂度 \(100 \times \sqrt{2 \times 10^{9}} \approx 4.5 \times 10^{6}\) 点击查看代码 #include<iostream> #include<unordered_map> using name 阅读全文
posted @ 2022-05-08 21:09 wKingYu 阅读(120) 评论(0) 推荐(0)
摘要: 试除法 复杂度 $ O(\sqrt{n})$ 总体复杂度 \(100 \times \sqrt{2^{31}} \approx 4.6 \times 10^{6}\) 点击查看代码 #include<iostream> #include<vector> #include<algorithm> usi 阅读全文
posted @ 2022-05-08 19:58 wKingYu 阅读(37) 评论(0) 推荐(0)
摘要: 埃氏筛法 复杂度 \(O(n*log(log(n)))\) 总体复杂度 \(10^{6} \times log(log(10^{6})) \approx 5 \times 10^{6}\) 点击查看代码 #include<iostream> using namespace std; const in 阅读全文
posted @ 2022-05-08 17:34 wKingYu 阅读(49) 评论(0) 推荐(0)
摘要: 试除法 复杂度 \(O(log(n))\) ~ \(O(\sqrt{n})\) \(100 \times log(2^{31}) = 31 \times 100 \times log(2) = 3100\) < 总体复杂度 \(< 100 \times \sqrt{2^{31}} \approx 4 阅读全文
posted @ 2022-05-08 16:11 wKingYu 阅读(64) 评论(0) 推荐(0)
摘要: 试除法 复杂度 \(O(\sqrt{n})\) 总体复杂度 $100 \times \sqrt{2^{31}} \approx 4.6 \times 10^{6} $ 点击查看代码 #include<iostream> using namespace std; bool is_prime(int n 阅读全文
posted @ 2022-05-07 23:48 wKingYu 阅读(40) 评论(0) 推荐(1)
摘要: 点击查看代码 #include<iostream> #include<cstring> using namespace std; const int N = 510, M = 1e5 + 10; int n1, n2, m; int h[N], e[M], ne[M], idx; bool st[N 阅读全文
posted @ 2022-05-07 23:25 wKingYu 阅读(32) 评论(0) 推荐(0)
上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 26 下一页