結果
| 問題 | No.790 ちきんの括弧並べ |
| ユーザー |
|
| 提出日時 | 2019-02-22 08:05:26 |
| 言語 | C++17(gcc12) (gcc 12.4.0 + boost 1.89.0) |
| 結果 |
TLE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 383 bytes |
| 記録 | |
| コンパイル時間 | 2,121 ms |
| コンパイル使用メモリ | 200,248 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-06-07 06:58:16 |
| 合計ジャッジ時間 | 7,043 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 TLE * 1 |
ソースコード
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
signed main() {
ios::sync_with_stdio(false); cin.tie(0);
int n;
cin >> n;
int ans = 0;
for (int i = 0; i < (1 << 2 * n); i++) {
int c = 0, cc = 0;
for (int j = 0; j < 2 * n; j++) {
c += (i >> j) & 1 ? 1 : -1;
cc = min(c, cc);
}
ans += cc == 0 && c == 0;
}
cout << ans << endl;
return 0;
}