Problem 2892 --2.3.4 Money Systems

2892: 2.3.4 Money Systems

"
Time Limit $1$ 秒/Second(s) Memory Limit $512$ 兆字节/Megabyte(s)
提交总数 $4$ 正确数量 $2$
裁判形式 标准裁判/Standard Judge 我的状态 尚未尝试
难度 分类标签 usaco 动态规划

The cows have not only created their own government but they have chosen to create their own money system. In their own rebellious way, they are curious about values of coinage. Traditionally, coins come in values like 1, 5, 10, 20 or 25, 50, and 100 units, sometimes with a 2 unit coin thrown in for good measure.

The cows want to know how many different ways it is possible to dispense a certain amount of money using various coin systems. For instance, using a system of {1, 2, 5, 10, ...} it is possible to create 18 units several different ways, including: 18x1, 9x2, 8x2+2x1, 3x5+2+1, and many others.

Write a program to compute how many ways to construct a given amount of money using supplied coinage. It is guaranteed that the total will fit into both a signed long long (C/C++) and Int64 (Free Pascal).

PROGRAM NAME: money

The number of coins in the system is V (1 <= V <= 25).

The amount money to construct is N (1 <= N <= 10,000).  

Line 1: Two integers, V and N
Lines 2..: V integers that represent the available coins (no particular number of integers per line)
A single line containing the total number of ways to construct N money units using V coins. 
3 10
1 2 5
10

推荐代码 查看2892 所有题解 上传题解视频得图灵币

本题记录 用 户(点击查看用户) 运行号(点击购买题解) 时 间
算法最快[$0 $ms] 计爱玲 448133 2019-07-18 23:58:37
内存最少[$2092 $KB] 找队友,能刷题的那种 447778 2019-07-16 23:39:51
第一AC 找队友,能刷题的那种 447778 2019-07-16 23:39:51
第一挑战 找队友,能刷题的那种 447777 2019-07-16 23:38:48

赛题来源/所属竞赛 usaco training usaco Training

竞赛编号 竞赛名称 竞赛时间 访问比赛