Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<list>
- #include<string>
- #include<cstring>
- #include<sstream>
- #include<cctype>
- #include<string.h>
- #include<algorithm>
- #include<cmath>
- #include<stack>
- #include<fstream>
- #include<cstdlib>
- #include<vector>
- #include<map>
- #include<set>
- #include<utility>
- #include<iomanip>
- #include<queue>
- using namespace std;
- #define INF (1<<29)
- #define SET(a) memset(a,-1,sizeof(a))
- #define ALL(a) a.begin(),a.end()
- #define CLR(a) memset(a,0,sizeof(a))
- #define FILL(a,v) memset(a,v,sizeof(a))
- #define PB push_back
- #define FOR(i,n) for(int i = 0;i<n;i++)
- #define PI acos(-1.0)
- #define EPS 1e-9
- #define MP(a,b) make_pair(a,b)
- #define min3(a,b,c) min(a,min(b,c))
- #define max3(a,b,c) max(a,max(b,c))
- #define READ freopen("input.txt", "r", stdin)
- #define WRITE freopen("output.txt", "w", stdout)
- #define LL long long
- #define MX 100010
- #define MOD 1000000007
- int s[] = {10000,5000,2000,1000,500,200,100,50,20,10,5};
- LL count(LL n){
- LL table[n+1];
- for(int i =0;i<n+1;i++)table[i] =0;
- table[0] = 1;
- for(int i =0;i<11;i++){
- for(int j = s[i];j<n+1;j++){
- table[j]+=table[j-s[i]];
- }
- }
- return table[n];
- }
- int main(){
- string s;
- while(cin>>s){
- int i = 0, n = 0, d = 0;
- for(; s[i] != '.'; i++) n = 10*n + s[i] - '0';
- for(++i; i < s.length(); i++) d = 10*d + s[i] - '0';
- if(100*n+d>0){
- if(n<100) cout << " ";
- if(n<10) cout << " ";
- cout << n << ".";
- if(d < 10) cout << "0";
- cout << d;
- int digs = 17;
- LL ans = count(100*n+d);
- LL x = ans;
- while(x>0) x /= 10, digs--;
- for(int t = 0; t < digs; t++) cout << " ";
- cout << ans << "\n";
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement