結果

問題 No.104 国道
ユーザー Suunn
提出日時 2018-11-20 06:16:53
言語 Java
(openjdk 23)
結果
AC  
実行時間 142 ms / 5,000 ms
コード長 396 bytes
コンパイル時間 2,229 ms
コンパイル使用メモリ 74,720 KB
実行使用メモリ 41,412 KB
最終ジャッジ日時 2024-12-24 15:24:25
合計ジャッジ時間 5,784 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

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