Codeforces Round #788 (Div. 2)
A. Prof. Slim 一开始读了个假题,一度怀疑不该extra registration... 容易知道负号一定都在左边,所以模拟改操作后判断是否已排序即可 B. Dorms War 遍历维护答案即可,答案为相邻两个特殊字符之间的下标差 C. Where is the Pizza? 一开始的想法是维护每个数字在两个序列的下标,然后一个for循…
Codeforces Round #787 (Div. 3)解题报告
第一次变蓝了 Codeforces A. Food for Animals 判断$max(0ll,x-a)+max(0ll,y-b)$与$c$即可 B. Make It Increasing 从后往前模拟操作即可 C. Detective Task 容易推出答案是第一个0的位置减去第一个1的位置加一 注意一些特殊情况 D. Vertical Pat…
Codeforces Round #786 (Div. 3)解题报告
读假题,写假题,人麻了 A. Number Transformation 根据题意可以很简单的发现,如果y不能被x整除就输出0 0,否则输出1 $\frac{y}{x}$即可 B. Dictionary 手推一下即有:索引为(s[0]-'a')*25-(s[1]>s[0])+s[1]-'a' C. Infinite Replacement 根…
dp菜?
C. Palindrome Basis #include <algorithm> #include <bitset> #include <map> #include <vector> #include <string> #include <iostream> #include …
NOI2018 归程
题解给了个假的dijkstra? #include<cstdio> #include<cstring> #include<algorithm> #include<queue> #include<bitset> #define N 200100 #define M 400100 #define Inf 214748364…
Codeforces Round #783
D. Optimal Partition 考虑到动态规划有:$dp_i=max\{dp_i,dp_j+i-j\}$其中$(j < i,sum[j] \leqslant sum[i])$,所以我们可以用树状数组维护最大值$dp_i-i$ #include <algorithm> #include <bitset> #in…
L3-3 可怜的简单题
代码存档: #include <cstdio> #include <iostream> #include <cstring> #include <bitset> using namespace std; #define IN freopen("in.txt", "r", stdin) #define …
算是另一种交代,虽然今天也是个弱智
CodeTON Round 1解题报告
今天这场比前天的Educational Codeforces Round 125打得舒服? A. Good Pairs 容易知道只需输出序列中最大和最小的数的位置即可 B. Subtract Operation 以前的某场round有过类似操作的题,消减后我们可以发现只需查找是否存在$a_i+k=a_j$,有输出YES即可,否则为NO C. Mak…
fft板子
P3803 【模板】多项式乘法(FFT) #include<cstdio> #include<cmath> #include<iostream> #include<cstring> #include<algorithm> #include<unordered_map> usin…