結果

問題 No.392 2分木をたどれ
ユーザー takakintakakin
提出日時 2020-05-06 21:30:34
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 325 bytes
コンパイル時間 168 ms
コンパイル使用メモリ 10,696 KB
実行使用メモリ 7,920 KB
最終ジャッジ日時 2023-09-16 07:30:05
合計ジャッジ時間 692 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=lambda: sys.stdin.readline().rstrip()
m=int(input())
def ans(x):
  n=len(str(bin(x)))-2
  if x==2**n-1:
    return "L"*n
  else:
    ret=""
    x+=1
    for s in str(bin(x))[3:][::-1]:
      if s=="0":
        ret+="L"
      else:
        ret+="R"
    return ret
for _ in range(m):
  print(ans(int(input())))
0