結果

問題 No.392 2分木をたどれ
ユーザー tonnnura172tonnnura172
提出日時 2020-04-24 15:45:19
言語 Python3
(3.10.1 + numpy 1.22.3 + scipy 1.8.0)
結果
AC  
実行時間 44 ms / 2,000 ms
コード長 949 bytes
コンパイル時間 66 ms
使用メモリ 9,376 KB
最終ジャッジ日時 2022-12-11 02:17:36
合計ジャッジ時間 1,138 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 27 ms
8,856 KB
testcase_01 AC 44 ms
9,376 KB
testcase_02 AC 44 ms
9,280 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul, add
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from heapq import heappush, heappop
from functools import reduce, lru_cache
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

m = INT()
A = [INT() for _ in range(m)]

ans = []

for a in A:
	tmp = ""

	while a:
		if a%2 == 0:
			tmp = "R" + tmp
		else:
			tmp = "L" + tmp
		a = (a-1)//2
	ans.append(tmp)

print(*ans, sep="\n")
0