結果

問題 No.104 国道
ユーザー spaciaspacia
提出日時 2015-12-29 22:39:27
言語 Java19
(openjdk 21)
結果
AC  
実行時間 61 ms / 5,000 ms
コード長 532 bytes
コンパイル時間 2,704 ms
コンパイル使用メモリ 75,560 KB
実行使用メモリ 53,520 KB
最終ジャッジ日時 2023-10-19 12:27:07
合計ジャッジ時間 4,368 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 54 ms
51,468 KB
testcase_01 AC 56 ms
52,380 KB
testcase_02 AC 52 ms
53,520 KB
testcase_03 AC 57 ms
52,432 KB
testcase_04 AC 57 ms
52,364 KB
testcase_05 AC 52 ms
53,516 KB
testcase_06 AC 59 ms
53,504 KB
testcase_07 AC 53 ms
52,380 KB
testcase_08 AC 59 ms
53,504 KB
testcase_09 AC 54 ms
53,508 KB
testcase_10 AC 53 ms
52,416 KB
testcase_11 AC 55 ms
52,360 KB
testcase_12 AC 52 ms
53,516 KB
testcase_13 AC 52 ms
53,508 KB
testcase_14 AC 50 ms
53,504 KB
testcase_15 AC 61 ms
53,504 KB
testcase_16 AC 52 ms
53,504 KB
testcase_17 AC 52 ms
53,520 KB
testcase_18 AC 51 ms
53,508 KB
testcase_19 AC 54 ms
53,504 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;
import java.math.*;

class Main104 {
	
	public static void out (Object out) {
		System.out.println(out);
	}
	
	public static void main (String[] args) throws IOException {
		BufferedReader br = 
			new BufferedReader(new InputStreamReader(System.in));
		
		int ans = 0;
		String s = br.readLine();
		
		for (int i = 0; i < s.length(); i++) {
			char c = s.charAt(i);
			if (c == 'R') {
				ans += (int)Math.pow(2, s.length() - i - 1);
			}
		}
		
		out(ans + (int)Math.pow(2, s.length()));
	}
}
0