一个线段树问题节点记录这样几个值,sum(这个区间的总和),best(这个区间中的最大值),lazy(翻倍的lazy标记)这里的[a,b]区间代表数为a与b之间的那些东西,因为无论怎么弄这些相同数字的都是连续的 1 #include 2 #include 3 #include 4 #i...
分类:
其他好文 时间:
2014-08-25 11:28:34
阅读次数:
242
The best way to predict your future is to create it预测未来的最好方式就是去创造它The best way to predict you future is to create it预测未来的最好方式就是去创造它The best way to pre...
分类:
其他好文 时间:
2014-08-25 08:44:03
阅读次数:
203
最近在研究HTML5 boilerplate的模版,以此为线索可以有条理地学习一些前端的best practice,好过在W3C的文档汪洋里大海捞针……啊哈哈哈……开头的IE探测与no-js类是什么?Modernizer探测到浏览器启用了js的时候会将.no-js替换成.js,这样在CSS里可以为禁...
分类:
Web程序 时间:
2014-08-24 22:12:13
阅读次数:
258
Variables: Descriptive_NameConstants:Descriptive_NameUser-defined types:Type Descriptive_Name Descriptive_Name End TypeEnumer...
分类:
其他好文 时间:
2014-08-22 10:34:25
阅读次数:
151
poj 3111 K Best
有n个物品的重量和价值分别是wi和vi。从中选出k个物品使得单位重量的价值最大。
题解:
1、二分做法
2、牛顿迭代
效率比较:
二分做法:
转换成判断是否存在选取K个物品的集合S满足下面的条件:
sigma(vi) / sigma(wi) >= x {vi∈S, wi∈S}
--> simga...
分类:
其他好文 时间:
2014-08-21 17:14:44
阅读次数:
254
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2680Choose the best routeTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others...
分类:
其他好文 时间:
2014-08-20 21:05:22
阅读次数:
216
题目链接:
huangjing
思路:
选取字典序最小的串,那么值得考虑的是当两端出现相等时,继续比较,直到出现不同的结果。。
题目:
代码:
#include
int main()
{
__int64 sum;
int max_num,candy,t,n,i;
scanf("%d",&t);
while(t--)
{...
分类:
其他好文 时间:
2014-08-20 16:23:02
阅读次数:
236
题意 给你一个字符序列 你每次可以从它的头部或尾部拿出一个字符组成一个新的字符序列 输出这样做能达到的最小的字符序列 每行最多输出80个字符(开始被这个坑了好久)
直接模拟就行 哪边小就选哪边 相等就往内看
#include
#include
#include
using namespace std;
const int N = 30010;
int main()
{
...
分类:
其他好文 时间:
2014-08-19 20:54:15
阅读次数:
255
Google Book
Time Limit: 1000MS
Memory Limit: 32768KB
64bit IO Format: %lld & %llu
[Submit]
[Go Back] [Status]
Description
You, the best hacker in the world, w...
分类:
其他好文 时间:
2014-08-19 20:50:15
阅读次数:
237
Google Book
Time Limit: 1 Second
Memory Limit: 32768 KB
You, the best hacker in the world, want to download the books published on Google Book. After some investigation, you found that...
分类:
其他好文 时间:
2014-08-19 16:38:05
阅读次数:
222