HDOJ 1028:Ignatius and the Princess III
2010-11-19 09:40
246 查看
#include<stdio.h> #include<math.h> #define N 130 int n ; void init(){ int i,j; for(i=0;i<N;i++) n[i][1]=n[1][i]=1; for(i=2;i<N;i++){ for(j=2;j<N;j++){ if(i>j) n[i][j]=n[i][j-1]+n[i-j][j]; else if(i==j) n[i][j]=1+n[i][j-1]; else n[i][j]=n[i][i]; } } } int main(){ int k; init(); while(scanf("%d",&k)!=EOF){ printf("%d/n",n[k][k]); } return 0; }
相关文章推荐
- hdoj-1028-Ignatius and the Princess III
- HDOJ 1028 Ignatius and the Princess III(递推)
- hdoj 1028 Ignatius and the Princess III(母函数)
- hdoj1028 Ignatius and the Princess III(母函数,生成函数)
- hdoj 1028 Ignatius and the Princess III 整数拆分 递推
- hdoj1028 Ignatius and the Princess III(整数分解)
- 【hdoj】1028 Ignatius and the Princess III
- hdoj1028Ignatius and the Princess III(整数无序分划,动态规划)
- HDU/HDOJ 1028 母函数 Ignatius and the Princess III
- HDOJ 1028 Ignatius and the Princess III(整数划分)
- hdoj 1028 Ignatius and the Princess III
- HDOJ1028 Ignatius and the Princess III
- hdoj 1028 Ignatius and the Princess III
- HDOJ 1028 Ignatius and the Princess III [母函数]
- HDOJ 1028 Ignatius and the Princess III
- HDOJ 1028 Ignatius and the Princess III
- [HDOJ1028]Ignatius and the Princess III (母函数)
- HDOJ 1028 Ignatius and the Princess III
- HDOJ-1028Ignatius and the Princess III---(整数划分的母函数做法)
- hdoj 1028 Ignatius and the Princess III