随笔分类 -  数学

摘要:复杂度 O(log(n)) 总体复杂度 105×log(2×109)4×106 点击查看代码 #include<iostream> using namespace std; typedef long lon 阅读全文
posted @ 2022-05-11 20:22 wKingYu 阅读(42) 评论(0) 推荐(0) 编辑
摘要:复杂度 O(log(n)) 总体复杂度 105×log(2×109)4×106 点击查看代码 #include<iostream> using namespace std; int exgcd(int 阅读全文
posted @ 2022-05-09 23:41 wKingYu 阅读(35) 评论(0) 推荐(0) 编辑
摘要:复杂度 O(log(k)) (k 是指数) 总体复杂度 105×log(2×109)4×106 点击查看代码 #include<iostream> using namespace std; typedef 阅读全文
posted @ 2022-05-09 21:38 wKingYu 阅读(29) 评论(0) 推荐(0) 编辑
摘要:复杂度 O(log(k)) (k 是指数) 总体复杂度 105×log(2×109)4×106 点击查看代码 #include<iostream> using namespace std; typedef 阅读全文
posted @ 2022-05-09 13:26 wKingYu 阅读(32) 评论(0) 推荐(0) 编辑
摘要:复杂度 O(n) 总体复杂度 106 点击查看代码 #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 阅读(37) 评论(0) 推荐(0) 编辑
摘要:复杂度 O(n) 总体复杂度 100×2×1094.5×106 点击查看代码 #include<iostream> using namespace std; void solve(in 阅读全文
posted @ 2022-05-09 09:37 wKingYu 阅读(29) 评论(0) 推荐(0) 编辑
摘要:欧几里得算法(辗转相除法) 复杂度 O(log(n)) 总体复杂度 105×log(2×109)4×106 点击查看代码 #include<iostream> using namespace std; in 阅读全文
posted @ 2022-05-08 22:14 wKingYu 阅读(33) 评论(0) 推荐(0) 编辑
摘要:复杂度 O(n) 总体复杂度 100×2×1094.5×106 点击查看代码 #include<iostream> #include<unordered_map> using name 阅读全文
posted @ 2022-05-08 21:42 wKingYu 阅读(56) 评论(0) 推荐(0) 编辑
摘要:复杂度 O(n) 总体复杂度 100×2×1094.5×106 点击查看代码 #include<iostream> #include<unordered_map> using name 阅读全文
posted @ 2022-05-08 21:09 wKingYu 阅读(104) 评论(0) 推荐(0) 编辑
摘要:试除法 复杂度 O(n) 总体复杂度 100×2314.6×106 点击查看代码 #include<iostream> #include<vector> #include<algorithm> usi 阅读全文
posted @ 2022-05-08 19:58 wKingYu 阅读(20) 评论(0) 推荐(0) 编辑
摘要:埃氏筛法 复杂度 O(nlog(log(n))) 总体复杂度 106×log(log(106))5×106 点击查看代码 #include<iostream> using namespace std; const in 阅读全文
posted @ 2022-05-08 17:34 wKingYu 阅读(38) 评论(0) 推荐(0) 编辑
摘要:试除法 复杂度 O(log(n)) ~ O(n) 100×log(231)=31×100×log(2)=3100 < 总体复杂度 \(< 100 \times \sqrt{2^{31}} \approx 4 阅读全文
posted @ 2022-05-08 16:11 wKingYu 阅读(37) 评论(0) 推荐(0) 编辑
摘要:试除法 复杂度 O(n) 总体复杂度 100×2314.6×106 点击查看代码 #include<iostream> using namespace std; bool is_prime(int n 阅读全文
posted @ 2022-05-07 23:48 wKingYu 阅读(31) 评论(0) 推荐(1) 编辑
摘要:点击查看代码 class Solution { public: vector<vector<int>> res; vector<vector<int>> permutation(vector<int>& nums) { sort(nums.begin(), nums.end()); do { res 阅读全文
posted @ 2022-04-23 22:42 wKingYu 阅读(23) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #include<bits/stdc++.h> using namespace std; long long n, m, total, sum1, sum2; int main() { cin >> n >> m; int min_mn = min(m ,n); for (int i 阅读全文
posted @ 2022-04-10 14:57 wKingYu 阅读(136) 评论(0) 推荐(0) 编辑

欢迎阅读『数学』
点击右上角即可分享
微信分享提示