結果

問題 No.104 国道
ユーザー matsuyoshi30matsuyoshi30
提出日時 2016-02-05 19:46:39
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 347 bytes
コンパイル時間 2,117 ms
コンパイル使用メモリ 74,292 KB
実行使用メモリ 57,936 KB
最終ジャッジ日時 2023-10-21 19:17:44
合計ジャッジ時間 5,713 ms
ジャッジサーバーID
(参考情報)
judge12 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
57,308 KB
testcase_01 AC 128 ms
57,696 KB
testcase_02 AC 129 ms
57,380 KB
testcase_03 RE -
testcase_04 AC 133 ms
57,396 KB
testcase_05 AC 129 ms
57,348 KB
testcase_06 AC 128 ms
57,388 KB
testcase_07 AC 127 ms
57,404 KB
testcase_08 AC 129 ms
57,484 KB
testcase_09 AC 131 ms
57,452 KB
testcase_10 AC 129 ms
57,396 KB
testcase_11 AC 129 ms
57,484 KB
testcase_12 AC 126 ms
57,424 KB
testcase_13 AC 126 ms
57,360 KB
testcase_14 AC 128 ms
57,356 KB
testcase_15 AC 128 ms
57,508 KB
testcase_16 AC 133 ms
57,452 KB
testcase_17 AC 129 ms
57,436 KB
testcase_18 AC 129 ms
57,352 KB
testcase_19 AC 127 ms
57,488 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Test {
	public static void main(String[] args) throws Exception {
		Scanner in = new Scanner(System.in);

		char[] s = in.next().toCharArray();
		int n = 1;
		for(int i=0; i<s.length; i++) {
			if(s[i] == 'L') {
				n = n * 2;
			} else if(s[i] == 'R') {
				n = n * 2 + 1;
			}
		}

		System.out.println(n);
	}
}
0