记录编号 |
237127 |
评测结果 |
AAAAAAAAAAAAA |
题目名称 |
698.奶牛们的货币系统 |
最终得分 |
100 |
用户昵称 |
liu_runda |
是否通过 |
通过 |
代码语言 |
C++ |
运行时间 |
0.003 s |
提交时间 |
2016-03-16 10:04:02 |
内存使用 |
0.36 MiB |
显示代码纯文本
#include<cstdio>
int w[30];
long long f[10005];
int main(){
freopen("moneysys.in","r",stdin);
freopen("moneysys.out","w",stdout);
int n,totw;scanf("%d %d",&n,&totw);
for(int i=1;i<=n;++i)scanf("%d",&w[i]);
f[0]=1;
for(int i=1;i<=n;++i){
for(int j=w[i];j<=totw;++j){
f[j]+=f[j-w[i]];
}
}
printf("%lld",f[totw]);
fclose(stdin);fclose(stdout);
return 0;
}