XJOI 3601 技能(贪心+二分)】的更多相关文章

题目描述: 有一个oier,他有n个算法技能,每个技能有一个水平值,每个技能的水平上限都是A,设这个oier有cnt个技能达到了A, 设所有水平值的最小值为mi,那么这个oier的战斗力为cnt×Cf+mi×Cm,现在这个oier准备去提升自己的技能,他有m次提升的机会,每次提升可以选择某一个技能给水平值加1,如何分配这些提升的机会,来使得自己的战斗力总值最大? 输入格式: 第一行输入5个整数,n,A,Cf,Cm,m 第二行输入n个整数,表示每个技能的水平值 输出格式: 输出最大战斗力值 样例输…
F - 贪心+ 二分 Time Limit:3000MS     Memory Limit:0KB     64bit IO Format:%lld & %llu   Description   A set of n<tex2html_verbatim_mark> 1-dimensional items have to be packed in identical bins. All bins have exactly the same length l<tex2html_ver…
Card Game Cheater Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1566    Accepted Submission(s): 822 Problem Description Adam and Eve play a card game using a regular deck of 52 cards. The rule…
Heap Partition Time Limit: 2 Seconds      Memory Limit: 65536 KB      Special Judge A sequence S = {s1, s2, ..., sn} is called heapable if there exists a binary tree T with n nodes such that every node is labelled with exactly one element from the se…
题目传送门 /* 贪心/二分查找:首先对ai%=p,然后sort,这样的话就有序能使用二分查找.贪心的思想是每次找到一个aj使得和为p-1(如果有的话) 当然有可能两个数和超过p,那么an的值最优,每次还要和an比较 注意:不能选取两个相同的数 反思:比赛时想到了%p和sort,lower_bound,但是还是没有想到这个贪心方法保证得出最大值,还是题目做的少啊:( */ #include <cstdio> #include <algorithm> #include <cst…
The link to problem:Problem - D - Codeforces   D. Range and Partition  time limit per test: 2 seconds memory limit per test: 256 megabytes input: standard input output: standard output Given an array a of n integers, find a range of values [x,y] (x≤y…
http://codeforces.com/contest/734/problem/C 因为有两种操作,那么可以这样考虑, 1.都不执行,就是开始的答案是n * x 2.先执行第一个操作,然后就会得到一个time和left.就是你会得到一个新的用时,和一个剩下的魔法数,然后在第二个操作数中二分,二分第一个小于等于left的值,意思就是我现在还拥有left点魔法,能够买最多多少个技能的意思. 就是,看着样例一 得到的会是 time : 40s    80s 60s left   : 79 89 5…
题目链接:http://lightoj.com/volume_showproblem.php?problem=1383 题意:在平面图中,有一条河,用直线y=k表示,河上面(y>k)的都是敌方区域,y<k的都是水,现在有s个狙击手在水中不知道他们的位置:有n个敌军的士兵,已知他们的坐标: 狙击手有一个射击的范围 D,现在要满足所有敌方士兵都在狙击手的射击范围内,而且还要离河的距离M尽量的远,其中M是所有狙击手离河的距离最近的那个:如果不能满足输出“impossible” 距离最大化,我们可以二…
C. GukiZ hates Boxes Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/551/problem/C Description Professor GukiZ is concerned about making his way to school, because massive piles of boxes are blocking his way. In total there…
  Copying Books  Before the invention of book-printing, it was very hard to make a copy of a book. All the contents had to be re-written by hand by so called scribers. The scriber had been given a book and after several months he finished its copy. O…