結果
問題 |
No.790 ちきんの括弧並べ
|
ユーザー |
|
提出日時 | 2019-05-04 16:33:22 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 442 bytes |
コンパイル時間 | 1,590 ms |
コンパイル使用メモリ | 170,568 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-23 01:55:05 |
合計ジャッジ時間 | 2,006 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main(){ cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; vector<vector<long long>> dp(N + 1, vector<long long>(N + 1, 0LL)); for (int a = 0; a <= N; ++a) dp[a][0] = 1LL; for (int a = 1; a <= N; ++a){ for (int b = 1; b <= a; ++b){ dp[a][b] = dp[a - 1][b] + dp[a][b - 1]; } } cout << dp[N][N] << endl; return 0; }