結果

問題 No.2118 遺伝的有限集合の数え上げ
ユーザー roarisroaris
提出日時 2022-11-04 22:41:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 90 ms / 2,000 ms
コード長 314 bytes
コンパイル時間 515 ms
コンパイル使用メモリ 87,080 KB
実行使用メモリ 71,948 KB
最終ジャッジ日時 2023-09-26 01:11:20
合計ジャッジ時間 5,924 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 90 ms
71,580 KB
testcase_01 AC 86 ms
71,556 KB
testcase_02 AC 84 ms
71,564 KB
testcase_03 AC 86 ms
71,572 KB
testcase_04 AC 87 ms
71,568 KB
testcase_05 AC 87 ms
71,800 KB
testcase_06 AC 88 ms
71,432 KB
testcase_07 AC 86 ms
71,944 KB
testcase_08 AC 88 ms
71,596 KB
testcase_09 AC 86 ms
71,436 KB
testcase_10 AC 85 ms
71,584 KB
testcase_11 AC 87 ms
71,780 KB
testcase_12 AC 86 ms
71,632 KB
testcase_13 AC 87 ms
71,604 KB
testcase_14 AC 86 ms
71,584 KB
testcase_15 AC 87 ms
71,428 KB
testcase_16 AC 89 ms
71,604 KB
testcase_17 AC 88 ms
71,540 KB
testcase_18 AC 87 ms
71,432 KB
testcase_19 AC 88 ms
71,696 KB
testcase_20 AC 88 ms
71,596 KB
testcase_21 AC 89 ms
71,948 KB
testcase_22 AC 89 ms
71,784 KB
testcase_23 AC 87 ms
71,560 KB
testcase_24 AC 87 ms
71,664 KB
testcase_25 AC 88 ms
71,540 KB
testcase_26 AC 89 ms
71,804 KB
testcase_27 AC 85 ms
71,580 KB
testcase_28 AC 87 ms
71,748 KB
testcase_29 AC 85 ms
71,632 KB
testcase_30 AC 88 ms
71,720 KB
testcase_31 AC 86 ms
71,692 KB
testcase_32 AC 85 ms
71,752 KB
testcase_33 AC 86 ms
71,896 KB
testcase_34 AC 86 ms
71,540 KB
testcase_35 AC 86 ms
71,736 KB
testcase_36 AC 85 ms
71,576 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import *

def f(x):
    if x==0:
        return '{}'
    
    i = 0
    s = []
    t = x
    
    while t:
        if t%2:
            s.append(f(i))
        t //= 2
        i += 1
    
    res = '{'+','.join(list(s))+'}'
    return res

N = int(input())
memo = defaultdict(lambda: -1)
print(f(N))
0