結果

問題 No.104 国道
ユーザー SuunnSuunn
提出日時 2018-11-20 06:13:21
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 339 bytes
コンパイル時間 1,863 ms
コンパイル使用メモリ 72,108 KB
実行使用メモリ 56,460 KB
最終ジャッジ日時 2023-08-26 02:12:06
合計ジャッジ時間 5,710 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 114 ms
55,864 KB
testcase_01 AC 115 ms
56,020 KB
testcase_02 AC 115 ms
56,176 KB
testcase_03 RE -
testcase_04 AC 114 ms
55,908 KB
testcase_05 AC 115 ms
55,916 KB
testcase_06 AC 114 ms
55,924 KB
testcase_07 AC 116 ms
55,456 KB
testcase_08 AC 117 ms
55,600 KB
testcase_09 AC 118 ms
55,792 KB
testcase_10 AC 117 ms
56,208 KB
testcase_11 AC 117 ms
55,660 KB
testcase_12 AC 115 ms
55,868 KB
testcase_13 AC 115 ms
55,988 KB
testcase_14 AC 116 ms
55,916 KB
testcase_15 AC 117 ms
55,756 KB
testcase_16 AC 119 ms
55,560 KB
testcase_17 AC 119 ms
55,872 KB
testcase_18 AC 118 ms
55,992 KB
testcase_19 AC 116 ms
55,924 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
	

public class Main{
	
	
	public static void main(String args[])throws Exception{
		
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		int pla = 1;
		for(int i=0;i<S.length();i++){
			if(S.charAt(i)=='L'){
				pla *= 2;
			}else{
				pla = pla * 2 + 1;
			}
		}
		System.out.println(pla);
		
	}
}
0