結果

問題 No.104 国道
ユーザー YatsukuYatsuku
提出日時 2015-12-12 03:10:13
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 359 bytes
コンパイル時間 2,570 ms
コンパイル使用メモリ 71,168 KB
実行使用メモリ 56,092 KB
最終ジャッジ日時 2023-10-13 11:36:58
合計ジャッジ時間 5,871 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 111 ms
55,712 KB
testcase_01 AC 115 ms
55,892 KB
testcase_02 AC 107 ms
55,248 KB
testcase_03 RE -
testcase_04 AC 108 ms
55,760 KB
testcase_05 AC 109 ms
55,688 KB
testcase_06 AC 112 ms
55,468 KB
testcase_07 AC 109 ms
55,924 KB
testcase_08 AC 107 ms
56,088 KB
testcase_09 AC 113 ms
55,536 KB
testcase_10 AC 109 ms
55,844 KB
testcase_11 AC 107 ms
55,620 KB
testcase_12 AC 108 ms
55,540 KB
testcase_13 AC 110 ms
55,964 KB
testcase_14 AC 111 ms
55,756 KB
testcase_15 AC 115 ms
55,412 KB
testcase_16 AC 108 ms
55,708 KB
testcase_17 AC 111 ms
55,620 KB
testcase_18 AC 113 ms
56,092 KB
testcase_19 AC 110 ms
55,756 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class No_104 {
	public static void main(String args[]) {
		Scanner stdIn = new Scanner(System.in);		

		String road = stdIn.next();
		String[] lr = road.split("");

		int N = 1;
		for (int i = 0; i < lr.length; i++) {
			if ( lr[i].equals("L")) {
				N *= 2;	
			} else {
				N = (N * 2) + 1;
			}
		}
		System.out.println(N);
	}
}
0