結果

問題 No.104 国道
ユーザー koukonkokoukonko
提出日時 2015-12-11 17:56:43
言語 Java21
(openjdk 21)
結果
AC  
実行時間 44 ms / 5,000 ms
コード長 622 bytes
コンパイル時間 1,897 ms
コンパイル使用メモリ 71,928 KB
実行使用メモリ 49,524 KB
最終ジャッジ日時 2023-10-13 10:57:47
合計ジャッジ時間 3,764 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
49,356 KB
testcase_01 AC 44 ms
49,248 KB
testcase_02 AC 42 ms
49,428 KB
testcase_03 AC 42 ms
49,412 KB
testcase_04 AC 43 ms
49,120 KB
testcase_05 AC 43 ms
49,392 KB
testcase_06 AC 42 ms
49,152 KB
testcase_07 AC 43 ms
49,208 KB
testcase_08 AC 41 ms
49,456 KB
testcase_09 AC 42 ms
49,288 KB
testcase_10 AC 41 ms
49,452 KB
testcase_11 AC 42 ms
49,244 KB
testcase_12 AC 41 ms
49,412 KB
testcase_13 AC 43 ms
49,144 KB
testcase_14 AC 42 ms
49,364 KB
testcase_15 AC 42 ms
49,524 KB
testcase_16 AC 42 ms
49,296 KB
testcase_17 AC 42 ms
49,332 KB
testcase_18 AC 44 ms
49,140 KB
testcase_19 AC 43 ms
49,512 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) {
		BufferedReader buff = new BufferedReader(new InputStreamReader(System.in));

		try {
			String str = buff.readLine();

			int line = 1;

			for(int i = 0; i < str.length(); ++i){
				line *= 2;
				char ch = str.charAt(i);
				if(ch == 'R'){
					line++;
				}
			}

			System.out.println(line);

		} catch (NumberFormatException e) {
			e.getStackTrace();
		} catch (IOException e) {
			e.getStackTrace();
		} catch (Exception e) {
			e.getStackTrace();
		}
	}
}
0