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
代码:
#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
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
这一题,简单的母函数的应用,好久没有写过母函数了,有点生疏了。
题目的硬币有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
题目链接: 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
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
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
题意:有17种硬币,每种的面值为编号的平方,比如 1,4,9,16....。给出一个数字,求组成这个面值有多少种组法?思路:用普通母函数解,主要做的就是模拟乘法,因为硬币是无限的,所以每个构造式中每一个项的系数都是1。我们只需要第n项的系数,大于n的并不需要,所以大于n的项就不用再做计算了。 1 #...
分类:
其他好文 时间:
2015-05-21 12:34:13
阅读次数:
161
可以用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