码迷,mamicode.com
首页 >  
搜索关键字:coins    ( 511个结果
XTU1233:Coins
Coins Problem Description: Duoxida buys a bottle of MaiDong from a vending machine and the machine give her n coins back. She places them in a line randomly showing head face or tail face on. An...
分类:其他好文   时间:2015-06-14 20:06:32    阅读次数:151
简单博弈问题
问题:Alice and Bob are playing a kind of special game on an N*M board (N rows, M columns). At the beginning, there are N*M coins in this board with one ...
分类:其他好文   时间:2015-06-11 18:44:48    阅读次数:132
hdu 1398 Square Coins(母函数)
代码: #include using namespace std; int main() { int n; int a[18]; for(int i=1;i<=17;i++) a[i]=i*i; while(scanf("%d",&n)&&n) { long long c1[350],c2[350]; fo...
分类:其他好文   时间:2015-06-03 21:40:40    阅读次数:112
Project Euler:Problem 31 Coin sums
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 is possible to make £2 in the...
分类:其他好文   时间:2015-06-03 12:00:39    阅读次数:114
杭电ACM1398——Square Coins~~母函数
这一题,简单的母函数的应用,好久没有写过母函数了,有点生疏了。 题目的硬币有17种,分别是1到17的平方的硬币。 下面的是AC的代码: #include #include #include using namespace std; int dp[305], temp[305]; int main() { int i, j, k, l; for(i = 0; i < 305; i...
分类:其他好文   时间:2015-05-31 23:22:36    阅读次数:196
swust oj--Coin-collecting by robot
题目链接: http://acm.swust.edu.cn/problem/1132/Time limit(ms): 1000 Memory limit(kb): 65535Several coins are placed in cells of an n×m board. A rob...
分类:其他好文   时间:2015-05-30 22:36:10    阅读次数:501
LintCode-Coins in a Line III
There are n coins in a line. Two players take turns to take a coin from one of the ends of the line until there are no more coins left. The player with the larger amount of money wins. Could you pl...
分类:其他好文   时间:2015-05-23 00:02:42    阅读次数:646
POJ 2000 Gold Coins
Time Limit: 1000MSMemory Limit: 30000KTotal Submissions: 21730Accepted: 13614DescriptionThe king pays his loyal knight in gold coins. On the first day...
分类:其他好文   时间:2015-05-22 13:00:27    阅读次数:102
HDU 1398 Square Coins 平方硬币 (普通母函数,水)
题意:有17种硬币,每种的面值为编号的平方,比如 1,4,9,16....。给出一个数字,求组成这个面值有多少种组法?思路:用普通母函数解,主要做的就是模拟乘法,因为硬币是无限的,所以每个构造式中每一个项的系数都是1。我们只需要第n项的系数,大于n的并不需要,所以大于n的项就不用再做计算了。 1 #...
分类:其他好文   时间:2015-05-21 12:34:13    阅读次数:161
有面值为1元、3元和5元的硬币若干枚,如何用最少的硬币凑够11元?
可以用DP 方法去解:coins_count[x], 表示已知x元, 可以最少用coins_count[x]个硬币来凑出来。coins_count[x] = min{ coins_count[x - 1] + 1, coins_count[x - 3] + 1,coins_count[x - 5] ...
分类:其他好文   时间:2015-05-15 21:09:23    阅读次数:545
511条   上一页 1 ... 35 36 37 38 39 ... 52 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!