码迷,mamicode.com
首页 >  
搜索关键字:coins    ( 511个结果
SPOJ Problem 346:Bytelandian gold coins
有一种价值n的硬币能换成n/2,n/3,n/4的三个硬币,要求硬币价值的和尽可能多。前十万打表,后面就BFS。。。#include#includeint a[100005];int q[100005],l,r,t,i,n;long long ans;int main(){ for (i=0;i...
分类:其他好文   时间:2015-03-05 20:47:50    阅读次数:119
PAT:1048. Find Coins (25)(二分查找) AC
#include#includeusing namespace std;int arr[100066];int FIND(int l,int r,int aim) //二分查找,从l到r,查找aim{ int mid; while(l<=r) { mid=(l+r)/2; i...
分类:其他好文   时间:2015-03-04 06:13:57    阅读次数:169
PAT:1048. Find Coins (25)(双指针法) AC
#include#includeusing namespace std;int arr[100066];int main(){ int n,m; scanf("%d%d",&n,&m); for(int i=0 ; i<n ; ++i) scanf("%d",&arr[i]); sor...
分类:其他好文   时间:2015-03-04 06:12:08    阅读次数:153
PAT:1048. Find Coins (25)(哈希表法) AC
#include#includeint HARSH[1066];int main(){ memset(HARSH,0,sizeof(HARSH)); int n,m; scanf("%d%d",&n,&m); for(int i=0 ; i0) { if(i==m-i && ...
分类:其他好文   时间:2015-03-04 00:58:14    阅读次数:147
HDU 2844 Coins 多重背包(二进制优化)
点击打开链接 Coins Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 8167    Accepted Submission(s): 3327 Problem Description Whua...
分类:其他好文   时间:2015-03-03 13:44:33    阅读次数:132
PAT1068. Find More Coins
Eva loves to collect coins from all over the universe, including some other planets like Mars. One day she visited a universal shopping mall which cou...
分类:其他好文   时间:2015-03-02 20:40:28    阅读次数:178
NYOJ 698 A Coin Problem (斐波那契)
链接:click here 题意: 描述 One day,Jiameier is tidying up the room,and find some coins. Then she throws the coin to play.Suddenly,she thinks of a problem ,that if throw n times coin ,how many situati...
分类:其他好文   时间:2015-02-23 23:44:15    阅读次数:396
PAT1048. Find Coins
Eva loves to collect coins from all over the universe, including some other planets like Mars. One day she visited a universal shopping mall which cou...
分类:其他好文   时间:2015-02-22 17:16:11    阅读次数:154
uva--562Dividing coins +dp
题意: 给定一堆硬币,然后将他们分成两部分,使得两部分的差值最小;输出这个最小的差值。思路: 想了好久都没想到一个合适的状态转移方程。后面看了别人的题解后,才知道能够转成背包问题求解。我们将全部的硬币和的一半作为背包容量,然后将硬币的代价看成其本身的面值。然后背包中能装的最大容量就是当中一个人分得硬...
分类:其他好文   时间:2015-02-19 15:08:02    阅读次数:106
hdu 2844 Coins 多重背包
多重背包小变式 考察对dp[]结果数组的理解
分类:其他好文   时间:2015-02-19 12:54:57    阅读次数:116
511条   上一页 1 ... 39 40 41 42 43 ... 52 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!