結果

問題 No.104 国道
ユーザー matsuyoshi30matsuyoshi30
提出日時 2016-02-05 19:58:10
言語 Java21
(openjdk 21)
結果
AC  
実行時間 134 ms / 5,000 ms
コード長 344 bytes
コンパイル時間 2,108 ms
コンパイル使用メモリ 78,892 KB
実行使用メモリ 57,596 KB
最終ジャッジ日時 2023-10-21 19:18:40
合計ジャッジ時間 5,662 ms
ジャッジサーバーID
(参考情報)
judge12 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
57,596 KB
testcase_01 AC 129 ms
57,436 KB
testcase_02 AC 131 ms
57,324 KB
testcase_03 AC 131 ms
57,472 KB
testcase_04 AC 129 ms
57,368 KB
testcase_05 AC 130 ms
57,436 KB
testcase_06 AC 129 ms
57,368 KB
testcase_07 AC 130 ms
57,388 KB
testcase_08 AC 130 ms
57,476 KB
testcase_09 AC 132 ms
55,484 KB
testcase_10 AC 134 ms
57,340 KB
testcase_11 AC 131 ms
55,036 KB
testcase_12 AC 131 ms
57,404 KB
testcase_13 AC 130 ms
57,244 KB
testcase_14 AC 129 ms
57,516 KB
testcase_15 AC 130 ms
57,428 KB
testcase_16 AC 132 ms
57,372 KB
testcase_17 AC 133 ms
57,380 KB
testcase_18 AC 129 ms
57,424 KB
testcase_19 AC 129 ms
57,384 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.nextLine().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