解题报告:
思路:和UVA - 674题目解法一样。这题要注意精度。
代码:
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N = 3e4+10;
const ll dic[11] = {5, 10, 20, 50, 100, 200, 500, 1000, 2000, 5000, 10000};
ll dp[N];
double n;
void init(){
dp[0] = 1;
for(ll i=0; i<11; ++i){
for(ll j=dic[i]; j<N; ++j){
dp[j] += dp[j - dic[i]];
}
}
}
int main(){
init();
while(~scanf("%lf", &n)){
ll nn = n*100+0.5;
if(!nn)break;
printf("%6.2f%17lld\n", n, dp[nn]);
}
return 0;
}
来源:CSDN
作者:baronLJ
链接:https://blog.csdn.net/jun_____/article/details/104575897