买书
货币系统的简化版,注意特判0。
#include <iostream>
#include <cstdio>
using namespace std;
//Mystery_Sky
//
#define ll long long
#define M 10000
int v, m;
ll c[M], f[M];
int main() {
scanf("%d", &v);
c[1] = 10, c[2] = 20, c[3] = 50, c[4] = 100;
f[0] = 1;
if(v == 0) {
printf("0
");
return 0;
}
for(int i = 1; i <= 4; i++)
for(int j = c[i]; j <= v; j++)
f[j] += f[j-c[i]];
printf("%lld
", f[v]);
return 0;
}