結果

問題 No.2118 遺伝的有限集合の数え上げ
ユーザー 👑 KazunKazun
提出日時 2022-11-04 21:48:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 103 ms / 2,000 ms
コード長 314 bytes
コンパイル時間 467 ms
コンパイル使用メモリ 87,132 KB
実行使用メモリ 76,580 KB
最終ジャッジ日時 2023-09-26 00:10:15
合計ジャッジ時間 6,878 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 99 ms
72,280 KB
testcase_01 AC 98 ms
72,284 KB
testcase_02 AC 99 ms
72,220 KB
testcase_03 AC 97 ms
72,464 KB
testcase_04 AC 99 ms
72,500 KB
testcase_05 AC 97 ms
72,476 KB
testcase_06 AC 97 ms
72,548 KB
testcase_07 AC 97 ms
72,520 KB
testcase_08 AC 100 ms
72,428 KB
testcase_09 AC 100 ms
72,560 KB
testcase_10 AC 97 ms
72,600 KB
testcase_11 AC 96 ms
72,488 KB
testcase_12 AC 97 ms
72,524 KB
testcase_13 AC 99 ms
72,420 KB
testcase_14 AC 97 ms
72,524 KB
testcase_15 AC 99 ms
72,216 KB
testcase_16 AC 97 ms
72,580 KB
testcase_17 AC 97 ms
72,232 KB
testcase_18 AC 97 ms
72,472 KB
testcase_19 AC 98 ms
72,476 KB
testcase_20 AC 99 ms
72,408 KB
testcase_21 AC 99 ms
72,612 KB
testcase_22 AC 99 ms
72,496 KB
testcase_23 AC 101 ms
72,472 KB
testcase_24 AC 99 ms
72,624 KB
testcase_25 AC 98 ms
72,404 KB
testcase_26 AC 99 ms
72,440 KB
testcase_27 AC 98 ms
72,592 KB
testcase_28 AC 99 ms
76,580 KB
testcase_29 AC 102 ms
76,428 KB
testcase_30 AC 103 ms
76,524 KB
testcase_31 AC 99 ms
76,308 KB
testcase_32 AC 100 ms
76,328 KB
testcase_33 AC 102 ms
76,440 KB
testcase_34 AC 99 ms
76,344 KB
testcase_35 AC 101 ms
76,512 KB
testcase_36 AC 102 ms
76,416 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from functools import lru_cache

def solve():
    @lru_cache(maxsize=None)
    def calc(N):
        if N==0:
            return "{}"

        X=[]
        for i in range(N):
            if (N>>i)&1:
                X.append(calc(i))
        return "{"+",".join(X)+"}"
    return calc(int(input()))

print(solve())
0