
--------------动态规划------------
文章平均质量分 80
IF_I
这个作者很懒,什么都没留下…
展开
-
Cash Machine(POJ--1276 【多重背包】
DescriptionA Bank plans to install a machine for cash withdrawal. The machine is able to deliver appropriate @ bills for a requested cash amount. The machine uses exactly N distinct bill denominat原创 2015-08-19 11:22:43 · 259 阅读 · 0 评论 -
F--Maximum Value(CF--484B
DescriptionYou are given a sequence a consisting of n integers. Find the maximum possible value of (integer remainder of ai divided byaj), where 1 ≤ i, j ≤ n and ai ≥ aj.Input原创 2015-08-22 18:04:26 · 319 阅读 · 0 评论 -
来发背包开开胃(OJ--3303
题目描述多组输入。对于每组输入:(1 )接下来的n行,每行三个整数Si,Pi,Mi,分别代表第i种物品的数量,价格与质量()。输出对于每组数据,输出一个整数代表答案。思路:由于V范围太大所以不能用常规的背包来解决这个问题,而种数n很小,最大才是3,所以我就想到了用枚举每种物体放多少件的每种情况来求解该问题的答案。示例输入1 1010 1 10原创 2015-08-29 10:39:25 · 383 阅读 · 0 评论 -
Round Numbers(POJ--3252
DescriptionThe cows, as you know, have no fingers or thumbs and thus are unable to play Scissors, Paper, Stone' (also known as 'Rock, Paper, Scissors', 'Ro, Sham, Bo', and a host of other names) i原创 2015-08-25 14:24:02 · 347 阅读 · 0 评论 -
Maximum sum
Language:DefaultMaximum sumTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 34590 Accepted: 10712DescriptionGiven a set of n integers: A={a1, a2,原创 2015-02-03 19:49:30 · 231 阅读 · 0 评论 -
The Cow Lexicon(POJ--3267
DescriptionFew know that the cows have their own dictionary with W (1 ≤ W ≤ 600) words, each containing no more 25 of the characters 'a'..'z'. Their cowmunication system, based on mooing, is not v原创 2015-08-19 15:35:33 · 308 阅读 · 0 评论 -
Longest Ordered Subsequence(POJ--2533
DescriptionA numeric sequence of ai is ordered if a1 a2 aN. Let the subsequence of the given numeric sequence (a1, a2, ..., aN) be any sequence (ai1, ai2, ..., aiK), where 1 i1 i2 iK N. For exam原创 2015-08-19 16:18:36 · 289 阅读 · 0 评论 -
Alignment(POJ--1836
DescriptionIn the army, a platoon is composed by n soldiers. During the morning inspection, the soldiers are aligned in a straight line in front of the captain. The captain is not satisfied with t原创 2015-08-20 09:46:49 · 386 阅读 · 0 评论 -
Cow Bowling(POJ--3176
DescriptionThe cows don't use actual bowling balls when they go bowling. They each take a number (in the range 0..99), though, and line up in a standard bowling-pin-like triangle like this:原创 2015-08-20 10:19:02 · 485 阅读 · 0 评论 -
Pearls(POJ--1260
DescriptionIn Pearlania everybody is fond of pearls. One company, called The Royal Pearl, produces a lot of jewelry with pearls in it. The Royal Pearl has its name because it delivers to the royal原创 2015-08-20 11:21:56 · 313 阅读 · 0 评论 -
CRB and His Birthday(HDUOJ--5410
Problem DescriptionToday is CRB's birthday. His mom decided to buy many presents for her lovely son.She went to the nearest shop with M Won(currency unit).At the shop, there are N kinds原创 2015-08-20 19:48:20 · 496 阅读 · 0 评论 -
Palindrome(POJ--1159
DescriptionA palindrome is a symmetrical string, that is, a string read identically from left to right as well as from right to left. You are to write a program which, given a string, determines t原创 2015-08-21 08:46:40 · 309 阅读 · 0 评论 -
一维的01背包问题
2015年寒假集训第一次周赛的一道题:点击打开链接。 #includeint max(int a,int b){ return a>b?a:b;}int w[3405],d[3405],sum[13000];int main(){ int n,m,i,j; scanf("%d %d",&n,&m); for(i=0; i<n;原创 2015-01-24 13:41:05 · 956 阅读 · 0 评论 -
Bone Collector
A - Bone CollectorTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionMany years ago , in Teddy’s hometown there was a m原创 2015-02-14 22:24:10 · 345 阅读 · 0 评论 -
饭卡
B - 饭卡Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit StatusDescription电子科大本部食堂的饭卡有一种很诡异的设计,即在购买之前判断余额。如果购买一个商品之前,卡上的剩余金额大于或等于5元,就一定可原创 2015-02-14 22:44:04 · 325 阅读 · 0 评论 -
寒冰王座(完全背包问题)
F - 寒冰王座Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit StatusDescription不死族的巫妖王发工资拉,死亡骑士拿到一张N元的钞票(记住,只有一张钞票),为了防止自己在战斗中频繁的死掉,他决定给自己买原创 2015-02-14 22:51:08 · 525 阅读 · 0 评论 -
钱币兑换问题(完全背包问题)
H - 钱币兑换问题Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit StatusDescription在一个国家仅有1分,2分,3分硬币,将钱N兑换成硬币有很多种兑法。请你编程序计算出共有多少种兑法。原创 2015-02-14 23:12:35 · 600 阅读 · 0 评论 -
Balance(POJ--1837
DescriptionGigel has a strange "balance" and he wants to poise it. Actually, the device is different from any other ordinary balance. It orders two arms of negligible weight and each arm's length原创 2015-08-18 20:40:27 · 341 阅读 · 0 评论 -
I-- ytaaa(FZU--2177
Problem DescriptionYtaaa作为一名特工执行了无数困难的任务,这一次ytaaa收到命令,需要炸毁敌人的一个工厂,为此ytaaa需要制造一批炸弹以供使用。 Ytaaa使用的这种新型炸弹由若干个炸药组成,每个炸药都有它的威力值,而炸弹的威力值为组成这个炸弹的所有炸药的最大威力差的平方,即(max-min)^2,假设一个炸弹有5个炸药组成,威力分别为5 9 8 2 1,那么它原创 2015-08-22 14:56:27 · 324 阅读 · 0 评论