Created
April 29, 2014 12:23
-
-
Save KT-Yeh/11398649 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
#include <algorithm> | |
using namespace std; | |
int method[10000] = {0}; | |
int cent[5] = {1, 5, 10, 25, 50}; | |
int main() | |
{ | |
// 建表 | |
method[0] = 1; | |
for (int i = 0; i < 5; ++i) { | |
for (int j = 0; j + cent[i] <= 7490; ++j) | |
method[j+cent[i]] += method[j]; | |
} | |
// input & output | |
int n; | |
while (scanf("%d", &n) != EOF) | |
printf("%d\n", method[n]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment