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