作者: starry

69 篇文章

Codeforces Round #793 (Div. 2)解题报告
A. Palindromic Indices 英语不好,以为是问可以删除的下标,还开了个问题。。 容易发现对于回文串,删除中间元素后仍然为回文串,所以方案数即为与中间元素等价的元素个数,所以从中间找出与中间元素相同的连续区间长度即为答案 B. AND Sorting 我们只需要关注不在应在位置的元素即可。对于这些元素的与结果肯定是一个答案,接下来只…
Codeforces Round #789 (Div. 2)
降智场 A. Tokitsukaze and All Zero Sequence 条件判断即可 B. Tokitsukaze and Good 01-String 我们应当考虑到每段均应为偶数,所以我们可以两个两个判断。。。 C. Tokitsukaze and Strange Inequality 应当考虑到固定$b,c$来进行循环,可以树状数组…
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 …
算是另一种交代,虽然今天也是个弱智