UVA 147 - Dollars UVA • Sep 1, 2020 Problem PDFSolution:#include #include #include #include #include #include #include #include #include #include #include #include #define ll long long #define sc scanf #define pf printf #define Pi 2*acos(0.0) using namespace std; int main () { int coin [] = {5,10,20,50,100,200,500,1000,2000,5000,10000}; long way [30010]; memset (way,0,sizeof(way)); way[0]=1; for (int i=0;i<11;i++) { for (int j=coin[i];j<=30010;j++) way [j]+=way[j-coin[i]]; } long a,b; while (sc("%ld.%ld",&a,&b)) { long n=a*100+b; if (n==0) break; pf("%3ld.%.2ld%17ld\n",a,b,way[n]); } return 0; } https://github.com/Shipu/OnlineJudgeProblemSolutionWithCPlusPlus/tree/master/uva/147/147.cpp Tags UVA Competitive Programming Shipu Ahamed Recommended for you UVA UVA 913 - Joana and the Odd Numbers 4 years ago • 1 min read UVA UVA 871 - Counting Cells in a Blob 4 years ago • 3 min read UVA UVA 866 - Intersecting Line Segments 4 years ago • 3 min read