4927 线段树练习5 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 黄金 Gold 题解 4927 线段树练习5 4927 线段树练习5 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 黄金 Gold 时间限制: 1 s 空间限制: 128000 KB 题目等 ...
分类:
其他好文 时间:
2018-03-10 12:03:39
阅读次数:
165
输入文件:ppairing.in 输出文件:ppairing.out 时间限制:1 s 内存限制:128 MB 作为生日礼物,BESSIE得到了N (2 <= N <= 100,000;N%2 == 0)颗珍珠, 每颗珍珠的颜色为C种颜色之一 (1 <= C <= N). BESSIE发现N是一个偶 ...
分类:
其他好文 时间:
2018-03-07 21:52:11
阅读次数:
187
题目:Luogu 1856 扫描线,将矩形拆成两条边分别为 +1 和 -1,计算无重叠部分的长度。 由于 update 区间 [a, b] 和 [b, c] 时会把 b 加两次,所以统一转换成 [a,b),累加长度的时候再将右端点右移。 需要注意,在覆盖一条边时,不能直接累加边的长度,像下图: 在覆 ...
分类:
其他好文 时间:
2018-03-06 23:26:20
阅读次数:
310
题目链接:https://vjudge.net/problem/LightOJ-1030 知识点: 概率与期望 解题思路: 设某一个点 \(i\) 能到达的点的个数为 \(x\),其上有金 \(g\),则该点上的期望 \(f(i) = g + \frac{f(i+1) + f(i+2) + ... ...
分类:
其他好文 时间:
2018-03-06 00:48:36
阅读次数:
202
解题思路:Find Gold Someone locked you in the grid house. You can’t escape, until you find the enough gold. But somewhere is on the fire, so you can’t stan ...
分类:
其他好文 时间:
2018-03-04 20:02:17
阅读次数:
209
题目 题目描述 Although Farmer John has no problems walking around the fair to collect prizes or see the shows, his cows are not in such good shape; a full d ...
分类:
其他好文 时间:
2018-03-04 16:05:39
阅读次数:
190
题目 题目描述 To avoid unsightly burns while tanning, each of the C (1 ≤ C ≤ 2500) cows must cover her hide with sunscreen when they're at the beach. Cow i ...
分类:
其他好文 时间:
2018-03-04 14:37:41
阅读次数:
130
看到一坨矩形就要想到扫描线。(poj atantis) 我们把横边竖边分开计算,因为横边竖边其实没有区别,以下论述全为考虑竖边的。 怎样统计一个竖边对答案的贡献呢?答:把这个竖边加入线段树,当前的总覆盖长度 减去 加入前的总覆盖长度 的绝对值 即为这个竖边的贡献。 这样做有一个要求,横坐标相同的竖边 ...
分类:
其他好文 时间:
2018-03-03 22:27:32
阅读次数:
184
【英文原题】 Your Ride Is Here It is a well-known fact that behind every good comet is a UFO. These UFOs often come to collect loyal supporters from here on ...
分类:
其他好文 时间:
2018-03-03 21:21:53
阅读次数:
208
题面: 传送门 思路: 这道题官方标准解法是线段树维护一堆奇奇怪怪的东西......我用的是贪心 方法很简单,处理出pre和suf数组,分别代表前i张、后i张牌在最优方案下打出时可以得到的分数,然后两边加起来,更新答案 可以证明,这样的方法不会造成卡牌重复使用 因为如果有在前后决策中重复使用的卡牌, ...
分类:
其他好文 时间:
2018-02-27 23:42:54
阅读次数:
177