![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ACM 贪心
青山绿水之辈
奋斗青春年华
展开
-
hdu2037
#includetypedef struct jm{ int bigen; int end;}node;int main(){ node temp,a[1000]; int i,n; while(scanf("%d",&n)==1&&n) { for(i=1;i scanf("%d%原创 2013-04-27 18:24:49 · 1352 阅读 · 0 评论 -
HDU 4864 Task(贪心)
TaskTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3587 Accepted Submission(s): 930Problem DescriptionToday the company has m tasks to原创 2014-10-21 14:35:42 · 1520 阅读 · 0 评论 -
HDU4882ZCC Loves Codefires(贪心)
ZCC Loves CodefiresTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 823 Accepted Submission(s): 438Problem DescriptionThough ZCC has man原创 2014-10-18 18:47:33 · 1229 阅读 · 0 评论 -
HNU13033Football (贪心)
FootballTime Limit: 1000ms, Special Time Limit:2500ms,Memory Limit:65536KBTotal submit users: 19, Accepted users:17Problem 13033 : No special judgementProblem description原创 2014-10-02 17:12:06 · 985 阅读 · 0 评论 -
POJ1456Supermarket(贪心+优先队列)
SupermarketTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 9103 Accepted: 3891DescriptionA supermarket has a set Prod of products on sale. It earns a pr原创 2014-08-11 22:47:52 · 3574 阅读 · 1 评论 -
篮桥杯,翻硬币 (贪心)
问题描述小明正在玩一个“翻硬币”的游戏。桌上放着排成一排的若干硬币。我们用 * 表示正面,用 o 表示反面(是小写字母,不是零)。比如,可能情形是:**oo***oooo如果同时翻转左边的两个硬币,则变为:oooo***oooo现在小明的问题是:如果已知了初始状态和要达到的目标状态,每次只能同时翻转相邻的两个硬币,那么对特定的局面,最少要翻动多少次呢?原创 2014-02-23 12:54:23 · 1137 阅读 · 0 评论 -
bnuoj 2571Sticks Problem
Xuanxuan has n sticks of different length. One day, she puts all her sticks in a line, represented by S1, S2, S3, ...Sn. After measuring the length of each stick Sk (1 <= k <= n), she finds that for s原创 2013-10-12 18:16:16 · 940 阅读 · 0 评论 -
hdu1257(最少拦截系统 )
解释:当炮弹一个接一个的从空中飞来时,系统可以拦住比它拦住前一个高度低的炮,比前一个高的不拦,给第二个系统拦;Problem Description某国为了防御敌国的导弹袭击,发展出一种导弹拦截系统.但是这种导弹拦截系统有一个缺陷:虽然它的第一发炮弹能够到达任意的高度,但是以后每一发炮弹都不能超过前一发的高度.某天,雷达捕捉到敌国的导弹来袭.由于该系统还在试用阶段,所以只有一套系统,因原创 2013-07-19 15:29:46 · 965 阅读 · 0 评论 -
hdu4321(贪心)
Problem DescriptionWhen playing DotA with god-like rivals and pig-like team members, you have to face an embarrassing situation: All your teammates are killed, and you have to fight 1vN.There ar原创 2013-06-01 17:14:24 · 1391 阅读 · 0 评论 -
hdu1051(Wooden Sticks 贪心)
Problem DescriptionThere is a pile of n wooden sticks. The length and weight of each stick are known in advance. The sticks are to be processed by a woodworking machine in one by one fashion. It nee原创 2013-05-25 14:33:59 · 975 阅读 · 0 评论 -
hdu2192(MagicBuilding 贪心)
Problem DescriptionAs the increase of population, the living space for people is becoming smaller and smaller. In MagicStar the problem is much worse. Dr. Mathematica is trying to save land by clust原创 2013-05-22 23:06:57 · 1122 阅读 · 0 评论 -
hdu1052(贪心)
题目思路是:那人最大的马力比国王最大的马力小,就用他最小的马力与国王最大的马力比;如果他最大的马力比国王最大的马力大,就直接比; 如果是相等,就看他最小的马力与国王最小的马力,他的马力大则比赛,否则他最小的马力就与国王最大的比;#includeint main(){ int n,T[1005],k[1005]; while原创 2013-04-29 18:13:17 · 1220 阅读 · 0 评论 -
贪心的心得
贪心其实就是(结果力求最大)从小处着手,而不是观看全局;尽可能的把后方的拓展空间省到最大,把每个小区间达到最优,最后组成一个整体;很多题目是需要变化的,但我们只要知道贪心的本质。难题往往是由简单知识组成的。原创 2013-04-27 20:19:54 · 967 阅读 · 0 评论 -
hdu1009
按兑换率从大到小排例,比较m和f的大小,m>f,则加当前的j,并m减去f,否则m*兑换率,m=0. #includetypedef struct{ int j,f; double r;}node;node a[10000],temp;int main(){ int m,n,i; while(scanf("%d%d",&m,&n原创 2013-04-28 13:14:26 · 1340 阅读 · 0 评论 -
hdu1050(贪心复盖问题)
#include#includeint main(){ int k[205],t; scanf("%d",&t); while(t--) { int n,i,s,d; memset(k,0,sizeof(k)); scanf("%d",&n); while(n--)原创 2013-04-27 20:08:17 · 980 阅读 · 0 评论 -
HDU 5281 Senior's Gun
Senior's GunTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 616 Accepted Submission(s): 241Problem DescriptionXuejiejie is a beau原创 2015-07-12 21:08:41 · 1068 阅读 · 0 评论