結果

問題 No.566 だいたい完全二分木
ユーザー mokraimokrai
提出日時 2017-12-03 21:38:40
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 21 ms / 2,000 ms
コード長 346 bytes
コンパイル時間 156 ms
コンパイル使用メモリ 10,536 KB
実行使用メモリ 9,040 KB
最終ジャッジ日時 2023-08-19 02:05:18
合計ジャッジ時間 1,817 ms
ジャッジサーバーID
(参考情報)
judge15 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,656 KB
testcase_01 AC 18 ms
8,716 KB
testcase_02 AC 16 ms
8,864 KB
testcase_03 AC 16 ms
8,700 KB
testcase_04 AC 17 ms
8,832 KB
testcase_05 AC 14 ms
8,656 KB
testcase_06 AC 16 ms
8,824 KB
testcase_07 AC 16 ms
8,764 KB
testcase_08 AC 16 ms
8,768 KB
testcase_09 AC 20 ms
8,960 KB
testcase_10 AC 21 ms
9,040 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import random

def main():
    N = int(input())
    if N == 2:
        print(1,3,2)
    else:
        l = list(range(1, 2 ** N))
        random.shuffle(l)
        while l[0] == 1:
            random.shuffle(l)

        for i in l:
            print(i, end='')
            print(" ", end='')
        print()

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