随笔分类 -  数学

摘要:点击查看代码 #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 阅读(52) 评论(0) 推荐(0) 编辑
摘要:全集 - 集合的补集 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 1e5 + 10; const LL mod = 100003; LL n, m; LL qmi(LL 阅读全文
posted @ 2022-08-03 23:30 wKingYu 阅读(23) 评论(0) 推荐(0) 编辑
摘要:构造 点击查看代码 #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_p 阅读全文
posted @ 2022-08-03 23:05 wKingYu 阅读(26) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #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-03 22:44 wKingYu 阅读(18) 评论(0) 推荐(0) 编辑
摘要:分治 递归 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 1e5 + 10; const LL mod = 9901; LL a, b; LL qmi(LL a, LL 阅读全文
posted @ 2022-07-23 10:55 wKingYu 阅读(24) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 1e6 + 10; void solve() { LL p, q, b; scanf("%lld %lld %lld", & 阅读全文
posted @ 2022-06-26 22:02 wKingYu 阅读(74) 评论(0) 推荐(0) 编辑
摘要:数论 + 贪心 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 1e6 + 10; int n; void solve() { cin >> n; int res = 1, 阅读全文
posted @ 2022-06-26 13:04 wKingYu 阅读(20) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #include<iostream> #include<cstring> #include<unordered_set> using namespace std; const int N = 110; int n; int f[N]; int sg(int x) { if (f[x] 阅读全文
posted @ 2022-05-16 00:24 wKingYu 阅读(18) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #include<iostream> #include<cstring> #include<unordered_set> using namespace std; const int N = 110, M = 1e4 + 10; int k, n; int s[N], f[M]; // 阅读全文
posted @ 2022-05-15 22:15 wKingYu 阅读(38) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #include<iostream> using namespace std; int main() { int n; cin >> n; int res = 0; for (int i = 1; i <= n; i ++) { int x; scanf("%d", &x); if ( 阅读全文
posted @ 2022-05-15 20:30 wKingYu 阅读(35) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #include<iostream> using namespace std; int main() { int n; cin >> n; int res = 0; while (n --) { int x; scanf("%d", &x); res ^= x; } if (res) 阅读全文
posted @ 2022-05-15 17:52 wKingYu 阅读(31) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #include<iostream> using namespace std; typedef long long LL; const int N = 20; int n, m; int p[N]; int main() { cin >> n >> m; for (int i = 0; 阅读全文
posted @ 2022-05-14 21:54 wKingYu 阅读(16) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #include<iostream> using namespace std; typedef long long LL; const int mod = 1e9 + 7; int qmi(int a, int k) { int res = 1; while (k) { if (k & 阅读全文
posted @ 2022-05-14 21:05 wKingYu 阅读(26) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #include<iostream> #include<vector> using namespace std; const int N = 5e3 + 10; int primes[N], cnt, sum[N]; bool st[N]; void get_primes(int n) 阅读全文
posted @ 2022-05-14 17:13 wKingYu 阅读(26) 评论(0) 推荐(0) 编辑
摘要:复杂度 g(n) log(n) (来自 OI Wiki) 总体复杂度 20×105×log(105)×log(1018)=4×107 点击查看代码 #include<iostream> using 阅读全文
posted @ 2022-05-14 15:53 wKingYu 阅读(50) 评论(0) 推荐(0) 编辑
摘要:预处理 复杂度 O(nlog(n)) 总体复杂度 105×log(109)=3×106 点击查看代码 #include<iostream> using namespace std; typedef long long L 阅读全文
posted @ 2022-05-14 13:00 wKingYu 阅读(48) 评论(0) 推荐(0) 编辑
摘要:递推 复杂度 O(n2) 总体复杂度 20002=4×106 点击查看代码 #include<iostream> using namespace std; const int N = 2e3 + 10, mod = 1e9 + 7; int c[N 阅读全文
posted @ 2022-05-14 11:29 wKingYu 阅读(20) 评论(0) 推荐(0) 编辑
摘要:复杂度 O(n3) 总体复杂度 1003=1×106 点击查看代码 #include<iostream> using namespace std; const int N = 110; int n, a[N][N]; int gauss() { i 阅读全文
posted @ 2022-05-12 17:53 wKingYu 阅读(45) 评论(0) 推荐(0) 编辑
摘要:复杂度 O(n3) 总体复杂度 1003=1×106 点击查看代码 #include<iostream> #include<cmath> using namespace std; const int N = 110; const double ep 阅读全文
posted @ 2022-05-12 17:26 wKingYu 阅读(29) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #include<iostream> using namespace std; typedef long long LL; LL exgcd(LL a, LL b, LL & x, LL & y) { if (!b) { x = 1, y = 0; return a; } LL d = 阅读全文
posted @ 2022-05-11 23:38 wKingYu 阅读(35) 评论(0) 推荐(0) 编辑

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