結果

問題 No.392 2分木をたどれ
ユーザー MitI_7MitI_7
提出日時 2016-09-18 20:10:23
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 40 ms / 2,000 ms
コード長 324 bytes
コンパイル時間 338 ms
コンパイル使用メモリ 10,552 KB
実行使用メモリ 7,960 KB
最終ジャッジ日時 2023-08-10 22:40:43
合計ジャッジ時間 790 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

def solve(a):
    ans = ""
    while a > 0:
        if a % 2 == 0:
            a = (a - 2) // 2
            ans += 'R'
        else:
            a = (a - 1) // 2
            ans += 'L'

    return ans[::-1]


def main():
    m = int(input())
    for _ in range(m):
        a = int(input())
        print(solve(a))


main()
0