E. Editor The development of a text editor is a hard problem. You need to implement an extra module for brackets coloring in text. Your editor ...
codeforces E E. Sum Queries 线段树 传送门:https: codeforces.com contest problem E 题意: n个数,m次询问 单点修改 询问区间内最小的unbalanced number balanced number定义是,区间内选取数字的和sum sum上的每一位都对应着选取的数上的一位 否则就是unbalanced number 题解: 根 ...
2019-09-10 10:33 0 419 推荐指数:
E. Editor The development of a text editor is a hard problem. You need to implement an extra module for brackets coloring in text. Your editor ...
[Educational Codeforces Round 81 (Rated for Div. 2)]E. Permutation Separation(线段树,思维,前缀和) E. Permutation Separation time limit per test 2 seconds ...
传送门 显然这个图是个 $DAG$ ,那么就可以考虑跑 $dp$ 了 先考虑没有梯子的情况,首先把每个位置标号,越后面的位置编号越小,终点位置编号为 $1$ 那么从终点往起点 $dp$ ,枚举当前位置摇到的数字,那么有 $f[x]=\frac{\sum_{i=1}^{6}(f[x-i ...
传送门:>Here< 题意:询问给出一棵无根树上任意两点$a,b$,求关于所有点$i$,$dist(a,i) = dist(b,i)$的点的数量。要求每一次询问在$O(log n) ...
Codeforces Round #600 (Div. 2) E. Antenna Coverage(dp) 题目链接 题意: m个Antenna,每个Antenna的位置是$x_i$,分数是$s_i$,覆盖范围是$[x_i - s_i; x_i + s_i]$,每个硬币可以使一个 ...
Educational Codeforces Round 76 (Rated for Div. 2) E. The Contest(dp+线段树) 题目链接 题意: 给定3个人互不相同的多个数字,可以把数字移动给别人,问最少移动几次后可以使第一个人的数字为1~m1,第二个人m1~m2,第三个 ...
E. Prefix Enlightenment time limit per test3 seconds memory limit per test256 megabytes There are n lamps on a line, numbered from 1 to n. Each one ...
传送门: 1327- E. Count The Blocks 题意:给你一个整数n,求10^n内(每个数有前导零)长度为1到n的块分别有多少个。块的含义是连续相同数字的长度。 题解:从n=1开始枚举,ans数组记录每个长度的块的个数。当前的ans[n]的值就是下一个n++后的ans[n]的值 ...