题意: 有50 25 10 5 1 的硬币 一共最多有100枚 输入n输出有多少种表示方法

Sample Input
11
26

Sample Output
4
13

 # include <iostream>
# include <cstdio>
# include <cstring>
# include <algorithm>
# include <string>
# include <cmath>
# include <queue>
# include <list>
# define LL long long
using namespace std ; int c1[][],c2[][];
int ans[] ;
int w[]={,,,,,}; void Init(){
memset(c1,,sizeof(c1));
memset(c2,,sizeof(c2));
c1[][]=;
for(int i=;i<=;i++)
{
for(int j=;j<=;j++)
for(int k=;j+k*w[i]<=;k++)
for(int p=;k+p<=;p++)
c2[j+k*w[i]][p+k]+=c1[j][p]; for(int j=;j<=;j++)
for(int p=;p<=;p++)
{
c1[j][p]=c2[j][p];
c2[j][p]=;
}
}
for(int i=;i<=;i++)
for(int j=;j<=;j++)
ans[i]+=c1[i][j]; //c1[11][3]表示这个方案 是用3枚硬币组成11的
ans[]=;
} int main()
{ int n;
Init();
while(~scanf("%d",&n))
{
printf("%d\n",ans[n]);
}
return ;
}

hdu 2069 1 5 10 25 50 这几种硬币 一共100个(母函数)的更多相关文章

  1. hdu 2069 限制个数的母函数(普通型)

    Coin Change Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Tota ...

  2. HDU 2069 Coin Change

    Coin Change Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total S ...

  3. 背水一战 Windows 10 (25) - MVVM: 通过 x:Bind 实现 MVVM(不用 Command)

    [源码下载] 背水一战 Windows 10 (25) - MVVM: 通过 x:Bind 实现 MVVM(不用 Command) 作者:webabcd 介绍背水一战 Windows 10 之 MVV ...

  4. /proc/interrupts 统计2.6.38.8与3.10.25差异

    eth4进,eth5出 linux-3.10.25 67:          2          3          2          3   PCI-MSI-edge     eth468: ...

  5. CentOS安装NodeJS v0.10.25 + Express

    安装必需组件 yum -y install gcc make gcc-c++ openssl-devel wget cd ~wget http://nodejs.org/dist/v0.10.25/n ...

  6. 10.25 正睿停课训练 Day9

    目录 2018.10.25 正睿停课训练 Day9 A 数独(思路 DP) B 红绿灯(最短路Dijkstra) C 轰炸(计算几何 圆并) 考试代码 B C 2018.10.25 正睿停课训练 Da ...

  7. 题解报告:hdu 2069 Coin Change(暴力orDP)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2069 Problem Description Suppose there are 5 types of ...

  8. Java习题10.25

    Java习题10.25 1. 实际上这道题考查的是两同两小一大原则: 方法名相同,参数类型相同 子类返回类型小于等于父类方法返回类型, 子类抛出异常小于等于父类方法抛出异常, 子类访问权限大于等于父类 ...

  9. windows 10 超级优化,同时解决本地磁盘100%的问题

    windows 10 超级优化,同时解决本地磁盘100%的问题 我的系统是笔记本I7处理器,配置了web服务器IIS 和一个数据库(mysql7),同时启用了虚拟机(表中已禁用),以及安装了offic ...

随机推荐

  1. spoj 375 树链剖分 模板

    QTREE - Query on a tree #tree You are given a tree (an acyclic undirected connected graph) with N no ...

  2. Tweepy1——抓取Twitter数据

    sklearn实战-乳腺癌细胞数据挖掘 https://study.163.com/course/introduction.htm?courseId=1005269003&utm_campai ...

  3. Kafka 0.8 Consumer Rebalance

    1 Rebalance时机 0.10kafka的rebalance条件 条件1:有新的consumer加入 条件2:旧的consumer挂了 条件3:coordinator挂了,集群选举出新的coor ...

  4. 软件测试(二)PICT的使用 组合测试方法(两两组合测试,可遍历组合测试)

    一.两两组合测试 # # 两两组合测试 # PLATFORH: x86, ia64, amd64 CPUS: Single, Dual, QUad PAHL: 120MB, 1GB, 4GB, 64G ...

  5. 让网页的title动起来

    <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title&g ...

  6. nodejs 剪切图像在上传,并保存到指定路径下(./public/img/' + req.session.token + '.jpg‘)

    前jQuery端接收数据 function upAvatar(img){ console.log(img); // data:image/jpeg;base64,/9j/4AAQSkZJRgABAQA ...

  7. Lucene之Java实战

    1.导包 2.索引的创建 2.1首先,我们需要定义一个词法分析器. Analyzer analyzer = new IKAnalyzer();//官方推荐 Analyzer analyzer = ne ...

  8. wait&waitpid状态值

    [wait&waitpid状态值] 1.  python 中 os.system 的返回值的format与wait的返回值status一致: On Unix, the return value ...

  9. JS回调函数的应用,原来这么简单!

    JS的回调函数很简单,看代码: 在a.js中 var myback = null; function load(obj){ myback = obj; } function save(){ // 后台 ...

  10. EOJ Monthly 2019.2 (based on February Selection) F.方差

    题目链接: https://acm.ecnu.edu.cn/contest/140/problem/F/ 题目: 思路: 因为方差是用来评估数据的离散程度的,因此最优的m个数一定是排序后连续的,所以我 ...