結果

問題 No.392 2分木をたどれ
ユーザー Konton7Konton7
提出日時 2019-04-30 18:37:38
言語 Python3
(3.10.1 + numpy 1.22.3 + scipy 1.8.0)
結果
AC  
実行時間 43 ms / 2,000 ms
コード長 307 bytes
コンパイル時間 60 ms
使用メモリ 8,148 KB
最終ジャッジ日時 2023-01-16 13:09:32
合計ジャッジ時間 943 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 24 ms
8,136 KB
testcase_01 AC 43 ms
8,016 KB
testcase_02 AC 43 ms
8,148 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def numtolr(a):
    b = list(bin(a)[3:])
    for i in range(len(b)):
        if b[i] == "0":
            b[i] = "L"
        else:
            b[i] = "R"
    return("".join(b))

bin_tree = [ numtolr(i+1) for i in range(4196) ]

n = int(input())
for i in range(n):
    x = int(input())
    print(bin_tree[x])
0