自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(23)
  • 收藏
  • 关注

原创 poj3032类似约瑟夫环(用数组做,模拟完可以知道初始位置)

Card Trick Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 3224 Accepted: 2354 DescriptionThe magician shuffles a small pack of cards, holds it face down and performs the followi

2015-07-26 23:45:44 484

原创 hdu3123actorial in GCC求阶乘

Description The GNU Compiler Collection (usually shortened to GCC) is a compiler system produced by the GNU Project supporting various programming languages. But it doesn’t contains the math operator

2015-07-26 23:12:08 433

原创 poj2590steps数列递推

Problem D: Step by step Time Limit: 1 Sec Memory Limit: 128 MB Submit: 23 Solved: 6 [Submit][Status][Web Board] Description One steps through integer points of the straight line. The length of a

2015-07-26 23:00:38 366

原创 poj2576二维01背包

Description A tug of war is to be arranged at the local office picnic. For the tug of war, the picnickers must be divided into two teams. Each person must be on one team or the other; the number of pe

2015-07-26 22:36:32 423

原创 uva673 栈 括号匹配

673 - Parentheses Balance括号匹配输入一些由小括号和中括号组成的字符串,判断字符串是否正确。栈的基本应用,水题。自己比较得意的是如何判断是否匹配。方法是: little = ‘(’ + ‘)’; middle = ‘[’ + ‘]’; 判断当前字符和栈顶字符相加是否等于little 或middle代码:#include <stdio.h>#include <stdli

2015-06-07 15:18:32 468

原创 uva101The Blocks Problem积木问题,线性表

#include #include #include typedef struct Mark { int pos; int block;}Mark;typedef struct Blocks { int top; int s[30];}Blocks;Blocks block[30];Mark markOne, markTwo;int Jud

2015-06-05 16:46:16 794

原创 poj 3181 Dollar Dayz

DescriptionFarmer John goes to Dollar Days at The Cow Store and discovers an unlimited number of tools on sale. During his first visit, the tools are selling variously for $1, $2, and $3. Farmer J

2014-12-27 17:15:45 396

原创 hdu 1398完全背包

Problem DescriptionPeople in Silverland use square coins. Not only they have square shapes but also their values are square numbers. Coins with values of all square numbers up to 289 (=17^2), i.e.

2014-12-27 14:03:22 504

原创 hdu 1114 存钱罐 完全背包入门

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). Th

2014-12-25 16:08:22 725

原创 hdu 3127 矩形分割 值得思考的完全背包

Problem DescriptionThere are many pretty girls in Wuhan University, and as we know, every girl loves pretty clothes, so do they. One day some of them got a huge rectangular cloth and they want to

2014-12-25 11:19:55 446

原创 hdu 2159 FATE 二维数组 完全背包

Problem Description最近xhd正在玩一款叫做FATE的游戏,为了得到极品装备,xhd在不停的杀怪做任务。久而久之xhd开始对杀怪产生的厌恶感,但又不得不通过杀怪来升完这最后一级。现在的问题是,xhd升掉最后一级还需n的经验值,xhd还留有m的忍耐度,每杀一个怪xhd会得到相应的经验,并减掉相应的忍耐度。当忍耐度降到0或者0以下时,xhd就不会玩这游戏。xhd还说了他最多只

2014-12-24 21:26:50 697

原创 hdu 1284 兑换零钱

在一个国家仅有1分,2分,3分硬币,将钱N兑换成硬币有很多种兑法。请你编程序计算出共有多少种兑法。 每行只有一个正整数N,N小于32768。 对应每个输入,输出兑换方法数。 input293412553 output71883113137761 dp[i][j] 为 方法数状态转移方程 : dp[j] = dp[j] +

2014-12-22 19:43:31 488

原创 hdu4508湫湫系列故事——减肥记I

Problem Description  对于吃货来说,过年最幸福的事就是吃了,没有之一!  但是对于女生来说,卡路里(热量)是天敌啊!  资深美女湫湫深谙“胖来如山倒,胖去如抽丝”的道理,所以她希望你能帮忙制定一个食谱,能使她吃得开心的同时,不会制造太多的天敌。  当然,为了方便你制作食谱,湫湫给了你每日食物清单,上面描述了当天她想吃的每种食物能带给她的幸福程度,以及会增

2014-12-22 16:01:31 875

原创 hdu1248 寒冰王座 完全背包 简单

