Description
In the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up of several consecutive metallic sticks which are of the same lengt...
分类:
其他好文 时间:
2014-08-03 10:18:05
阅读次数:
265
给定一个序列,两种操作
1:把一段变成x。
2:把一段每个数字,如果他大于x,就变成他和x的gcd,求变换完后,最后的序列。
线段树解法:用lazy标记下即可,优化方法还是很巧妙的,
Accepted
4902
515MS
3308K
1941 B
C++
#include "stdio.h"
#include "string...
分类:
其他好文 时间:
2014-08-02 20:57:24
阅读次数:
367
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1540
题目大意:抗日战争时期,各村庄被一条地道连接着(村庄排在一条线上),有三种操作:
第一种:某村庄被敌军摧毁;
第二种:修复上一个被摧毁的村庄;
第三种:查询与该村庄直接或间接链接的村庄有多少个(包括自己);
此题用线段树做,每个节点包含该区间从左端开始有多大连续区间ls,从右端...
分类:
其他好文 时间:
2014-08-02 18:29:33
阅读次数:
230
题目链接瑶瑶想要玩滑梯Time Limit:10000/5000MS (Java/Others)Memory Limit:512000/256000KB (Java/Others)SubmitStatisticNext ProblemProblem Description众所周知,瑶瑶(tsyao)...
分类:
其他好文 时间:
2014-08-02 17:53:43
阅读次数:
260
Description
N children are sitting in a circle to play a game.
The children are numbered from 1 to N in clockwise order. Each of them has a card with a non-zero integer on it in his/her hand. Th...
分类:
其他好文 时间:
2014-08-02 15:37:33
阅读次数:
259
思路:这题比赛的时候宝哥说的思路我觉得对的,就是当是2操作的时候,先把数放到数组里,最后查询输出的时候再统一计算,不过那时敲得烂死了,debug了两天,靠……
上午写的vector在pushDown的时候又忘了clear了,然后MLE了一早上,尼玛,还以为用的数组太大超了,然后又改成结构体,还是MLE,最后把别人的代码交上去发现没MLE,疯了一中午,最后无聊的时候才发现这个错误,尼玛……发现自己...
分类:
其他好文 时间:
2014-08-02 15:32:03
阅读次数:
213
UVA 11983题目大意是说给你N个矩形,让你求被覆盖k次以上的点的总个数(x,y 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 ...
分类:
其他好文 时间:
2014-08-02 12:15:23
阅读次数:
252
第一题HDU1698http://acm.hdu.edu.cn/showproblem.php?pid=1698这是在区间上进行整段的修改操作,我们就用to[]数组代表修改的lazy标记记住在构建树和在change函数中自顶向下更新的时候,一定要注意重新回去更新上层的节点,所以末尾需加上update...
分类:
其他好文 时间:
2014-08-02 01:47:52
阅读次数:
342
Count ColorTime Limit: 1000 MS Memory Limit: 65536 KB64-bit integer IO format: %I64d , %I64u Java class name: Main[Submit] [Status] [Discuss]Descripti...
分类:
其他好文 时间:
2014-08-01 22:35:22
阅读次数:
290
http://poj.org/problem?id=3667题意:两个操作 : 1 选出靠左的长度为a的区间。 2 把从 a到a+b的区间清空。线段树区间合并+lazy//bycaonima//hehe#include#include#include#include#includeusingname...
分类:
其他好文 时间:
2014-08-01 22:34:52
阅读次数:
263