結果

問題 No.104 国道
ユーザー Tsukasa_TypeTsukasa_Type
提出日時 2018-02-09 20:18:58
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 367 bytes
コンパイル時間 1,925 ms
コンパイル使用メモリ 75,212 KB
実行使用メモリ 54,228 KB
最終ジャッジ日時 2024-04-16 23:16:30
合計ジャッジ時間 5,390 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
41,176 KB
testcase_01 AC 117 ms
41,280 KB
testcase_02 AC 125 ms
41,228 KB
testcase_03 RE -
testcase_04 AC 115 ms
41,528 KB
testcase_05 AC 115 ms
41,456 KB
testcase_06 AC 110 ms
41,240 KB
testcase_07 AC 111 ms
41,404 KB
testcase_08 AC 111 ms
41,424 KB
testcase_09 AC 117 ms
41,092 KB
testcase_10 AC 100 ms
41,280 KB
testcase_11 AC 99 ms
41,416 KB
testcase_12 AC 107 ms
41,520 KB
testcase_13 AC 133 ms
41,616 KB
testcase_14 AC 118 ms
41,340 KB
testcase_15 AC 105 ms
41,420 KB
testcase_16 AC 114 ms
41,440 KB
testcase_17 AC 121 ms
41,320 KB
testcase_18 AC 114 ms
41,180 KB
testcase_19 AC 103 ms
41,448 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