結果

問題 No.104 国道
ユーザー kou6839kou6839
提出日時 2014-12-20 12:56:56
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 360 bytes
コンパイル時間 1,773 ms
コンパイル使用メモリ 74,852 KB
実行使用メモリ 56,040 KB
最終ジャッジ日時 2024-06-12 02:22:21
合計ジャッジ時間 4,794 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 114 ms
40,936 KB
testcase_01 AC 112 ms
41,052 KB
testcase_02 AC 112 ms
41,144 KB
testcase_03 RE -
testcase_04 AC 114 ms
41,212 KB
testcase_05 AC 108 ms
41,368 KB
testcase_06 AC 101 ms
41,188 KB
testcase_07 AC 115 ms
41,044 KB
testcase_08 AC 117 ms
41,528 KB
testcase_09 AC 113 ms
41,408 KB
testcase_10 AC 123 ms
41,764 KB
testcase_11 AC 113 ms
41,240 KB
testcase_12 AC 102 ms
41,420 KB
testcase_13 AC 114 ms
41,376 KB
testcase_14 AC 113 ms
41,216 KB
testcase_15 AC 113 ms
41,232 KB
testcase_16 AC 115 ms
41,112 KB
testcase_17 AC 98 ms
40,988 KB
testcase_18 AC 115 ms
41,260 KB
testcase_19 AC 99 ms
41,512 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.math.*;
import java.util.*;

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