結果

問題 No.104 国道
ユーザー SuunnSuunn
提出日時 2018-11-20 06:16:53
言語 Java21
(openjdk 21)
結果
AC  
実行時間 106 ms / 5,000 ms
コード長 396 bytes
コンパイル時間 1,705 ms
コンパイル使用メモリ 71,528 KB
実行使用メモリ 55,940 KB
最終ジャッジ日時 2023-08-26 02:12:13
合計ジャッジ時間 5,093 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 100 ms
55,436 KB
testcase_01 AC 101 ms
55,440 KB
testcase_02 AC 106 ms
55,420 KB
testcase_03 AC 103 ms
55,724 KB
testcase_04 AC 99 ms
55,280 KB
testcase_05 AC 103 ms
55,540 KB
testcase_06 AC 99 ms
55,188 KB
testcase_07 AC 101 ms
55,468 KB
testcase_08 AC 100 ms
55,492 KB
testcase_09 AC 102 ms
55,440 KB
testcase_10 AC 104 ms
55,588 KB
testcase_11 AC 100 ms
55,560 KB
testcase_12 AC 101 ms
55,536 KB
testcase_13 AC 100 ms
55,428 KB
testcase_14 AC 98 ms
55,832 KB
testcase_15 AC 97 ms
55,844 KB
testcase_16 AC 100 ms
55,424 KB
testcase_17 AC 99 ms
53,428 KB
testcase_18 AC 104 ms
55,940 KB
testcase_19 AC 98 ms
55,536 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
	

public class Main{
	
	
	public static void main(String args[])throws Exception{
		try{
		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);
		}catch(Exception e){
			System.out.println(1);
		}
	}
	

}
0