,AN) 和整数 C 的整数序列。在进行最多一次以下操作后,求 A 中元素的最大可能和: 指定整数 l 和r ,并将 Al,Al+1,…,Ar 分别乘以 C。 分析: 分类讨论: C>0,求出最大子段和,乘上C,再加上原来非最大子段和的部分即可。 C≤0,求出最小子段和,乘上C,再加上原来非最小子段和的部分即可。 代...
然后嗯做就可以了,懒得再写了,具体看代码吧。 参考代码 #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 >...
E:用二进制表示放的数字,然后状压$DP$。 F:$biset$优化$DP$预处理,乱搞贪心。 ARC 059 D:傻题,存在长的合法子串就一定会存在短的。 E:前缀和优化$DP$。 F:每个长度为$len$的串出现的概率是相同的,求到长度为$len$的方案数然后除$2^{len}$。 ARC 060 D:对$b$分大于根号和小于根号讨论。 E:倍增...
· [题解] Atcoder Regular Contest ARC 148 A B C E 题解 · [题解] Atcoder Regular Contest ARC 146 A B C D 题解 · Atcoder Regular Contest 147 · AtCoder Regular Contest 158 · AtCoder Regular Contest 174 阅读排行: · 日常问题排查-空闲一段时间再请求就超时 · C# 14 新...
AtCoder Beginner Contest 402(A-F详细题解) A 思路:我们直接输出字符串中的大写字母即可。 代码:#include<bits/stdc++.h> using namespace std; #define int long long #define N 500010 signed main(){ string s;cin>>… 秋日薄雾 用70 行 Go 代码击败 C 语言 polar...发表于GCTT ....
前面四道题都比较简单,后面两道题的题面到现在都没有加载出来。 A - Bridge and Sheets 直接计算就好了。具体而言,使用一个变量记录前面一个木板右端点是哪里,然后在看当前木板的时候,如果中间有空隙就加上,然后接着维护下去就行了。 intN;longlongW,L;intmain(){cin>>N>>L>>W;longlongr=0;longlongans...
We will hold AtCoder Regular Contest 151. Contest URL:https://atcoder.jp/contests/arc151 Start Time:http://www.timeanddate.com/worldclock/fixedtime.html?iso=20221016T2100&p1=248 Duration: 120 minutes Number of Tasks: 6 Writer:leaf1415 ...
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 題...
We will hold AtCoder Regular Contest 148. Contest URL: https://atcoder.jp/contests/arc148 Start Time: http://www.timeanddate.com/worldclock/fixedtime.html?iso=20220911T2100&p1=248 Duration: 120 minutes Number of Tasks: 6 Writer: Nyaan Tester: maspy, satashun Rated range: — 2799 The...
AtCoder Regular Contest 090 C - Candies 链接:https://arc090.contest.atcoder.jp/tasks/arc090_a 题意:求矩形左上角到右下角的最大元素和(走动路径只能是向右或者向下) 分析:dfs,也可以是dp 【dfs】代码: #include <bits/stdc++.h> using namespace std;...