結果

問題 No.2118 遺伝的有限集合の数え上げ
ユーザー MichirakaraMichirakara
提出日時 2022-11-04 22:07:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 109 ms / 2,000 ms
コード長 214 bytes
コンパイル時間 770 ms
コンパイル使用メモリ 87,132 KB
実行使用メモリ 72,568 KB
最終ジャッジ日時 2023-09-26 00:33:48
合計ジャッジ時間 6,710 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 101 ms
72,264 KB
testcase_01 AC 102 ms
72,088 KB
testcase_02 AC 101 ms
72,288 KB
testcase_03 AC 103 ms
72,348 KB
testcase_04 AC 102 ms
72,376 KB
testcase_05 AC 99 ms
72,372 KB
testcase_06 AC 98 ms
72,380 KB
testcase_07 AC 99 ms
72,548 KB
testcase_08 AC 103 ms
72,288 KB
testcase_09 AC 99 ms
72,520 KB
testcase_10 AC 100 ms
72,508 KB
testcase_11 AC 101 ms
72,320 KB
testcase_12 AC 105 ms
72,288 KB
testcase_13 AC 102 ms
72,328 KB
testcase_14 AC 100 ms
72,344 KB
testcase_15 AC 96 ms
72,520 KB
testcase_16 AC 100 ms
72,372 KB
testcase_17 AC 102 ms
72,568 KB
testcase_18 AC 101 ms
72,152 KB
testcase_19 AC 100 ms
72,560 KB
testcase_20 AC 101 ms
72,420 KB
testcase_21 AC 101 ms
72,148 KB
testcase_22 AC 97 ms
72,344 KB
testcase_23 AC 100 ms
72,144 KB
testcase_24 AC 104 ms
72,284 KB
testcase_25 AC 109 ms
72,148 KB
testcase_26 AC 100 ms
72,324 KB
testcase_27 AC 100 ms
72,452 KB
testcase_28 AC 101 ms
72,516 KB
testcase_29 AC 103 ms
72,328 KB
testcase_30 AC 100 ms
72,192 KB
testcase_31 AC 100 ms
72,432 KB
testcase_32 AC 100 ms
72,464 KB
testcase_33 AC 101 ms
72,256 KB
testcase_34 AC 99 ms
72,428 KB
testcase_35 AC 101 ms
72,140 KB
testcase_36 AC 105 ms
72,288 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
from functools import lru_cache
@lru_cache()
def f(n):
	if n==0:
		return "{}"
	st=[]
	i=0
	while 2**i<=n:
		if bin(n)[-(i+1)]=="1":
			st.append(f(i))
		i+=1
	return "{"+",".join(st)+"}"
print(f(n))
0