hdu1028

/*

*/
#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int c1[121], c2[121];
void init() {
    for (int i = 0; i <= 120; i++) {
        c1[i] = 1;
        c2[i] = 0;
    }
    for (int i = 2; i <= 120; i++) {
        for (int j = 0; j <= 120; j++) {
            for (int k = 0; k+j <= 120; k+=i) {
                c2[k+j] += c1[j];
            }
        }
        for (int j = 0; j <= 120; j++) {
            c1[j] = c2[j];
            c2[j] = 0;
        }
    }
}
int main() {
  int n;
  init();
  while (scanf("%d", &n) != EOF) {
      printf("%d\n", c1[n]);
    }
}

 

posted @ 2017-11-11 14:24  白丁一枚  阅读(78)  评论(0编辑  收藏  举报