We will hold Marubeni Programming Contest 2024 (AtCoder Regular Contest 183). Contest URL: https://atcoder.jp/contests/arc183 Start Time: http://www.timeanddate.com/worldclock/fixedtime.html?iso=20240825T2100&p1=248 Duration: 120 minutes Number of Tasks: 6 Writer: maroonrk Tester: maspy,...
#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]; std::cin >> a[0] >> a[1] >> a[2]; i64 x = a[0] ...
E:用二进制表示放的数字,然后状压$DP$。 F:$biset$优化$DP$预处理,乱搞贪心。 ARC 059 D:傻题,存在长的合法子串就一定会存在短的。 E:前缀和优化$DP$。 F:每个长度为$len$的串出现的概率是相同的,求到长度为$len$的方案数然后除$2^{len}$。 ARC 060 D:对$b$分大于根号和小于根号讨论。 E:倍增...
情况一:有直连边 答案是 w[s] + w[t] 不存在更优解 情况二:需要借助第三个边 此时答案为w[s] + w[t] + min{ min(l_s,l_t)左边最小的w(r边),max(r_s,r_t)右边最小的w(l边) } 情况三 : 需要借助2个边(需要排除s t的包含关系,证明显然) 此时答案为w[s] + w[t] + min{ max(...
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 ...
AtCoder Regular Contest 182 题解 A - Chmax Rush!发现一个数能向哪边覆盖只由再他之后操作且 vv 比他大的操作决定。 所以扫一遍确定方向之后乘起来就好。B - |{floor(A_i/2^k)}|首先不难发现 <2k−1<2k−1 的元素是无用的,因为它们会由 ≥2k−1≥2k−1 的元素除以 2 的幂得到。先想...
其次我们写出转移,并构造转移矩阵:发现如果设“某一状态为某一质数有没有”无法转移,所以我们先令第i(0≤i<6)个质数的编号为i,个数为a_i(a_i=0表示没有这个质数),则显然一个序列的答案为(a_0+1)(a_1+1)(a_2+1)(a_3+1)(a_4+1)(a_5+1)而如果我们在序列末尾加入一个6则答案就变成(a_0...
前面四道题都比较简单,后面两道题的题面到现在都没有加载出来。 A - Bridge and Sheets 直接计算就好了。具体而言,使用一个变量记录前面一个木板右端点是哪里,然后在看当前木板的时候,如果中间有空隙就加上,然后接着维护下去就行了。 intN;longlongW,L;intmain(){cin>>N>>L>>W;longlongr=0;longlongans...
AtCoder Regular Contest 123 (A~C 三道好题),比赛链接:HereA-ArithmeticSequence(good)注意细节intmain(){cin.tie(nullptr)->sync_with_stdio(false);lla,b,c;cin>>a>>b>>c;llx=2*b-a...
164 -- 1:43:11 App [6/8] AtCoder Beginner Contest 286 (unrated) 181 -- 27:25 App [6/6] VP AtCoder Beginner Contest 166 (随机 VP) 441 1 2:00:59 App [5/7] Educational Codeforces Round 142 (1660 ⭜ 1889) 468 -- 42:43 App AtCoder Beginner Contest 334 A 至 G 題...