結果

問題 No.104 国道
ユーザー kano_townkano_town
提出日時 2014-12-20 18:55:53
言語 Java21
(openjdk 21)
結果
AC  
実行時間 43 ms / 5,000 ms
コード長 347 bytes
コンパイル時間 4,422 ms
コンパイル使用メモリ 71,672 KB
実行使用メモリ 49,740 KB
最終ジャッジ日時 2023-09-02 20:08:49
合計ジャッジ時間 4,816 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
49,300 KB
testcase_01 AC 43 ms
49,240 KB
testcase_02 AC 43 ms
49,124 KB
testcase_03 AC 42 ms
49,248 KB
testcase_04 AC 43 ms
49,440 KB
testcase_05 AC 43 ms
49,580 KB
testcase_06 AC 43 ms
49,272 KB
testcase_07 AC 42 ms
49,308 KB
testcase_08 AC 43 ms
49,176 KB
testcase_09 AC 43 ms
49,272 KB
testcase_10 AC 43 ms
49,160 KB
testcase_11 AC 43 ms
49,256 KB
testcase_12 AC 42 ms
49,256 KB
testcase_13 AC 42 ms
47,412 KB
testcase_14 AC 42 ms
49,740 KB
testcase_15 AC 42 ms
49,240 KB
testcase_16 AC 42 ms
49,676 KB
testcase_17 AC 42 ms
49,560 KB
testcase_18 AC 42 ms
49,216 KB
testcase_19 AC 43 ms
49,392 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;

public class Yukicoder104 {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String s = br.readLine();
		int res = 1;
		for (int i = 0; i < s.length(); i++) res = s.charAt(i) == 'L' ? res * 2 : res * 2 + 1;
		System.out.println(res);
	}
}
0