結果
| 問題 |
No.2118 遺伝的有限集合の数え上げ
|
| コンテスト | |
| ユーザー |
Michirakara
|
| 提出日時 | 2022-11-04 22:07:22 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 50 ms / 2,000 ms |
| コード長 | 214 bytes |
| コンパイル時間 | 165 ms |
| コンパイル使用メモリ | 82,432 KB |
| 実行使用メモリ | 55,168 KB |
| 最終ジャッジ日時 | 2024-07-18 19:55:25 |
| 合計ジャッジ時間 | 3,339 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 37 |
ソースコード
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))
Michirakara