結果
問題 | No.392 2分木をたどれ |
ユーザー |
![]() |
提出日時 | 2018-02-21 00:23:19 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 315 ms / 2,000 ms |
コード長 | 455 bytes |
コンパイル時間 | 3,417 ms |
コンパイル使用メモリ | 74,664 KB |
実行使用メモリ | 58,452 KB |
最終ジャッジ日時 | 2024-09-13 14:44:04 |
合計ジャッジ時間 | 4,814 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 3 |
ソースコード
import java.util.Scanner;public class No392 {public static void main(String[] args) {Scanner sc = new Scanner(System.in);int m = sc.nextInt();for(int i = 0;i < m;i++) {StringBuilder route = new StringBuilder();int a = sc.nextInt();while(a != 0) {if(a % 2 == 0) {route.append("R");a = a/2 - 1;}else {route.append("L");a = a/2;}}System.out.println(route.reverse());}}}