fork download
  1. #include<iostream>
  2. #include<list>
  3. #include<string>
  4. #include<cstring>
  5. #include<sstream>
  6. #include<cctype>
  7. #include<string.h>
  8. #include<algorithm>
  9. #include<cmath>
  10. #include<stack>
  11. #include<fstream>
  12. #include<cstdlib>
  13. #include<vector>
  14. #include<map>
  15. #include<set>
  16. #include<utility>
  17. #include<iomanip>
  18. #include<queue>
  19.  
  20. using namespace std;
  21.  
  22. #define INF (1<<29)
  23. #define SET(a) memset(a,-1,sizeof(a))
  24. #define ALL(a) a.begin(),a.end()
  25. #define CLR(a) memset(a,0,sizeof(a))
  26. #define FILL(a,v) memset(a,v,sizeof(a))
  27. #define PB push_back
  28. #define FOR(i,n) for(int i = 0;i<n;i++)
  29. #define PI acos(-1.0)
  30. #define EPS 1e-9
  31. #define MP(a,b) make_pair(a,b)
  32. #define min3(a,b,c) min(a,min(b,c))
  33. #define max3(a,b,c) max(a,max(b,c))
  34. #define READ freopen("input.txt", "r", stdin)
  35. #define WRITE freopen("output.txt", "w", stdout)
  36. #define LL long long
  37. #define MX 100010
  38. #define MOD 1000000007
  39. int s[] = {10000,5000,2000,1000,500,200,100,50,20,10,5};
  40. LL count(LL n){
  41. LL table[n+1];
  42. for(int i =0;i<n+1;i++)table[i] =0;
  43. table[0] = 1;
  44. for(int i =0;i<11;i++){
  45. for(int j = s[i];j<n+1;j++){
  46. table[j]+=table[j-s[i]];
  47. }
  48. }
  49. return table[n];
  50. }
  51. int main(){
  52. double c;
  53. LL n;
  54. while(cin>>c){
  55. LL n;
  56. n = 100*c;
  57. if(c!=0.00){
  58. printf("%6.2lf%17lld\n",c,count(n));
  59. }
  60. }
  61.  
  62. return 0;
  63. }
Success #stdin #stdout 0s 3232KB
stdin
0.20
2.00
0.00
stdout
  0.20                4
  2.00              293