結果

問題 No.392 2分木をたどれ
ユーザー Konton7Konton7
提出日時 2019-04-30 18:37:38
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 42 ms / 2,000 ms
コード長 307 bytes
コンパイル時間 88 ms
コンパイル使用メモリ 10,736 KB
実行使用メモリ 8,228 KB
最終ジャッジ日時 2023-08-29 01:31:53
合計ジャッジ時間 887 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 21 ms
8,120 KB
testcase_01 AC 41 ms
8,228 KB
testcase_02 AC 42 ms
8,076 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