Time Limit: 1000/1000 MS (Java/Others) Memory Limit:
32768/32768 K (Java/Others)
Total Submission(s): 7547 Accepted Submission(s): 4020
#include<stdio.h> #define LL __int64 LL num[36][36]={0}; void init() { for(int i=1;i<=35;i++) { num[i][0]=1; for(int j=1;j<i;j++) num[i][j]=num[i][j-1]+num[i-1][j]; num[i][i]=num[i][i-1]; } } int main() { int n,ca=1; init(); while(scanf("%d",&n)!=EOF) { if(n==-1) break; printf("%d %d %I64d\n",ca++,n,2*num[n][n]); } return 0; }
版权声明:本文为博主原创文章,未经博主允许不得转载。
原文地址:http://blog.csdn.net/u010579068/article/details/46899463