結果
| 問題 |
No.392 2分木をたどれ
|
| コンテスト | |
| ユーザー |
takakin
|
| 提出日時 | 2020-05-06 21:32:03 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 41 ms / 2,000 ms |
| コード長 | 331 bytes |
| コンパイル時間 | 113 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-07-03 09:09:02 |
| 合計ジャッジ時間 | 592 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 |
ソースコード
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[::-1]
for _ in range(m):
print(ans(int(input())))
takakin