結果
問題 |
No.566 だいたい完全二分木
|
ユーザー |
![]() |
提出日時 | 2017-12-03 04:27:07 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 32 ms / 2,000 ms |
コード長 | 384 bytes |
コンパイル時間 | 227 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 11,008 KB |
最終ジャッジ日時 | 2024-11-28 08:26:10 |
合計ジャッジ時間 | 969 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 11 |
ソースコード
import sys def print_ans(ls): c = len(ls) // 2 val = ls[c] if val == 2: sys.stdout.write('3 2 1 ') elif val != 1 and val != 3: sys.stdout.write(str(val) + ' ') if len(ls) >= 2: print_ans(ls[:c]) if len(ls) >= 3: print_ans(ls[c + 1:]) k = int(input()) ls = list(range(1, 2**k)) print_ans(ls) print('')