有一种价值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
#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
#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
#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
点击打开链接
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
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
链接: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
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
题意: 给定一堆硬币,然后将他们分成两部分,使得两部分的差值最小;输出这个最小的差值。思路: 想了好久都没想到一个合适的状态转移方程。后面看了别人的题解后,才知道能够转成背包问题求解。我们将全部的硬币和的一半作为背包容量,然后将硬币的代价看成其本身的面值。然后背包中能装的最大容量就是当中一个人分得硬...
分类:
其他好文 时间:
2015-02-19 15:08:02
阅读次数:
106