2012年2月21日

HDU 2191 悼念512汶川大地震遇难同胞——珍惜现在,感恩生活

摘要: Problem Description急!灾区的食物依然短缺! 为了挽救灾区同胞的生命,心系灾区同胞的你准备自己采购一些粮食支援灾区,现在假设你一共有资金n元,而市场有m种大米,每种大米都是袋装产品,其价格不等,并且只能整袋购买。 请问:你用有限的资金最多能采购多少公斤粮食呢? 后记: 人生是一个充满了变数的生命过程,天灾、人祸、病痛是我们生命历程中不可预知的威胁。 月有阴晴圆缺,人有旦夕祸福,未来对于我们而言是一个未知数。那么,我们要做的就应该是珍惜现在,感恩生活—— 感谢父母,他们给予我们生命,抚养我们成人; 感谢老师,他们授给我们知识,教我们做人 感谢朋友,他们让我们感受到世界的温暖; 阅读全文

posted @ 2012-02-21 22:49 lzm风雨无阻 阅读(222) 评论(0) 推荐(0) 编辑

HDU 1085 Holding Bin-Laden Captive

摘要: Problem DescriptionWe all know that Bin-Laden is a notorious terrorist, and he has disappeared for a long time. But recently, it is reported that he hides in Hang Zhou of China! “Oh, God! How terrible! ”Don’t be so afraid, guys. Although he hides in a cave of Hang Zhou, he dares not to go out. Laden 阅读全文

posted @ 2012-02-21 22:11 lzm风雨无阻 阅读(405) 评论(0) 推荐(0) 编辑

POJ 1384 Piggy-Bank

摘要: Problem DescriptionBefore ACM can do anything, a budget must be prepared and the necessary financial support obtained. The main income for this action comes from Irreversibly Bound Money (IBM). The idea behind is simple. Whenever some ACM member has any small money, he takes all the coins and throws 阅读全文

posted @ 2012-02-21 19:17 lzm风雨无阻 阅读(240) 评论(0) 推荐(0) 编辑

HDU OJ 钱币兑换问题

摘要: Problem Description在一个国家仅有1分,2分,3分硬币,将钱N兑换成硬币有很多种兑法。请你编程序计算出共有多少种兑法。Input每行只有一个正整数N,N小于32768。Output对应每个输入,输出兑换方法数。Sample Input2934 12553Sample Output718831 13137761#include <iostream>#include <cstdio>using namespace std;long long dp[32770];int main(){ int n; int i,j; while(cin>>n) 阅读全文

posted @ 2012-02-21 15:54 lzm风雨无阻 阅读(450) 评论(0) 推荐(0) 编辑

HDU 1248 寒冰王座

摘要: Problem Description 不死族的巫妖王发工资拉,死亡骑士拿到一张N元的钞票(记住,只有一张钞票),为了防止自己在战斗中频繁的死掉,他决定给自己买一些道具,于是他来到了地精商店前. 死亡骑士:"我要买道具!" 地精商人:"我们这里有三种道具,血瓶150块一个,魔法药200块一个,无敌药水350块一个." 死亡骑士:"好的,给我一个血瓶." 说完他掏出那张N元的大钞递给地精商人. 地精商人:"我忘了提醒你了,我们这里没有找客人钱的习惯的,多的钱我们都当小费收了的,嘿嘿." 死亡骑士:".... 阅读全文

posted @ 2012-02-21 14:23 lzm风雨无阻 阅读(305) 评论(0) 推荐(0) 编辑

hdu 1028 Ignatius and the Princess III

摘要: Ignatius and the Princess IIIProblem Description"Well, it seems the first problem is too easy. I will let you know how foolish you are later." feng5166 says. "The second problem is, given an positive integer N, we define an equation like this: N=a[1]+a[2]+a[3]+...+a[m]; a[i]>0,1< 阅读全文

posted @ 2012-02-21 13:35 lzm风雨无阻 阅读(157) 评论(0) 推荐(0) 编辑

导航