結果

問題 No.104 国道
ユーザー r.suzukir.suzuki
提出日時 2016-01-09 20:57:02
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 339 bytes
コンパイル時間 3,777 ms
コンパイル使用メモリ 74,328 KB
実行使用メモリ 57,772 KB
最終ジャッジ日時 2023-10-19 16:58:50
合計ジャッジ時間 7,384 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
57,572 KB
testcase_01 AC 132 ms
57,520 KB
testcase_02 AC 132 ms
57,508 KB
testcase_03 RE -
testcase_04 AC 131 ms
57,568 KB
testcase_05 AC 132 ms
57,540 KB
testcase_06 AC 128 ms
57,508 KB
testcase_07 AC 132 ms
57,504 KB
testcase_08 AC 132 ms
57,596 KB
testcase_09 AC 130 ms
57,496 KB
testcase_10 AC 128 ms
57,556 KB
testcase_11 AC 131 ms
57,548 KB
testcase_12 AC 131 ms
57,660 KB
testcase_13 AC 134 ms
57,660 KB
testcase_14 AC 132 ms
57,696 KB
testcase_15 AC 134 ms
57,568 KB
testcase_16 AC 134 ms
57,572 KB
testcase_17 AC 130 ms
57,536 KB
testcase_18 AC 131 ms
57,520 KB
testcase_19 AC 127 ms
57,576 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

public class No_104 {

	public static void main(String[] args) {
		java.util.Scanner sc = new java.util.Scanner(System.in);
		char[] LorR = sc.next().toCharArray();
		int root = 1;

		for (char c : LorR) {
			if (c == 'L')
				root *= 2;
			else if (c == 'R')
				root = root * 2 + 1;
		}

		System.out.println(root);
		sc.close();

	}

}
0