随笔分类 - 区域赛
摘要:第 45 届国际大学生程序设计竞赛(ICPC)亚洲区域赛(昆明) BEF 没补, 出题人定义的是hard, 是给金牌S+队伍写的, 菜鸡根本写不到, 写到了考场也出不了, 就放弃了 A - AC 和数据备份一样, 反悔贪心模型, 用堆来维护 将 (i,i+1) 变成 ac, 下
阅读全文
摘要:2020-2021 ACM-ICPC Brazil Subregional Programming Contest A Sticker Album 概率递推, fi 表示得到 i 张贴纸要开包数的期望 则当 a > 0 时, 1~a, fi = 1(开一包至少 a 张贴纸) i > a, 则 \(f
阅读全文
摘要:2017 ECNA Regional Contest A B C 模拟 int main() { IOS; string s; cin >> s; int x = 0, y = 0; rep(i, 0, s.size() - 2 >> 1) x += s[i] - 'A', y += s[i + (
阅读全文
摘要:2018 Benelux Algorithm Programming Contest (BAPC 18) A - A Prize No One Can Win int main() { IOS; cin >> n >> m; VI a(n); k = 1; for (auto &i : a) cin
阅读全文
摘要:模拟 + dp 场?
阅读全文
摘要:A 最基础的时间 2 * (2 * n * t) 然后是等待时间, 即 要么在左边等 第 2 个 guy, 或者乘船返回的等 1 个 guy 即 max(0, min(x - 2 * n * t + t + t, max(t, x - 2 * n * t + t))) int main() { IO
阅读全文
摘要:A 分块, 签到 int main() { IOS; int cas = 0; for (cin >> _; _; --_) { cin >> n; __int128 cur = 0; for (int i = 1, j; i <= n; i = j + 1) { j = min(n, n / (n
阅读全文
摘要:A 枚举倍数就行了 然后挨个去查找, 调和级数nlogn, 这就是好多人这样过的, 这是数据水了.... 毕竟 n 是 1e7, 这是卡爆他们的数据 100000 1, 2, ..., 9999, 10000000 大概需要计算1e8+(还不算循环里的两条指令), 再好的评侧鸡也不能跑到 1e8+
阅读全文
摘要:
笨蛋!恋爱!召唤兽!!
阅读全文
![](https://images.cnblogs.com/cnblogs_com/2aptx4869/1811094/o_2010210857414f10387c05697923f8000103.jpg)
摘要:A 除了 k = 1, 先手要么将一堆石子直接取完, 要么将一堆石子分成两堆 (不用我说为啥1不行吧(一堆石子为2, 你取不完 也分不了)? 所以直接特判) 这种取法相当于将当前的石子堆数改变了, 要么 -1, 要么 -1+2 = 1, 总之能保证你的局面始终为奇数(先手必胜) #include <
阅读全文
摘要:#A 签到 #include <iostream> #include <vector> #include <string> #include <queue> #include <cstdio> #include <algorithm> #include <cmath> #include <cstri
阅读全文
摘要:A 题解 rmq 代码 #include <bits/stdc++.h> #define all(n) (n).begin(), (n).end() #define se second #define fi first #define pb push_back #define mp make_pai
阅读全文
摘要:B(DP) 最重要的是状态转移对同一阶段的影响, 就像01背包优化为什么要倒叙,但这道题不光要倒叙,还要把这阶段的转移先存起来,最后统一保存 就避免了转移同一阶段相互影响 至于排序,当然希望升级多余的经验越多越好。 #include <bits/stdc++.h> #define RE regist
阅读全文
摘要:E (尺取法) #include <bits/stdc++.h> #define ll long long using namespace std; const int maxn = 2e5 + 5; int n; char s[maxn]; int main() { cin >> s + 1 >>
阅读全文
摘要:A #include <bits/stdc++.h> using namespace std; int a, b , n, c; int main() { cin >> a >> b >> n; for (int i = 1; i <= n; ++i) { cin >> c; cout << c <
阅读全文
摘要:A(题解看注释) #include <bits/stdc++.h> #define P pair<int, int> using namespace std; struct mp { int p[7][7]; bool friend operator <(const mp &a, const mp
阅读全文
摘要:A #include <bits/stdc++.h> using namespace std; int n, a, b, c; int main() { scanf("%d", &n); for (int i = 1; i <= n; ++i) { scanf("%d%d%d", &a, &b, &
阅读全文
摘要:A #include <bits/stdc++.h> using namespace std; int x, y, d; int main() { scanf("%d%d%d", &x, &y, &d); x -= d << 1; y -= d << 1; if (x <= 0 || y <= 0)
阅读全文