类似某noip国王游戏。考虑交换两个题目的顺序,仅会对这两个题目的贡献造成影响。于是sort,比较时计算两个题目对答案的贡献,较小的放在前面。#include#includeusing namespace std;typedef long long ll;struct Point{ll T,K;}a...
分类:
其他好文 时间:
2015-01-24 22:41:08
阅读次数:
163
题目大意:给定一个环,要求在这个环上截取长度为偶数且在[L,R]区间内的一段,要求平均值最大
看到环果断倍增
看到平均值最大果断二分答案
看到长度[L,R]果断单调队列
对数组维护一个前缀和,对前缀和维护单调递增的单调队列
每扫过一个数sum[i],将sum[i-L]加入单调队列,再把距离i超过R的点删掉
长度为偶数?对奇数位置和偶数位置分别维护一个单调队列即可
每次找到大于0的...
分类:
其他好文 时间:
2015-01-23 20:09:19
阅读次数:
223
题解:呃,我这么弱就不贴题解了。
给一份详细的网址(Eolv):http://eolv.farbox.com/post/oionly/bzoj3841
再来一份详细的网址(YYN):http://blog.csdn.net/u013368721/article/details/38092859
这还有一份官方题解:http://blog.sina.com.cn/s/blog_6bddecdc...
分类:
编程语言 时间:
2015-01-23 09:37:04
阅读次数:
217
毕竟是HDU收录的题,,我怀疑它要变土。。
题意:
有n个项目,然后第一行输入损失度,第二行输入耗时
然后安排一下顺序,
每一项的消耗为当前已经做了的(包括此项)总时间*损失度。
求最小总消耗。
首先这道题是贪心,我们可以贪心排序项目。
策略: bool operator < (const YYC &a)const
{return x*a.y
证明:
首先我们考...
分类:
其他好文 时间:
2015-01-19 09:17:28
阅读次数:
159
Pseudo-Random Numbers
Computers normally cannot generate really random numbers, but frequently are used to generate sequences of pseudo-random numbers. These are generated by some algori...
分类:
其他好文 时间:
2015-01-18 17:13:07
阅读次数:
157
Circular SequenceTime Limit: 3000MSMemory Limit: Unknown64bit IO Format: %lld & %llu Submit Status DescriptionSome DNA sequences exist in circular for...
分类:
其他好文 时间:
2015-01-18 17:02:39
阅读次数:
150
题目大意:给定a1,a2,...,an,求
由于φ是积性函数,我们可以将i1i2...in分解质因数,对于每个质因数分开讨论,求积即可
将每个a分解质因数,假设分解后某个质数p在每个ai中的次数分别是bi,那么p对答案的贡献就是
于是对p^j维护一个前缀和,直接计算即可
#include
#include
#include
#include
#define MOD ...
分类:
其他好文 时间:
2015-01-15 14:20:26
阅读次数:
694
题目描述
Xinlv wrote some sequences on the paper a long time ago, they might be arithmetic or geometric sequences. The numbers are not very clear now, and only the first three numbers of each seq...
分类:
其他好文 时间:
2015-01-13 00:08:33
阅读次数:
258
Lexicographical Substring SearchTime Limit: 1000MSMemory Limit: Unknown64bit IO Format: %lld & %lluDescriptionLittle Daniel loves to play with strings...
分类:
其他好文 时间:
2015-01-10 22:14:19
阅读次数:
301
http://www.lydsy.com/JudgeOnline/problem.php?id=3850题意:类似国王游戏....无意义..#include #include #include #include #include #include #include #include #include...
分类:
其他好文 时间:
2015-01-08 22:41:27
阅读次数:
198