結果

問題 No.392 2分木をたどれ
ユーザー fumofumofunifumofumofuni
提出日時 2021-09-13 18:45:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 247 ms / 2,000 ms
コード長 283 bytes
コンパイル時間 496 ms
コンパイル使用メモリ 87,040 KB
実行使用メモリ 84,296 KB
最終ジャッジ日時 2023-09-08 02:17:41
合計ジャッジ時間 2,405 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 203 ms
82,568 KB
testcase_01 AC 247 ms
83,992 KB
testcase_02 AC 244 ms
84,296 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import queue
que=queue.Queue()
que.put(0)
dp=['']*10010
while not que.empty():
    v=que.get()
    if v>=5000:
        continue
    dp[v*2+1]=dp[v]+'L'
    dp[v*2+2]=dp[v]+'R'
    que.put(v*2+1)
    que.put(v*2+2)
N=int(input())
for i in range(N):
    A=int(input())
    print(dp[A])
0