結果

問題 No.790 ちきんの括弧並べ
ユーザー 大橋佐和大橋佐和
提出日時 2022-05-06 19:26:29
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 377 bytes
コンパイル時間 1,882 ms
コンパイル使用メモリ 86,684 KB
実行使用メモリ 77,096 KB
最終ジャッジ日時 2023-09-19 08:36:49
合計ジャッジ時間 7,791 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
71,360 KB
testcase_01 AC 80 ms
71,352 KB
testcase_02 AC 82 ms
71,296 KB
testcase_03 AC 98 ms
76,332 KB
testcase_04 AC 93 ms
76,580 KB
testcase_05 AC 92 ms
76,428 KB
testcase_06 AC 113 ms
76,840 KB
testcase_07 AC 177 ms
76,848 KB
testcase_08 AC 1,472 ms
77,096 KB
testcase_09 TLE -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools


n = int(input())

answer = 0
for pops in itertools.combinations(range(2 * n), n):
    pops_set = set(pops)
    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)
0