結果

問題 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  
実行時間 56 ms / 2,000 ms
コード長 324 bytes
コンパイル時間 80 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-04-28 15:38:37
合計ジャッジ時間 650 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 24 ms
10,752 KB
testcase_01 AC 51 ms
10,752 KB
testcase_02 AC 56 ms
10,624 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