結果
問題 | No.790 ちきんの括弧並べ |
ユーザー |
|
提出日時 | 2019-03-02 16:14:05 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 7 ms / 2,000 ms |
コード長 | 347 bytes |
コンパイル時間 | 1,370 ms |
コンパイル使用メモリ | 160,944 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-23 12:26:11 |
合計ジャッジ時間 | 1,871 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
ソースコード
#include <bits/stdc++.h> using namespace std; int n; long long dfs(int l, int r){ if(l == 0 && r == 0){ return 1; } long long ans = 0; if(0 < l){ ans += dfs(l-1, r); } if(l < r){ ans += dfs(l, r-1); } return ans; } int main(){ cin >> n; cout << dfs(n, n) << endl; return 0; }