結果

問題 No.790 ちきんの括弧並べ
ユーザー 大橋佐和大橋佐和
提出日時 2022-05-06 19:12:55
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 240 bytes
コンパイル時間 993 ms
コンパイル使用メモリ 86,852 KB
実行使用メモリ 76,916 KB
最終ジャッジ日時 2023-09-19 08:24:04
合計ジャッジ時間 7,204 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
71,336 KB
testcase_01 AC 78 ms
71,404 KB
testcase_02 AC 84 ms
76,420 KB
testcase_03 AC 89 ms
76,568 KB
testcase_04 AC 88 ms
76,416 KB
testcase_05 AC 91 ms
76,100 KB
testcase_06 AC 109 ms
76,712 KB
testcase_07 AC 156 ms
76,916 KB
testcase_08 AC 1,112 ms
76,912 KB
testcase_09 TLE -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())

a = 0
for i in range(1 << 2 * n):
    s = 0
    for j in range(2 * n):
        if i >> j & 1:
            s += 1
        else:
            s -= 1
        if s < 0:
            break
    if s == 0:
        a += 1

print(a)
0