結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
57,348 KB
testcase_01 AC 124 ms
57,296 KB
testcase_02 AC 126 ms
57,400 KB
testcase_03 RE -
testcase_04 AC 121 ms
57,400 KB
testcase_05 AC 121 ms
57,056 KB
testcase_06 AC 125 ms
57,356 KB
testcase_07 AC 126 ms
57,208 KB
testcase_08 AC 124 ms
57,492 KB
testcase_09 AC 123 ms
57,324 KB
testcase_10 AC 123 ms
55,456 KB
testcase_11 AC 125 ms
57,468 KB
testcase_12 AC 125 ms
57,248 KB
testcase_13 AC 124 ms
57,452 KB
testcase_14 AC 125 ms
57,352 KB
testcase_15 AC 121 ms
57,292 KB
testcase_16 AC 125 ms
57,376 KB
testcase_17 AC 123 ms
57,324 KB
testcase_18 AC 123 ms
57,044 KB
testcase_19 AC 126 ms
57,304 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;
			}
			if(s[i] == 'R') {
				n = n + n + 1;
			}
		}

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