結果

問題 No.104 国道
ユーザー Tsukasa_TypeTsukasa_Type
提出日時 2018-02-09 20:20:51
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 368 bytes
コンパイル時間 2,179 ms
コンパイル使用メモリ 73,848 KB
実行使用メモリ 41,396 KB
最終ジャッジ日時 2024-04-16 23:20:07
合計ジャッジ時間 5,671 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
41,024 KB
testcase_01 AC 125 ms
41,232 KB
testcase_02 AC 127 ms
41,288 KB
testcase_03 RE -
testcase_04 AC 130 ms
40,904 KB
testcase_05 AC 126 ms
41,156 KB
testcase_06 AC 127 ms
41,256 KB
testcase_07 AC 128 ms
40,992 KB
testcase_08 AC 127 ms
40,952 KB
testcase_09 AC 130 ms
41,032 KB
testcase_10 AC 129 ms
41,088 KB
testcase_11 AC 133 ms
40,932 KB
testcase_12 AC 127 ms
41,248 KB
testcase_13 AC 128 ms
41,264 KB
testcase_14 AC 125 ms
41,160 KB
testcase_15 AC 128 ms
41,136 KB
testcase_16 AC 128 ms
41,396 KB
testcase_17 AC 126 ms
41,016 KB
testcase_18 AC 144 ms
41,252 KB
testcase_19 AC 127 ms
40,968 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		String s = sc.next();
		if (s == null) {System.out.println(1);}
		else {
			long ans = 1;
			for (int i=0; i<s.length(); i++) {
				if (s.charAt(i)=='R') {ans = ans*2 + 1;}
				else {ans = ans*2;}
			}
			System.out.println(ans);
		}
	}
}
0