pog loves szh IITime Limit: 4000/2000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1169Accepted Submission(s): 332Pro...
分类:
其他好文 时间:
2015-06-09 06:09:45
阅读次数:
136
pog loves szh IIITime Limit: 12000/6000 MS (Java/Others)Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 470Accepted Submission(s): 97P...
分类:
其他好文 时间:
2015-06-09 06:06:23
阅读次数:
104
题意:N个点的有向树, Q次询问, 每次询问区间[L, R]内所有点的LCA。大致做法:线段树每个点保存它的孩子的LCA值, 对于每一次询问只需要 在线段树查询即可。 1 #include 2 using namespace std; 3 const int MAXN = 3e5+10; ...
分类:
其他好文 时间:
2015-06-08 23:09:00
阅读次数:
257
pog loves szh IITime Limit: 20 SecMemory Limit: 256 MB题目连接http://acm.hdu.edu.cn/showproblem.php?pid=5265Descriptionpog在与szh玩游戏,首先pog找到了一个包含n个数的序列,然后他在...
分类:
其他好文 时间:
2015-06-08 23:06:56
阅读次数:
158
Problem DescriptionPog and Szh are playing games.There is a sequence with $n$ numbers, Pog will choose a number A from the sequence. Szh will choose a...
分类:
其他好文 时间:
2015-06-08 21:11:30
阅读次数:
195
bestcoder#43 1002 在数组中找两个数的和取模的最大值 二分pog loves szh IIAccepts: 97Submissions: 834Time Limit: 4000/2000 MS (Java/Others)Memory Limit: 65536/65536 K (Jav...
分类:
编程语言 时间:
2015-06-08 19:23:08
阅读次数:
180
pog loves szh ITime Limit: 20 SecMemory Limit: 256 MB题目连接http://acm.hdu.edu.cn/showproblem.php?pid=5264Descriptionpog拥有很多字符串,它喜欢将两个长度相等字符串交错拼在一起,如abcd...
分类:
其他好文 时间:
2015-06-08 19:19:05
阅读次数:
205
题目连接http://acm.hdu.edu.cn/showproblem.php?pid=5264pog loves szh IDescriptionPog has lots of strings. And he always mixes two equal-length strings. For...
分类:
其他好文 时间:
2015-06-08 19:15:49
阅读次数:
177
题目地址:HDU 5266
这题用转RMQ求LCA的方法来做的非常简单,只需要找到l-r区间内的dfs序最大的和最小的就可以,那么用线段树或者RMQ维护一下区间最值就可以了。然后就是找dfs序最大的点和dfs序最小的点的最近公共祖先了。
代码如下:#include
#include
#include
#include ...
分类:
其他好文 时间:
2015-06-08 14:59:13
阅读次数:
133
题目传送门 1 /* 2 字符串处理:是一道水题,但是WA了3次,要注意是没有加'\0'的字符串不要用%s输出,否则在多组测试时输出多余的字符 3 */ 4 #include 5 #include 6 #include 7 #include 8 using namespace std...
分类:
其他好文 时间:
2015-06-08 11:36:40
阅读次数:
116