結果

問題 No.2118 遺伝的有限集合の数え上げ
ユーザー MasKoaTSMasKoaTS
提出日時 2022-09-23 20:39:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 79 ms / 2,000 ms
コード長 307 bytes
コンパイル時間 283 ms
コンパイル使用メモリ 86,892 KB
実行使用メモリ 71,616 KB
最終ジャッジ日時 2023-09-18 06:07:06
合計ジャッジ時間 5,280 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
71,576 KB
testcase_01 AC 77 ms
71,580 KB
testcase_02 AC 75 ms
71,280 KB
testcase_03 AC 78 ms
71,440 KB
testcase_04 AC 75 ms
71,312 KB
testcase_05 AC 75 ms
71,444 KB
testcase_06 AC 77 ms
71,576 KB
testcase_07 AC 76 ms
71,392 KB
testcase_08 AC 76 ms
71,400 KB
testcase_09 AC 75 ms
71,364 KB
testcase_10 AC 75 ms
71,116 KB
testcase_11 AC 75 ms
71,616 KB
testcase_12 AC 75 ms
71,280 KB
testcase_13 AC 78 ms
71,464 KB
testcase_14 AC 75 ms
71,324 KB
testcase_15 AC 77 ms
71,144 KB
testcase_16 AC 77 ms
71,272 KB
testcase_17 AC 76 ms
71,216 KB
testcase_18 AC 76 ms
71,404 KB
testcase_19 AC 75 ms
71,476 KB
testcase_20 AC 76 ms
71,212 KB
testcase_21 AC 76 ms
71,316 KB
testcase_22 AC 76 ms
71,432 KB
testcase_23 AC 76 ms
71,428 KB
testcase_24 AC 76 ms
71,456 KB
testcase_25 AC 75 ms
71,364 KB
testcase_26 AC 75 ms
71,252 KB
testcase_27 AC 75 ms
71,596 KB
testcase_28 AC 75 ms
71,440 KB
testcase_29 AC 75 ms
71,272 KB
testcase_30 AC 75 ms
71,120 KB
testcase_31 AC 76 ms
71,240 KB
testcase_32 AC 73 ms
71,404 KB
testcase_33 AC 73 ms
71,260 KB
testcase_34 AC 74 ms
71,376 KB
testcase_35 AC 75 ms
71,484 KB
testcase_36 AC 76 ms
71,104 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

def S(n):
	i = 0
	lis = []
	while(n):
		if(n & 1):
			lis.append(i)
		i += 1
		n >>= 1
	ret = ["{"]
	for i, k in enumerate(lis):
		ret.append(S(k))
		if(i == len(lis) - 1):
			break
		ret.append(',')
	ret.append("}")
	return ''.join(ret)

N = int(input())
print(S(N))
0