找单词
2013-11-25 17:03
148 查看
http://acm.hdu.edu.cn/showproblem.php?pid=2082
View Code
#include<stdio.h> #include<string.h> int main() { //freopen("in.txt","r",stdin); int t; scanf("%d",&t); while(t--) { int num; int a[60],b[60]; int i,j,k; memset(a,0,sizeof(a)); memset(b,0,sizeof(b)); a[0]=1; for( i=1;i<=26;i++) { scanf("%d",&num); if(num==0) continue; for(j=0;j<=50;j++) { for(k=0;k<=num&&k*i+j<=50;k++) b[k*i+j]+=a[j]; } for(j=0;j<=50;j++) { a[j]=b[j]; b[j]=0; } } int tot=0; for(i=1;i<=50;i++) tot+=a[i]; printf("%d\n",tot); } return 0; }
View Code
相关文章推荐
- 高级列单词
- [LeetCode] Valid Word Square 验证单词平方
- Android 对SD卡下英文单词进行发音
- hdoj 2082 找单词(母函数)
- 单词背后的逻辑—字母B
- 洛谷P1026&NOIP2001 统计单词个数
- FZU 2027 单词问题
- codevs3013 单词背诵
- 单词本实现效果
- java map练习之统计单词出现的次数
- 单词查找树
- 翻转单词顺序
- RQNOJ PID302 / [NOIP2001]统计单词个数 (动态规划)
- 单词换行问题
- 今天注册了13个英文单词COM域名,分享一下
- C语言实验——单词统计
- 福大数据结构与算法实验题 1.2 单词背诵(map实现)
- 程序员眼中的英语单词
- 11.12 acm培训题Problem F: 查找单词