题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4902解题报告:输入一个序列,然后有q次操作,操作有两种,第一种是把区间 (l,r) 变成x,第二种是把区间 (l,r) 中大于x的数跟 x 做gcd操作。线段树区间更新的题目,每个节点保存一个最大和最小...
分类:
其他好文 时间:
2014-08-11 17:26:12
阅读次数:
238
Apple TreeTime Limit: 2000 MS Memory Limit: 65536 KB64-bit integer IO format: %I64d , %I64u Java class name: Main[Submit] [Status] [Discuss]Descriptio...
分类:
其他好文 时间:
2014-08-11 17:21:32
阅读次数:
264
When we are focusing on solving problems, we usually prefer to stay in front of computers rather than go out for lunch. At this time, we may call for food delivery.
Suppose there are N people living ...
分类:
其他好文 时间:
2014-08-11 15:02:22
阅读次数:
333
Effective STL 中文版学习记录条款4 判断容器是否为空 使用empty而不是size().size()操作在实现上不是一个时间常数操作条款5 尽量使用区间成员函数代替它们的单元素兄弟.STL实现中,区间范围显示比单个循环操作更优化条款7:当使用new得指针的容器时,记得在销毁容器前del...
分类:
其他好文 时间:
2014-08-11 14:48:02
阅读次数:
191
题意:给一个数列(整数),用一些不相交的区间去覆盖(只能是用端点去覆盖,端点可以交)。而且区间出度相等。求最大区间长度。
开始一下就敲了,枚举每个区间长度,判断合法,更新最大。但是后来一看小数,感觉不行,改为二分,后来还是挂了。。。
赛后才知道,二分的时候,答案必需要满足单调性啊,这里小的数据不行,大的数据可以行!如 0 1 5 6 10, 3不行,4行。
后来才知道,枚举时,每个差值的一半...
分类:
其他好文 时间:
2014-08-11 12:10:02
阅读次数:
207
Mobile phonesTime Limit: 5000 MS Memory Limit: 65536 KB64-bit integer IO format: %I64d , %I64u Java class name: Main[Submit] [Status] [Discuss]Descrip...
分类:
其他好文 时间:
2014-08-11 11:47:52
阅读次数:
230
MatrixTime Limit: 3000 MS Memory Limit: 65536 KB64-bit integer IO format: %I64d , %I64u Java class name: Main[Submit] [Status] [Discuss]DescriptionGiv...
分类:
其他好文 时间:
2014-08-11 11:24:12
阅读次数:
189
Color the ballTime Limit: 3000 MS Memory Limit: 32768 KB64-bit integer IO format: %I64d , %I64u Java class name: Main[Submit] [Status] [Discuss]Descri...
分类:
其他好文 时间:
2014-08-11 09:56:51
阅读次数:
220
解题报告
题意:
一根长度8000的线段上染色,求染完之后,每个颜色在线段上有多少个间断的区间。
思路:
区间问题用线段树,成段的更新区间,最后把所有的区间下压到叶子结点,统计叶子结点的颜色。
#include
#include
#include
using namespace std;
int lz[32000],_hash[10000],color[10000],cnt;
v...
分类:
其他好文 时间:
2014-08-11 06:19:21
阅读次数:
258
树状数组套主席树,维护区间动态第K大。。。
ZOJ给的空间太小,而主席树要求的空间太大,只能到BZOJ上交
1901: Zju2112 Dynamic Rankings
Time Limit: 10 Sec Memory Limit: 128 MB
Submit: 4186 Solved: 1754
[Submit][Status]
Description
给定一个含...
分类:
其他好文 时间:
2014-08-11 00:29:21
阅读次数:
313