Codeforces976E Well played! 【贪心】】的更多相关文章

[不稳定的传送门] Solution 首先可以证明,hp翻倍的操作一定是在同一个生物上最优 Code #include <cstdio> #include <algorithm> #define ll long long #define mx(i) max(A[i].hp,A[i].dmg) #define N 200010 using namespace std; struct info{int hp,dmg,w;}A[N]; int n,a,b; ll sum,Ans; inl…
题目分析: 由于乘二的收获很大,所以我们可以证明乘的数一定是同一个,接着排序后依次选取,判断一下即可. 题目代码: #include<bits/stdc++.h> using namespace std; ; int n,a,b; struct node{ int hp,dm; }d[maxn]; int cmp(node alpha,node beta){ return alpha.hp-alpha.dm > beta.hp-beta.dm; } void read(){ scanf(…
传送门:http://codeforces.com/contest/976/problem/E 参考:https://www.cnblogs.com/void-f/p/8978658.html 题意: 对于每一个生物,有一个ph值和伤害值.现在有a次使ph值乘2的机会,有b次是伤害值等于ph值得机会. 问最后能得到最大的伤害总和是多少. 思路:自己一开始也想的是贪心,但是贪的姿势不正确.明确,a次一定是给同一个生物放大的.但是至于是对哪一个生物放大,还是要用暴力一个一个去找,而不要对排序后第一个…
E. Well played! time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Recently Max has got himself into popular CCG "BrainStone". As "BrainStone" is a pretty intellectual game, Max…
A. Shell Game time limit per test 0.5 seconds memory limit per test 256 megabytes input standard input output standard output Bomboslav likes to look out of the window in his room and watch lads outside playing famous shell game. The game is played b…
Super Jumping! Jumping! Jumping! Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 29663    Accepted Submission(s): 13243 Problem Description Nowadays, a kind of chess game called "Super Jumping!…
1692: [Usaco2007 Dec]队列变换 Time Limit: 5 Sec  Memory Limit: 64 MBSubmit: 1383  Solved: 582[Submit][Status][Discuss] Description FJ打算带他的N(1 <= N <= 30,000)头奶牛去参加一年一度的“全美农场主大奖赛”.在这场比赛中,每个参赛者都必须让他的奶牛排成一列,然后领她们从裁判席前依次走过. 今年,竞赛委员会在接受队伍报名时,采用了一种新的登记规则:他们把所…
Wooden Sticks Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 15564    Accepted Submission(s): 6405 Problem Description There is a pile of n wooden sticks. The length and weight of each stick a…
FatMouse' Trade Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 56784    Accepted Submission(s): 19009 Problem Description FatMouse prepared M pounds of cat food, ready to trade with the cats g…
1691: [Usaco2007 Dec]挑剔的美食家 Time Limit: 5 Sec  Memory Limit: 64 MBSubmit: 786  Solved: 391[Submit][Status][Discuss] Description 与很多奶牛一样,Farmer John那群养尊处优的奶牛们对食物越来越挑剔,随便拿堆草就能打发她们午饭的日子自然是一去不返了.现在,Farmer John不得不去牧草专供商那里购买大量美味多汁的牧草,来满足他那N(1 <= N <= 100,…