HDU 4970 Killing Monsters】的更多相关文章

pid=4970">Killing Monsters                                                                        Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others) Problem Description Kingdom Rush is a popular TD game, in which…
Killing Monsters Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 2838    Accepted Submission(s): 1068 Problem Description Kingdom Rush is a popular TD game, in which you should build some towe…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4970 Problem Description Kingdom Rush is a popular TD game, in which you should build some towers to protect your kingdom from monsters. And now another wave of monsters is coming and you need again to k…
题目链接 题意: 有n座塔,每座塔的攻击范围为[l,r],攻击力为d,有k个怪兽从这些塔前面经过,第i只怪兽初始的生命力为hp,出现的位置为x,终点为第n个格子.问最后有多少只怪兽还活着. 分析: 这个题刚开始是想用线段树,但是这个题会超时,线段树是O(nlogn)的复杂度,应该是卡的输入输出, 所以看别人的博客有人用 快速读入的方法用线段树 险过了,就是把每一个当作字符来输入,然后处理成数字. 但是正解是O(n)的处理,即把l, r,  d, 用数组a[l] += d;  a[r+1] = -…
开始以为是线段树,算了一下复杂度也觉得能过...但是这题貌似卡了线段树... 具体做法: 对每一个塔,记录attack[l]+=d,attack[r+1]-=d;这样对于每个block,受到的伤害就是前缀和attack[1]+attack[2]+...+attack[i]; 从后往前遍历,计算从当前点到结束受到的总的伤害: ps:貌似很多人都是用树状数组写的...写完还是不太懂和树状数组有什么关系...orz #include <iostream> #include <cstring&g…
2014多校9 1011 http://acm.hdu.edu.cn/showproblem.php?pid=4970 Killing Monsters Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 331    Accepted Submission(s): 198 Problem Description Kingdom Rush…
题目地址:HDU 4970 先进行预处理.在每一个炮塔的火力范围边界标记一个点. 然后对每一个点的伤害值扫一遍就能算出来. 然后在算出每一个点到终点的总伤害值,并保存下来,也是扫一遍就可以. 最后在询问的时候直接推断就可以,复杂度O(2*n). 代码例如以下: #include <cstdio> #include <cstring> #include <algorithm> using namespace std; #define maxn 110000 #define…
Killing Monsters Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 1993 Accepted Submission(s): 765 Problem Description Kingdom Rush is a popular TD game, in which you should build some towers to…
Killing Monsters Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1158 Accepted Submission(s): 527 Problem Description Kingdom Rush is a popular TD game, in which you should build some towers to p…
http://acm.hdu.edu.cn/showproblem.php?pid=4970 有n个格子在一条线标号1-n上,可以给范围在l到r内的格子架上攻击力为d的攻击塔,有m个怪物,每个怪物有个血量h和出生地x,现在要求有多少怪物可以活着走到第n个塔后,怪物每走一步就会被所在格子的塔(如果有)攻击. 线段树交了一发T了,其实只要离线出每个格子累计伤害,然后每次查询能否走到第n格即可 但是交c++的话还是会T,G++就过了 据说用树状数组可以过... #include <cstdio> #…
http://acm.hdu.edu.cn/showproblem.php?pid=4970 比赛的时候线段树水过的,比赛后线段树一直T,看了下正解真的是智商压制 题意:走直线,长度1-N,还有一些人,起点任意,每个人有血量,m个塔,每个塔有攻击范围和伤害,在一个点只会受到塔一次攻击,走到N存活,问存活个数 用一个数组ak记录塔的起点和终点情况,每个塔攻击起点加塔的伤害值,终点+1减伤害值 再用一个新数组sum,从前到后扫一遍可以知道每个点出发时的伤害(sum[i]=sum[i-1]+ak[i]…
题目大意:大厨正在玩一个打怪兽的小游戏.游戏中初始时有 n 只怪兽排成一排,从左到右编号为 0 ∼ n − 1.第 i 只怪兽的初始血量为 hi,当怪兽的血量小于等于 0 时,这只怪兽就挂了. 大厨要进行 q 次操作.每次操作中,大厨会选择两个整数 x 和 y,并向下标 k 满足 k&x = k 的怪兽开炮(此处 & 代表按位与操作).被炮弹打到的怪兽会掉 y 点血. 请告诉大厨,在他每次操作后,还有多少怪兽活着. 做法:考虑把操作分块 预处理每一块中下标为i的要扣的血量. 然后对于某一个…
题意 数轴上有n个点,有m座炮塔,每个炮塔有一个攻击范围和伤害,有k个怪物,给出他们的初始位置和血量,问最后有多少怪物能活着到达n点.n<=100000 分析 对于某个怪物,什么情况下它可以活着到达N点? 对于每个怪物,求他出现的位置到结尾的这段区间的炮塔的伤害总和,如果它的血量大于这个和,那么它就可以活着到达N点. 也就是说,先更新m个区间的值,然后对于每个怪物求一个后缀和. 想到了什么?线段树?树状数组?不存在的.差分就可以解决这个题.因为这个题区间更新和查询时分开的,所以不需要动态的进行修…
题意:塔防.给1--n,给出m个塔,每个塔有攻击力,给出k个怪兽的位子和血量,问有几只可以到达n点. 今天刚刚复习了树状数组,就碰到这个题,区间更新.区间求和类型.第三类树状数组可以斩. 注意一下大数即可. #include<iostream> #include<cstdio> #include<cstring> using namespace std; __int64 tree1[100010],tree2[100010]; int n,m; void add_b(i…
官方解题报告:http://blog.sina.com.cn/s/blog_6bddecdc0102uzwm.html Boring Sum http://acm.hdu.edu.cn/showproblem.php?pid=4961 这个二分也过了,on更快些. #include<cstdio> #include<cstring> #include<vector> #define mt(a,b) memset(a,b,sizeof(a)) using namespac…
[SIGGRAPH 2015][巫师3 狂猎 The Witcher 3: Wild Hunt ]顶级的开放世界游戏的实现技术 作者:西川善司 日文链接  http://www.4gamer.net/games/202/G020288/20150811091/       计算机图形和交互技术的学术大会[SIGGRAPH 2015],在北美时间的8月9日到13日召开了.            SIGGRAPH 2015的会场,因E3而被熟知的洛杉矶会议中心        SIGGRAPH有着美国…
The least one Time Limit: 9000/3000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 492    Accepted Submission(s): 184 Problem Description   In the RPG game “go back ice age”(I decide to develop the game after my und…
p.MsoNormal { margin: 0pt; margin-bottom: .0001pt; text-align: justify; font-family: Calibri; font-size: 10.5000pt } h1 { margin-top: 5.0000pt; margin-bottom: 5.0000pt; text-align: center; font-family: 宋体; color: rgb(26,92,200); font-weight: bold; fo…
http://acm.hdu.edu.cn/showproblem.php?pid=4960 2014 Multi-University Training Contest 9 Another OCD Patient Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 181    Accepted Submission(s): 58 Pr…
http://acm.hdu.edu.cn/showproblem.php?pid=5025 Saving Tang Monk Problem Description   <Journey to the West>(also <Monkey>) is one of the Four Great Classical Novels of Chinese literature. It was written by Wu Cheng'en during the Ming Dynasty.…
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1026 Problem Description The Princess has been abducted by the BEelzebub feng5166, our hero Ignatius has to rescue our pretty Princess. Now he gets into feng5166's castle. The castle is a large labyrinth.…
题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5281 Senior's Gun Description Xuejiejie is a beautiful and charming sharpshooter. She often carries $n$ guns, and every gun has an attack power $a[i]$. One day, Xuejiejie goes outside and comes across $m…
题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=1026 Ignatius and the Princess I Description The Princess has been abducted by the BEelzebub feng5166, our hero Ignatius has to rescue our pretty Princess. Now he gets into feng5166's castle. The castle…
Magina Problem Description Magina, also known as Anti-Mage, is a very cool hero in DotA (Defense of the Ancient).If you have no idea of him, here is some brief introduction of his legendary antecedents:Twin sons to the great Prophet, Terrorblade and…
链接: http://acm.hdu.edu.cn/showproblem.php?pid=1026 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=29096#problem/D Ignatius and the Princess I Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(…
HDU 5860 Death Sequence(递推) 题目链接http://acm.split.hdu.edu.cn/showproblem.php?pid=5860 Description You may heard of the Joseph Problem, the story comes from a Jewish historian living in 1st century. He and his 40 comrade soldiers were trapped in a cave…
题目链接 ZOJ链接 Problem Description Angel was caught by the MOLIGPY! He was put in prison by Moligpy. The prison is described as a N * M (N, M <= 200) matrix. There are WALLs, ROADs, and GUARDs in the prison. Angel's friends want to save Angel. Their task…
题目来源: http://acm.hdu.edu.cn/showproblem.php?pid=1242 题目描述: Problem Description   Angel was caught by the MOLIGPY! He was put in prison by Moligpy. The prison is described as a N * M (N, M <= 200) matrix. There are WALLs, ROADs, and GUARDs in the pris…
Level up Time Limit: 10000/3000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 3973    Accepted Submission(s): 1104 Problem Description Level up is the task of all online games. It's very boooooooooring. There is o…
经过锦囊相助,海东集团终于度过了危机,从此,HDU的发展就一直顺风顺水,到了2050年,集团已经相当规模了,据说进入了钱江肉丝经济开发区500强.这时候,XHD夫妇也退居了二线,并在风景秀美的诸暨市浬浦镇陶姚村买了个房子,开始安度晚年了. 这样住了一段时间,徐总对当地的交通还是不太了解.有时很郁闷,想去一个地方又不知道应该乘什么公交车,在什么地方转车,在什么地方下车(其实徐总自己有车,却一定要与民同乐,这就是徐总的性格). 徐总经常会问蹩脚的英文问路:“Can you help me?”.看着他…