結果
| 問題 | No.790 ちきんの括弧並べ |
| ユーザー |
|
| 提出日時 | 2022-05-06 19:37:45 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 390 bytes |
| 記録 | |
| コンパイル時間 | 288 ms |
| コンパイル使用メモリ | 85,248 KB |
| 実行使用メモリ | 81,536 KB |
| 最終ジャッジ日時 | 2026-03-27 06:11:10 |
| 合計ジャッジ時間 | 4,419 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 TLE * 1 |
ソースコード
import itertools
n = int(input())
answer = 0
for pops in itertools.combinations(range(1, 2 * n), n - 1):
pops_set = set(pops) | {0}
s = 0
criteria = True
for i in range(2 * n):
if i in pops_set:
s += 1
else:
s -= 1
if s < 0:
criteria = False
break
if criteria:
answer += 1
print(answer)