結果

問題 No.566 だいたい完全二分木
ユーザー mokraimokrai
提出日時 2017-12-03 21:38:40
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 41 ms / 2,000 ms
コード長 346 bytes
コンパイル時間 278 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 11,392 KB
最終ジャッジ日時 2024-05-06 09:15:36
合計ジャッジ時間 1,551 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
11,008 KB
testcase_01 AC 34 ms
11,136 KB
testcase_02 AC 33 ms
11,136 KB
testcase_03 AC 33 ms
11,136 KB
testcase_04 AC 32 ms
11,008 KB
testcase_05 AC 32 ms
11,008 KB
testcase_06 AC 33 ms
11,136 KB
testcase_07 AC 35 ms
11,136 KB
testcase_08 AC 34 ms
11,136 KB
testcase_09 AC 37 ms
11,264 KB
testcase_10 AC 41 ms
11,392 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