Problem Description不死族的巫妖王发工资拉,死亡骑士拿到一张N元的钞票(记住,只有一张钞票),为了防止自己在战斗中频繁的死掉,他决定给自己买一些道具,于是他来到了地精商店前.死亡骑士:"我要买道具!"地精商人:"我们这里有三种道具,血瓶150块一个,魔法药200块一个,无敌药水350块一个."死亡骑士:"好的,给我一个血瓶."说完他掏出那张

2014-12-22 13:13:39 491

原创 hdu2191 悼念512汶川大地震遇难同胞——珍惜现在,感恩生活 01背包

Problem Description急!灾区的食物依然短缺!为了挽救灾区同胞的生命,心系灾区同胞的你准备自己采购一些粮食支援灾区,现在假设你一共有资金n元,而市场有m种大米,每种大米都是袋装产品,其价格不等,并且只能整袋购买。请问:你用有限的资金最多能采购多少公斤粮食呢?后记:人生是一个充满了变数的生命过程,天灾、人祸、病痛是我们生命历程中不可预知的威胁。月有阴晴

2014-12-21 21:56:28 511

原创 3466Proud Merchants(需消除后效性的01背包)

Problem DescriptionRecently, iSea went to an ancient country. For such a long time, it was the most wealthy and powerful kingdom in the world. As a result, the people in this country are still ver

2014-12-21 20:04:45 573

原创 hdu2955 小偷 01背包 简单变形

Problem DescriptionThe aspiring Roy the Robber has seen a lot of American movies, and knows that the bad guys usually gets caught in the end, often because they become too greedy. He has decided t

2014-12-21 15:38:28 583

原创 hdu1171 Big Event in HDU 01背包

Problem DescriptionNowadays, we all know that Computer College is the biggest department in HDU. But, maybe you don't know that Computer College had ever been split into Computer College and Softw

2014-12-20 23:44:25 461

转载 2639骨头问题2(01背包的第k大值)

Problem DescriptionThe title of this problem is familiar,isn't it?yeah,if you had took part in the "Rookie Cup" competition,you must have seem this title.If you haven't seen it before,it doesn't m

2014-12-20 21:27:18 677

原创 hdu1203 I need a offer 01背包

Problem DescriptionSpeakless很早就想出国,现在他已经考完了所有需要的考试,准备了所有要准备的材料,于是,便需要去申请学校了。要申请国外的任何大学,你都要交纳一定的申请费用,这可是很惊人的。Speakless没有多少钱,总共只攒了n万美元。他将在m个学校中选择若干的(当然要在他的经济承受范围内)。每个学校都有不同的申请费用a(万美元),并且Speakless估计了

2014-12-19 21:48:25 451

原创 hdu1864最大报销额度(01背包)- 把小数化整数技巧

Problem Description现有一笔经费可以报销一定额度的发票。允许报销的发票类型包括买图书(A类)、文具(B类)、差旅(C类),要求每张发票的总额不得超过1000元,每张发票上,单项物品的价值不得超过600元。现请你编写程序,在给出的一堆发票中找出可以报销的、不超过给定额度的最大报销额。 Input测试输入包含若干测试用例。每个测试用例的第1行包

2014-12-19 21:11:54 529

原创 hdu4502临时工计划(01背包)

Problem Description  俗话说一分钱难倒英雄汉,高中几年下来,吉哥已经深深明白了这个道理,因此,新年开始存储一年的个人资金已经成了习惯,不过自从大学之后他不好意思再向大人要压岁钱了,只能把唯一的希望放到自己身上。可是由于时间段的特殊性和自己能力的因素,只能找到些零零碎碎的工作,吉哥想知道怎么安排自己的假期才能获得最多的工资。  已知吉哥一共有m天的假期,每天的编号从1

2014-12-19 15:29:49 471

原创 hdu2546饭卡(动规 01背包)

Problem Description电子科大本部食堂的饭卡有一种很诡异的设计,即在购买之前判断余额。如果购买一个商品之前,卡上的剩余金额大于或等于5元,就一定可以购买成功(即使购买后卡上余额为负),否则无法购买(即使金额足够)。所以大家都希望尽量使卡上的余额最少。某天,食堂中有n种菜出售,每种菜可购买一次。已知每种菜的价格以及卡上的余额,问最少可使卡上的余额为多少。

2014-12-19 00:37:18 470

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除