結果
問題 | No.392 2分木をたどれ |
ユーザー |
![]() |
提出日時 | 2017-06-27 23:54:46 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 130 ms / 2,000 ms |
コード長 | 793 bytes |
コンパイル時間 | 1,820 ms |
コンパイル使用メモリ | 80,396 KB |
実行使用メモリ | 58,260 KB |
最終ジャッジ日時 | 2024-10-04 13:50:17 |
合計ジャッジ時間 | 2,704 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 3 |
ソースコード
import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;import java.io.PrintWriter;class Main {static PrintWriter out = new PrintWriter(System.out);static String str;public static void main(String[] args) throws IOException {BufferedReader br = new BufferedReader(new InputStreamReader(System.in));int num = Integer.parseInt(br.readLine());int point;for (int i = 0; i < num; i++) {point = Integer.parseInt(br.readLine());str="";len(point);out.println(str);}br.close();out.flush();}public static int len(int point) {if (point == 0) {return 0;} else {if (point % 2 == 0) {str="R"+str;return len((point - 1) / 2);} else {str="L"+str;return len(point / 2);}}}}