随笔分类 - 数学
摘要:点击查看代码 #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
阅读全文
摘要:全集 - 集合的补集 点击查看代码 #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
阅读全文
摘要:构造 点击查看代码 #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
阅读全文
摘要:点击查看代码 #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
阅读全文
摘要:分治 递归 点击查看代码 #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
阅读全文
摘要:点击查看代码 #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", &
阅读全文
摘要:数论 + 贪心 点击查看代码 #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,
阅读全文
摘要:点击查看代码 #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]
阅读全文
摘要:点击查看代码 #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]; //
阅读全文
摘要:点击查看代码 #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 (
阅读全文
摘要:点击查看代码 #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)
阅读全文
摘要:点击查看代码 #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;
阅读全文
摘要:点击查看代码 #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 &
阅读全文
摘要:点击查看代码 #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)
阅读全文
摘要:递推 复杂度 总体复杂度 点击查看代码 #include<iostream> using namespace std; const int N = 2e3 + 10, mod = 1e9 + 7; int c[N
阅读全文
摘要:复杂度 总体复杂度 点击查看代码 #include<iostream> using namespace std; const int N = 110; int n, a[N][N]; int gauss() { i
阅读全文
摘要:复杂度 总体复杂度 点击查看代码 #include<iostream> #include<cmath> using namespace std; const int N = 110; const double ep
阅读全文
摘要:点击查看代码 #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 =
阅读全文