Bestcoder #47 B Senior's Gun】的更多相关文章

Senior's Gun Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 875    Accepted Submission(s): 319 Problem Description Xuejiejie is a beautiful and charming sharpshooter. She often carries n guns,…
Senior's Gun Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 616    Accepted Submission(s): 241 Problem Description Xuejiejie is a beautiful and charming sharpshooter. She often carries n guns,…
题意:给出n把枪和m个怪.每把枪有一个攻击力,每一个怪有一个防御力.假设某把枪的攻击力不小于某个怪的防御力则能将怪秒杀,否则无法杀死.一把枪最多仅仅能杀一个怪,不能用多把枪杀同一个怪.每杀一次怪能够得到枪的攻击力减去怪的防御力的的分数. 求得分的最大值. 贪心.首先我们考虑这样一种情况:用攻击力为A的枪杀防御力为a的怪,攻击力为B的枪杀防御力为b的怪.则得分为A - a + B - b. 最好还是设A ≤ B,则有a ≤ A ≤ B.b ≤ B.假设有A < b,那么我们考虑用B杀a.而不使用A…
[比赛链接]cid=608">clikc here~~ ps:真是wuyu~~做了两小时.A出两道题,最后由于没加longlong所有被别人hack掉!,最后竟然不知道hack别人不成功也会掉分.还一个劲的hack 别人的代码,昨天真是个悲催的比赛,~~~~(>_<)~~~~,以下弱弱献上代码~~ 1002比1001还简单~~ 1002  Senior's Gun /* BestCoder Round #47 1002 Senior's Gun */ #include <…
Senior's Array Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 528    Accepted Submission(s): 209 Problem Description One day, Xuejiejie gets an array A. Among all non-empty intervals of A, she…
题链:http://acm.hdu.edu.cn/showproblem.php?pid=5282 Senior's String Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 142    Accepted Submission(s): 40 Problem Description Xuejiejie loves strings m…
题目链接:pid=5280">传送门 题意: 给定一个长度为n的序列,和一个改动的值p,必须从原序列中选一个位置改动成p, 求改动后的区间和的最大值. 分析: 枚举位置+最大区间和. 复杂度O(n^2); 代码例如以下: #include <iostream> #include <cstring> #include <cstdio> #include <algorithm> using namespace std; typedef long…
King's Cake Accepts: 967 Submissions: 1572 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Problem Description It is the king's birthday before the military parade . The ministers prepared a rectangle cake of size n×m…
题意:给定n个数.要求必须将当中某个数改为P,求修改后最大的区间和能够为多少. 水题.枚举每一个区间.假设该区间不改动(即改动该区间以外的数),则就为该区间和,若该区间要改动,由于必须改动,所以肯定是把最小的数改动为P能保证该区间最后和最大,所以比較两种方案的较大者.对于每一个区间取出的较大者,再取总共的最大者就可以.注意一个trick,枚举到整个区间的时候,是必需要改动一个数的.所以这个最大的这个区间仅仅有一种方案. 先预处理1~i的区间和,维护每一个区间的最小值和区间和. #include…
Problem Description There are N point on X-axis . Miaomiao would like to cover them ALL by using segments with same length. There are 2 limits: 1.A point is convered if there is a segments T , the point is the left end or the right end of T. 2.The le…