码迷,mamicode.com
首页 >  
搜索关键字:coins    ( 511个结果
zoj 2949 - Coins of Luck
题目:有2中面条各n碗,每次抛硬币判断吃哪一种(到一种吃完为止),问抛硬币的数学期望。 分析:动态规划,概率dp。求出每种结束状态(即,有一种吃完)的概率,分别乘以步长即为期望。              大黄解法:状态位剩余的碗数,逆向求解,状态方程:                 DP[ i ][ j ] = (DP[ i-1 ][ j ]+DP[ i ][ j-1 ])/2 + 1 ...
分类:其他好文   时间:2014-10-04 21:41:47    阅读次数:193
hdu 1398 Square Coins (母函数)
# include # include # include # include using namespace std; int main() { int n,i,j,k; int c1[310],c2[310]; while(~scanf("%d",&n),n) { for(i=0;i<=n;i++) { ...
分类:其他好文   时间:2014-10-03 11:59:44    阅读次数:246
HDU-2844-Coins(多重背包)
Problem Description 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 ...
分类:其他好文   时间:2014-10-03 02:05:13    阅读次数:356
Gold Coins(闲来无事水一发)
Gold Coins Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 21155 Accepted: 13265 Description The king pays his loyal knight in gold coins. On the first day of his service, the...
分类:其他好文   时间:2014-09-27 14:29:09    阅读次数:200
Poj 1742 Coins
题意: 给定N个面值,a1..an,每种面值都有c1..cn个,问从1..m的面值中,有多少个可以用已经给定的面值组成?分析: 还记得“多重组合数”问题么? DP[K][N]——用前N种数字组成K,第N种可以剩下最多多少个。 证明分析就不给出了,见前面的博文吧。时间复杂度为K*N这道题...
分类:其他好文   时间:2014-09-26 19:41:48    阅读次数:138
【POJ3260】The Fewest Coins 多重背包+完全背包
O(n)的多重背包优化!...
分类:其他好文   时间:2014-09-22 13:20:32    阅读次数:149
UVa 10306 - e-Coins
题目:有m个钱币,有两种价值(xi,yi),现在要求组成面值sum(x)^2+sum(y)^2=s^2的最少硬币数。 分析:dp,二维安全背包。和以为背包相同,只是容量现在是二维的,按递增序枚举两个容量即可;              求解时,枚举所有x^2+y^2=s^2的x和y,取最小即可。 说明:最近开始练习dp(⊙_⊙)。 #include #include #include ...
分类:其他好文   时间:2014-09-19 15:44:05    阅读次数:181
POJ 3416 Crossing
Crossing Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 1564   Accepted: 726 Description Wintokk has collected a huge amount of coins at THU. One day he had...
分类:其他好文   时间:2014-09-18 22:19:04    阅读次数:309
UVA 12510/CSU 1119 Collecting Coins DFS
前年的省赛题,难点在于这个石头的推移不太好处理后来还是看了阳神当年的省赛总结,发现这个石头这里,因为就四五个子,就暴力dfs处理即可。先把石头当做普通障碍,进行一遍全图的dfs或者bfs,找到可以找的点,然后dfs每次探索新区域的新点即可,想通了这里很好做了#include #include #in...
分类:其他好文   时间:2014-09-09 17:57:19    阅读次数:270
CodeChef--Cards, bags and coins
题目链接Yet another game from chef. Chef gives youNcards andMbags. Each of theNcards has an integer written on it. Now chef asks you to close your eyes an...
分类:其他好文   时间:2014-09-04 22:15:00    阅读次数:291
511条   上一页 1 ... 44 45 46 47 48 ... 52 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!