結果
問題 | No.392 2分木をたどれ |
ユーザー |
![]() |
提出日時 | 2016-08-21 15:46:13 |
言語 | Java17 (openjdk 17.0.1) |
結果 |
AC
|
実行時間 | 300 ms / 2,000 ms |
コード長 | 843 bytes |
コンパイル時間 | 3,566 ms |
使用メモリ | 58,096 KB |
最終ジャッジ日時 | 2022-12-14 05:34:06 |
合計ジャッジ時間 | 5,245 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge14 |
テストケース
テストケース表示入力 | 結果 | 実行時間 使用メモリ |
---|---|---|
testcase_00 | AC | 125 ms
52,120 KB |
testcase_01 | AC | 283 ms
57,952 KB |
testcase_02 | AC | 300 ms
58,096 KB |
ソースコード
import java.util.*; import java.io.*; import java.awt.geom.*; import java.math.*; public class No0392 { static final Scanner in = new Scanner(System.in); static final PrintWriter out = new PrintWriter(System.out,false); static boolean debug = false; static void solve() { int m = in.nextInt(); for (int i=0; i<m; i++) { int a = in.nextInt() + 1; StringBuilder sb = new StringBuilder(); while (a != 1) { sb.append(a%2 == 0 ? "L" : "R"); a /= 2; } out.println(sb.reverse()); } } public static void main(String[] args) { debug = args.length > 0; long start = System.nanoTime(); solve(); out.flush(); long end = System.nanoTime(); dump((end - start) / 1000000 + " ms"); in.close(); out.close(); } static void dump(Object... o) { if (debug) System.err.println(Arrays.deepToString(o)); } }