結果

問題 No.392 2分木をたどれ
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2016-11-16 16:50:16
言語 Java21
(openjdk 21)
結果
AC  
実行時間 315 ms / 2,000 ms
コード長 555 bytes
コンパイル時間 2,448 ms
コンパイル使用メモリ 73,736 KB
実行使用メモリ 60,504 KB
最終ジャッジ日時 2023-08-17 07:29:16
合計ジャッジ時間 3,286 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
55,960 KB
testcase_01 AC 306 ms
60,068 KB
testcase_02 AC 315 ms
60,504 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int m = sc.nextInt();
        for(int i=0; i<m; i++){
            int A = sc.nextInt();
            String S = Integer.toBinaryString(A+1);
            String t = "";
            for(int j=1; j<S.length(); j++){
                if( S.charAt(j)=='0'){
                    t=t+"L";
                }else{
                    t=t+"R";
                }
            }
            System.out.println(t);
        }
    }
}
0