結果

問題 No.392 2分木をたどれ
ユーザー hhgfhn1hhgfhn1
提出日時 2018-12-18 19:42:46
言語 Java21
(openjdk 21)
結果
AC  
実行時間 1,112 ms / 2,000 ms
コード長 478 bytes
コンパイル時間 2,245 ms
コンパイル使用メモリ 76,428 KB
実行使用メモリ 63,720 KB
最終ジャッジ日時 2023-10-25 23:42:15
合計ジャッジ時間 5,679 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 169 ms
61,124 KB
testcase_01 AC 1,097 ms
63,624 KB
testcase_02 AC 1,112 ms
63,720 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		int m=scanner.nextInt();
		for(int i=0;i<m;i++) {
			int a=scanner.nextInt();
			dfs("",0,a);
		}
	}

	private static void dfs(String string, int i, int a) {
		if(i==a) {
			System.out.println(string);
			return;
		}
		else if(i>4094) {
			return;
		}
		dfs(string+"L",i*2+1,a);
		dfs(string+"R",i*2+2,a);
	}
}
0