codeforces 1217E E. Sum Queries? (线段树 传送门:https://codeforces.com/contest/1217/problem/E 题意: n个数,m次询问 单点修改 询问区间内最小的unbalanced number balanced ...
传送门 显然这个图是个 DAG ,那么就可以考虑跑 dp 了 先考虑没有梯子的情况,首先把每个位置标号,越后面的位置编号越小,终点位置编号为 那么从终点往起点 dp ,枚举当前位置摇到的数字,那么有 f x frac sum i f x i ,并且 f 但是这是在 x gt 的情况下成立的,因为如果 x lt 那么有可能不走,特殊考虑一下 首先 f ,那么有 的概率原地不动, 的概率走到终点,即 ...
2019-11-02 14:24 5 892 推荐指数:
codeforces 1217E E. Sum Queries? (线段树 传送门:https://codeforces.com/contest/1217/problem/E 题意: n个数,m次询问 单点修改 询问区间内最小的unbalanced number balanced ...
传送门: 1327- E. Count The Blocks 题意:给你一个整数n,求10^n内(每个数有前导零)长度为1到n的块分别有多少个。块的含义是连续相同数字的长度。 题解:从n=1开始枚举,ans数组记录每个长度的块的个数。当前的ans[n]的值就是下一个n++后的ans[n]的值 ...
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 ...
传送门:>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 ...
E. Yet Another Division Into Teams There are n students at your university. The programming skill of the i-th student is ai. As a coach, you want ...