結果

問題 No.104 国道
ユーザー k_kadorak_kadora
提出日時 2015-05-24 09:10:32
言語 Java21
(openjdk 21)
結果
AC  
実行時間 117 ms / 5,000 ms
コード長 354 bytes
コンパイル時間 3,242 ms
コンパイル使用メモリ 72,160 KB
実行使用メモリ 56,212 KB
最終ジャッジ日時 2023-09-20 11:11:34
合計ジャッジ時間 6,234 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 111 ms
55,820 KB
testcase_01 AC 114 ms
56,132 KB
testcase_02 AC 114 ms
56,140 KB
testcase_03 AC 115 ms
55,852 KB
testcase_04 AC 115 ms
56,132 KB
testcase_05 AC 112 ms
55,848 KB
testcase_06 AC 113 ms
55,732 KB
testcase_07 AC 113 ms
55,568 KB
testcase_08 AC 115 ms
55,892 KB
testcase_09 AC 112 ms
55,628 KB
testcase_10 AC 113 ms
56,212 KB
testcase_11 AC 113 ms
56,036 KB
testcase_12 AC 113 ms
55,936 KB
testcase_13 AC 114 ms
56,096 KB
testcase_14 AC 112 ms
55,844 KB
testcase_15 AC 113 ms
55,876 KB
testcase_16 AC 116 ms
55,684 KB
testcase_17 AC 112 ms
53,900 KB
testcase_18 AC 116 ms
56,076 KB
testcase_19 AC 117 ms
56,112 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class Road{
	public static void main(String[] arg){
		Scanner sc = new Scanner(System.in);
		int n=0,res=1;
		String in="";
		if(sc.hasNext()){
			in = sc.next();
			n = in.length();
		}
		for(int i = 0;i<n;i++){
			if(in.charAt(i) == 'R'){
				res = res*2+1;
			}else{
				res = res*2;
			}
		}
		System.out.println(res);
	}
}
0