結果

問題 No.2118 遺伝的有限集合の数え上げ
ユーザー 👑 kakel-sankakel-san
提出日時 2022-11-04 22:22:15
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 63 ms / 2,000 ms
コード長 798 bytes
コンパイル時間 1,011 ms
コンパイル使用メモリ 65,632 KB
実行使用メモリ 22,708 KB
最終ジャッジ日時 2023-09-26 00:51:22
合計ジャッジ時間 5,525 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
20,680 KB
testcase_01 AC 59 ms
20,680 KB
testcase_02 AC 58 ms
20,680 KB
testcase_03 AC 60 ms
20,796 KB
testcase_04 AC 58 ms
20,688 KB
testcase_05 AC 58 ms
18,724 KB
testcase_06 AC 58 ms
20,616 KB
testcase_07 AC 59 ms
22,708 KB
testcase_08 AC 62 ms
20,644 KB
testcase_09 AC 59 ms
22,644 KB
testcase_10 AC 59 ms
22,700 KB
testcase_11 AC 60 ms
20,700 KB
testcase_12 AC 59 ms
20,540 KB
testcase_13 AC 60 ms
20,812 KB
testcase_14 AC 60 ms
20,768 KB
testcase_15 AC 59 ms
20,648 KB
testcase_16 AC 58 ms
20,860 KB
testcase_17 AC 59 ms
20,824 KB
testcase_18 AC 60 ms
20,656 KB
testcase_19 AC 61 ms
20,712 KB
testcase_20 AC 59 ms
20,612 KB
testcase_21 AC 63 ms
22,704 KB
testcase_22 AC 61 ms
20,616 KB
testcase_23 AC 61 ms
18,616 KB
testcase_24 AC 61 ms
20,736 KB
testcase_25 AC 62 ms
20,780 KB
testcase_26 AC 60 ms
20,660 KB
testcase_27 AC 57 ms
20,600 KB
testcase_28 AC 58 ms
20,628 KB
testcase_29 AC 59 ms
20,536 KB
testcase_30 AC 60 ms
20,664 KB
testcase_31 AC 61 ms
20,796 KB
testcase_32 AC 62 ms
22,652 KB
testcase_33 AC 59 ms
20,664 KB
testcase_34 AC 58 ms
20,612 KB
testcase_35 AC 60 ms
20,604 KB
testcase_36 AC 59 ms
20,724 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using System;
using static System.Console;
using System.Linq;
using System.Collections.Generic;

class Program
{
    static int NN => int.Parse(ReadLine());
    static void Main()
    {
        Solve();
    }
    static void Solve()
    {
        var n = NN;
        WriteLine(string.Concat(Sn(n)));
    }
    static List<char> Sn(int n)
    {
        var list = new List<char>();
        list.Add('{');
        var bit = 0;
        var isFirst = true;
        while ((1 << bit) <= n)
        {
            if (((1 << bit) & n) != 0)
            {
                if (!isFirst) list.Add(',');
                isFirst = false;
                list.AddRange(Sn(bit));
            }
            ++bit;
        }
        list.Add('}');
        return list;
    }
}
0