摘要: 欧几里得算法(辗转相除法) 复杂度 \(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)