上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 26 下一页
摘要: \(n, v, s\) 都较小 朴素写法 时间复杂度 \(n \times v \times s\) 总体复杂度 \(100^{3} = 1 \times 10^{6}\) 点击查看代码 #include<iostream> using namespace std; const int N = 11 阅读全文
posted @ 2022-05-20 16:48 wKingYu 阅读(34) 评论(0) 推荐(0)
摘要: 1. 朴素做法(会超时) 点击查看代码 #include<iostream> using namespace std; const int N = 1010; int n, m; int v[N], w[N]; int f[N][N]; int main() { cin >> n >> m; for 阅读全文
posted @ 2022-05-16 14:28 wKingYu 阅读(37) 评论(0) 推荐(0)
摘要: 1. 朴素做法(二维数组) 点击查看代码 #include<iostream> using namespace std; const int N = 1010; int n, m; int v[N], w[N]; int f[N][N]; int main() { cin >> n >> m; fo 阅读全文
posted @ 2022-05-16 11:20 wKingYu 阅读(33) 评论(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 阅读(24) 评论(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 阅读(58) 评论(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 阅读(53) 评论(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 阅读(45) 评论(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 阅读(29) 评论(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 阅读(46) 评论(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 阅读(48) 评论(0) 推荐(0)
上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 26 下一页