/* -*- coding: utf-8 -*- * * 790.cc: No.790 ちきんの括弧並べ - yukicoder */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; /* constant */ const int MAX_N = 13; const int MAX_N2 = MAX_N * 2; /* typedef */ /* global variables */ int dp[MAX_N2 + 1][MAX_N + 1]; /* subroutines */ /* main */ int main() { int n; scanf("%d", &n); int n2 = n * 2; dp[0][0] = 1; for (int i = 0; i < n2; i++) for (int j = 0; j <= n; j++) if (dp[i][j]) { if (j + 1 <= n) dp[i + 1][j + 1] += dp[i][j]; if (j - 1 >= 0) dp[i + 1][j - 1] += dp[i][j]; } printf("%d\n", dp[n2][0]); return 0; }