简单的方法来自http://poj.org/showmessage?message_id=156697#include<stdio.h>#include<string.h>int dp[100010];int num[110],v[110];int used[100010];int main(){ int n,m,i,j; while(scanf("%d%d",&n,&m),(n||m)){ for(i=0;i<n;i++) scanf("%d",&v[i]); for(i=0;i<n;i++) Read More
posted @ 2011-11-21 03:18 Because Of You Views(321) Comments(0) Diggs(0) Edit
The Fewest CoinsTime Limit:2000MSMemory Limit:65536KTotal Submissions:2618Accepted:770DescriptionFarmer John has gone to town to buy some farm supplies. Being a very efficient man, he always pays for his goods in such a way that the smallest number of coins changes hands, i.e., the number of coins h Read More
posted @ 2011-11-21 02:53 Because Of You Views(320) Comments(0) Diggs(0) Edit