結果
| 問題 | 
                            No.104 国道
                             | 
                    
| コンテスト | |
| ユーザー | 
                             mits58
                         | 
                    
| 提出日時 | 2016-07-02 13:48:52 | 
| 言語 | Java  (openjdk 23)  | 
                    
| 結果 | 
                             
                                RE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 310 bytes | 
| コンパイル時間 | 2,054 ms | 
| コンパイル使用メモリ | 73,768 KB | 
| 実行使用メモリ | 41,424 KB | 
| 最終ジャッジ日時 | 2024-10-12 00:43:13 | 
| 合計ジャッジ時間 | 5,550 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 RE * 1 | 
| other | AC * 16 | 
ソースコード
import java.util.Scanner;
public class Main{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		long ans=1;
		String str=sc.next();
		for(int i=0;i<str.length();i++){
			if(str.charAt(i)=='L') ans*=2;
			else if(str.charAt(i)=='R') ans=2*ans+1;
		}
		System.out.println(ans);
	}
}
            
            
            
        
            
mits58