标签:hdu2067
1 3 12 -1
1 1 2 2 3 10 3 12 416024
#include <stdio.h> #include <string.h> #include <math.h> __int64 dp[40][40]; int main() { // freopen("stdin.txt", "r", stdin); int i, j, n, cas = 1; for (i = 0; i <= 35; ++i) dp[0][i] = 1; for (i = 1; i <= 35; ++i) { for (j = i; j <= 35; ++j) { if (i == j) { dp[i][i] = dp[i-1][j]; } else dp[i][j] = dp[i-1][j] + dp[i][j-1]; } } while (scanf("%d", &n), n > 0) printf("%d %d %I64d\n", cas++, n, dp[n][n] << 1); return 0; }
标签:hdu2067
原文地址:http://blog.csdn.net/chang_mu/article/details/42838863