結果

問題 No.392 2分木をたどれ
ユーザー ああいいああいい
提出日時 2021-12-06 21:06:18
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 53 ms / 2,000 ms
コード長 268 bytes
コンパイル時間 100 ms
コンパイル使用メモリ 10,684 KB
実行使用メモリ 7,904 KB
最終ジャッジ日時 2023-09-21 15:46:10
合計ジャッジ時間 660 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,904 KB
testcase_01 AC 52 ms
7,760 KB
testcase_02 AC 53 ms
7,800 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