結果

問題 No.392 2分木をたどれ
ユーザー ああいいああいい
提出日時 2021-12-06 21:06:18
言語 Python3
(3.10.1 + numpy 1.22.3 + scipy 1.8.0)
結果
AC  
実行時間 50 ms / 2,000 ms
コード長 268 bytes
コンパイル時間 62 ms
使用メモリ 7,656 KB
最終ジャッジ日時 2023-02-10 13:13:05
合計ジャッジ時間 874 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 15 ms
7,656 KB
testcase_01 AC 50 ms
7,620 KB
testcase_02 AC 50 ms
7,576 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

m = int(input())

for _ in range(m):
    A = int(input())
    root = []
    while A:
        parent = (A-1)//2
        if parent * 2 + 1 == A:
            root.append('L')
        else:
            root.append('R')
        A = parent
    print(''.join(reversed(root)))
0