結果

問題 No.2118 遺伝的有限集合の数え上げ
ユーザー ygd.ygd.
提出日時 2022-11-06 21:21:41
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 1,055 bytes
コンパイル時間 97 ms
コンパイル使用メモリ 10,780 KB
実行使用メモリ 8,848 KB
最終ジャッジ日時 2023-09-27 14:46:48
合計ジャッジ時間 6,438 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 20 ms
8,832 KB
testcase_01 AC 19 ms
8,708 KB
testcase_02 AC 18 ms
8,700 KB
testcase_03 AC 17 ms
8,592 KB
testcase_04 AC 18 ms
8,828 KB
testcase_05 AC 18 ms
8,772 KB
testcase_06 AC 18 ms
8,592 KB
testcase_07 AC 18 ms
8,704 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
#input = sys.stdin.readline
#input = sys.stdin.buffer.readline #文字列はダメ
#sys.setrecursionlimit(1000000)
#import math
import bisect
#import itertools
#import random
#from heapq import heapify, heappop, heappush
from collections import defaultdict
#from collections import deque
import copy #DeepCopy: hoge = [_[:] for _ in hogehoge]
#from functools import lru_cache
#@lru_cache(maxsize=None)
#MOD = pow(10,9) + 7
MOD = 998244353
#dx = [1,0,-1,0]
#dy = [0,1,0,-1]
#dx8 = [1,1,0,-1,-1,-1,0,1]
#dy8 = [0,1,1,1,0,-1,-1,-1]

def main():
    N = int(input())
    if N == 0:
        exit(print('{}'))
    L = []
    for i in range(1,70):
        temp = ''
        for j in range(i):
            temp += '{'
        for j in range(i):
            temp += '}'
        L.append(temp)
    
    ans = ['{']
    idx = 0
    while N > 0:
        if N%2 == 1:
            ans.append(L[idx])
            ans.append(',')
        N //= 2
        idx += 1
    ans.pop()
    ans.append('}')
    print("".join(ans))


if __name__ == '__main__':
    main()
0