题目链接:hdu 3954 Level up 题目大意:N个英雄,M个等级,初始等级为1,给定每一个等级须要的经验值,Q次操作,操作分两种,W l r x:表示l~r之间的英雄每一个人杀了x个怪物:Q l r:表示询问l~r之间经验值最大的英雄经验值为多少. 每轮杀怪,每仅仅怪物的经验和当前等级成正比. 解题思路:线段树维护,每一个节点维护最大值,区间内还须要杀多少怪就能升级的最小值,假设这个最小值为0.就要将懒惰标记pushdown到最底层,将英雄升级. #include <cstdio>…
又是一开始觉得的水题,结果GG了好久的东西... 题意是给你n个英雄,每个英雄开始为1级经验为0,最多可以升到k级并且经验一直叠加,每一级都有一个经验值上限,达到就升级.接着给你两种操作:W li ri ei:从第li到第ri个增加经验基数ei,注意这儿ei还需要乘以级数才是真正增加的经验,还有就是先在此等级下增加此等级倍数的经验,然后再判断升级情况 Q li ri :在第li到第ri个查找经验最多的值 记录最大值嘛,不过因为级数控制增加的倍数,也就是说区间更新时,多次更新标记得到的只是基数ei…
题目链接 http://acm.hdu.edu.cn/showproblem.php?pid=5091 Problem Description Recently, the γ galaxies broke out Star Wars. Each planet is warring for resources. In the Star Wars, Planet X is under attack by other planets. Now, a large wave of enemy spaces…
Atlantis Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 11551 Accepted Submission(s): 4906 Problem Description There are several ancient Greek texts that contain descriptions of the fabled…
Attack Time Limit: 5000/3000 MS (Java/Others) Memory Limit: 65768/65768 K (Java/Others) Total Submission(s): 2523 Accepted Submission(s): 805 Problem Description Today is the 10th Annual of “September 11 attacks”, the Al Qaeda is about to attac…