結果

問題 No.104 国道
ユーザー jimanojimano
提出日時 2018-01-18 19:24:30
言語 Java21
(openjdk 21)
結果
AC  
実行時間 39 ms / 5,000 ms
コード長 565 bytes
コンパイル時間 2,889 ms
コンパイル使用メモリ 71,680 KB
実行使用メモリ 49,788 KB
最終ジャッジ日時 2023-08-25 23:22:53
合計ジャッジ時間 4,534 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
49,524 KB
testcase_01 AC 37 ms
49,448 KB
testcase_02 AC 39 ms
49,444 KB
testcase_03 AC 39 ms
49,788 KB
testcase_04 AC 38 ms
49,448 KB
testcase_05 AC 39 ms
49,456 KB
testcase_06 AC 38 ms
49,612 KB
testcase_07 AC 38 ms
49,308 KB
testcase_08 AC 37 ms
49,700 KB
testcase_09 AC 37 ms
49,308 KB
testcase_10 AC 36 ms
49,500 KB
testcase_11 AC 36 ms
49,528 KB
testcase_12 AC 36 ms
49,468 KB
testcase_13 AC 36 ms
49,424 KB
testcase_14 AC 36 ms
49,344 KB
testcase_15 AC 38 ms
49,296 KB
testcase_16 AC 38 ms
49,564 KB
testcase_17 AC 38 ms
49,516 KB
testcase_18 AC 38 ms
49,380 KB
testcase_19 AC 38 ms
49,540 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package me.yukicoder.lv1;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class No0104 {
	public static void main(String[] args) {
		try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
			String[] array = br.readLine().split("");
			int route = 1;

			for (String s : array) {
				if (s.equals("L")) {
					route *= 2;
				} else if (s.equals("R")) {
					route = (route * 2) + 1;
				}
			}
			System.out.println(route);

		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
0