标签:des style blog http io os ar for sp
Description
Input
Output
Sample Input
Sample Output
#include <iostream> #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <algorithm> #include <set> #include <map> #include <vector> #include <queue> #include <string> #define N 1000000007 using namespace std; int ans[1005]; int n; void qt () { memset (ans, 0, sizeof (ans)); ans[1] = 1; for (int i = 2; i <= 1000; ++i) { for (int j = 1; j < i; ++j) { if ((i-1) % j == 0) ans[i] = (ans[i] + ans[j]) % N; } } } int main() { //freopen ("test.txt", "r", stdin); qt (); int times = 1; while (scanf ("%d", &n) != EOF) { printf ("Case %d: %d\n", times++, ans[n]); } return 0; }
ACM学习历程——HDU4472 Count(数学递推) (12年成都区域赛)
标签:des style blog http io os ar for sp
原文地址:http://www.cnblogs.com/andyqsmart/p/4046540.html