結果
| 問題 | No.790 ちきんの括弧並べ |
| ユーザー |
|
| 提出日時 | 2019-05-04 16:33:22 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| + 484µs | |
| コード長 | 442 bytes |
| 記録 | |
| コンパイル時間 | 977 ms |
| コンパイル使用メモリ | 183,668 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-07-27 13:06:52 |
| 合計ジャッジ時間 | 2,324 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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;
}