码迷,mamicode.com
首页 >  
搜索关键字:coins    ( 511个结果
poj 3260 The Fewest Coins 多重背包+完全背包
多重背包+完全背包 容易被生活中的“常识”、定式思维坑到
分类:其他好文   时间:2015-02-19 12:53:21    阅读次数:140
hdu 2844 Coins 多重背包模板题 ,二进制优化。据说是楼教主的男人八题之一
Whuacmers use coins.They have coins of value A1,A2,A3...An Silverland dollar. One day Hibix opened purse and found there were some coins. He decided to buy a very nice watch in a nearby shop. He wanted to pay the exact price(without change) and he known th...
分类:其他好文   时间:2015-02-11 16:46:46    阅读次数:187
1048. Find Coins (25)
时间限制50 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueEva loves to collect coins from all over the universe, including some other planets like Mars...
分类:其他好文   时间:2015-02-06 11:04:41    阅读次数:180
hdu1398 Square Coins(母函数)
题目类似于整数拆分,很明显用母函数来做。母函数的写法基本固定,根据具体每项乘式的不同做出一些修改就行了。它的思路是从第一个括号开始,一个括号一个括号的乘开,用c1数组保存之前已经乘开的系数,即c1[j]表示在之前已经乘开过的那些括号处理后x的j次方的系数,c2数组是一个临时更新的统计数组,每处理一个...
分类:其他好文   时间:2015-02-05 18:01:29    阅读次数:139
欧拉计划(python) problem 31
Coin sums Problem 31 In England the currency is made up of pound, £, and pence, p, and there are eight coins in general circulation: 1p, 2p, 5p, 10p, 20p, 50p, £1 (100p) and £2 (200p). It ...
分类:编程语言   时间:2015-02-04 09:34:29    阅读次数:194
HDU2401 Baskets of Gold Coins【水题】【推理】
题目大意:有N个篮子,编号为1~N,篮子理由很多金币,只有一个篮子中每个金币中w-d, 其他篮子中每个金币都重w。现在从第1个篮子里拿1个金币,从第2个篮子里拿2个金币,…, 一直到到第N-1个篮子里拿N-1个金币。第N个篮子不拿。给出这些金币的全部重量和all,问: 第几个篮子里的金币是轻的,求出轻金币的个数。 思路:数学题,1~N个篮子里金币应有的总重量为:(N-1)*N/2*w,减去这些金币的全部重量 和all,得到总的轻金币比普通金币差的重量,每个轻金币和普通金币差的重量为d,两者相除, 得出轻金币...
分类:其他好文   时间:2015-01-31 14:43:40    阅读次数:210
UVA 10306--e-Coins+dp
二维的完全背包问题。 令dp[i][j]表示当x=i,y=j时的最小代价; 则:    dp[i][j]=min(dp[i][j],dp[i-wx[k]][j-wy[k]]+1); 至于方程的实现则可以仿照一维的背包问题写。 代码如下: #include #include #include #include using namespace std; int dp[33...
分类:其他好文   时间:2015-01-24 15:54:03    阅读次数:244
UVa 674 Coin Change (经典DP)
Coin ChangeTime Limit: 3000MSMemory Limit: Unknown64bit IO Format: %lld & %lluSuppose there are 5 types of coins: 50-cent, 25-cent, 10-cent, 5-cent, a...
分类:其他好文   时间:2015-01-23 20:04:25    阅读次数:156
hdu 2844 Coins DP
Coins Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 7716    Accepted Submission(s): 3158 Problem Description Whuacmers use coins.They...
分类:其他好文   时间:2015-01-19 17:20:31    阅读次数:248
HDU 1398 Square Coins(DP)
Square CoinsTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 8800Accepted Submission(s): 5991Proble...
分类:其他好文   时间:2015-01-05 10:50:03    阅读次数:99
511条   上一页 1 ... 40 41 42 43 44 ... 52 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!