Description
Input
Output
Sample Input
Sample Output
#include<cstdio> #include<cstring> #include<iostream> #include<algorithm> using namespace std; __int64 a[150]; int main() { int i,j; a[0]=1;//a[1]=1;a[2]=2;a[3]=3;a[4]=5;a[5]=7; for(i=1;i<=120;i++) { for(j=0;i+j<=120;j++) { a[i+j]+=a[j]; } } int n; while(scanf("%d",&n)!=EOF) { printf("%I64d\n",a[n]); } return 0; }
HDU 1028 Ignatius and the Princess III
原文:http://www.cnblogs.com/sola1994/p/4151997.html