#include<vector>#include<iostream>#include<algorithm>usingi64 =longlong;usingvint = std::vector<int>;usingPII = std::pair<int,int>;intmain(void){//Think twice, code once.std::ios::sync_with_stdio(false); i64 a[3
AtCoder Regular Contest 185 题解 A - mod M Game 2 第一个观察是如果一个人手中还有 2 张牌,那么他一定不会被秒。 这可以推出决定胜负的时刻一定是 Alice 和 Bob 手中只剩一张牌的时候,此时如果 Alice 被秒了,那么她就似了,否则她就赢了。 考虑Alice 什么时候能被秒。记决定胜负的时刻 Alice 手中...
E:用二进制表示放的数字,然后状压$DP$。 F:$biset$优化$DP$预处理,乱搞贪心。 ARC 059 D:傻题,存在长的合法子串就一定会存在短的。 E:前缀和优化$DP$。 F:每个长度为$len$的串出现的概率是相同的,求到长度为$len$的方案数然后除$2^{len}$。 ARC 060 D:对$b$分大于根号和小于根号讨论。 E:倍增...
AtCoder AtCoder Regular Contest 194 (Div. 2). A - Operations on a Stack 原题链接简单 作者: Flor_7 , 2025-03-10 09:10:26 · 湖北 , 所有人可见 , 阅读 8 0 对于一个连续的负数序列,当个数为偶数时,可以全部消去;当个数为奇数时,可以选择位置1,3,5,…中最大的负数留下。这样原...
We will hold estie Programming Contest 2024 (AtCoder Regular Contest 188). Contest URL:https://atcoder.jp/contests/arc188 Start Time:http://www.timeanddate.com/worldclock/fixedtime.html?iso=20241123T2100&p1=248 Duration: 120 minutes
args) { ((cout << args << ' '), ...) << '\n'; } const int N = 2e5 + 10; void solve() { int n; cin >> n; vector<int> a(n); for (auto &x : a) cin >> x; if (is_sorted(a.begin(), a.end())) return cout << "0\n", void(); int maxv = 0; for ...
We will hold AtCoder Regular Contest 186. Contest URL:https://atcoder.jp/contests/arc186 Start Time:http://www.timeanddate.com/worldclock/fixedtime.html?iso=20241027T2100&p1=248 Duration: 120 minutes Number of Tasks: 5 Writer:nuip ...
#include <bits/stdc++.h> using ll = long long; int main() { std::ios::sync_with_stdio(false); std::cin.tie(0); std::cout.tie(0); int n; std::cin >> n; std::vector<int> a(n); for (int i = 0; i < n; i++) { std::cin >> a[i]; } ll max[2]{-(int)1...
前面四道题都比较简单,后面两道题的题面到现在都没有加载出来。 A - Bridge and Sheets 直接计算就好了。具体而言,使用一个变量记录前面一个木板右端点是哪里,然后在看当前木板的时候,如果中间有空隙就加上,然后接着维护下去就行了。 intN;longlongW,L;intmain(){cin>>N>>L>>W;longlongr=0;longlongans...
AtCoder Regular Contest 124 C - LCM of GCDs (记忆化搜索),题意:有两个容器$x$和$y$,$n$对数$a[i]$和$b[i]$,每次选一对数将$a[i]$或者$b[i]$放入容器$x$或$y$中,全部放完后将$x$和$y$中所有数求gcd,然后得到的两个数求lcm,问能得到的最大lcm是多少.题解:这题的$n$给的很