結果

問題 No.104 国道
ユーザー kou6839kou6839
提出日時 2014-12-20 12:56:56
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 360 bytes
コンパイル時間 2,000 ms
コンパイル使用メモリ 71,564 KB
実行使用メモリ 56,220 KB
最終ジャッジ日時 2023-09-02 20:00:28
合計ジャッジ時間 5,574 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
55,904 KB
testcase_01 AC 117 ms
54,340 KB
testcase_02 AC 118 ms
56,020 KB
testcase_03 RE -
testcase_04 AC 117 ms
55,932 KB
testcase_05 AC 116 ms
56,192 KB
testcase_06 AC 118 ms
55,904 KB
testcase_07 AC 116 ms
55,668 KB
testcase_08 AC 116 ms
55,992 KB
testcase_09 AC 117 ms
56,044 KB
testcase_10 AC 120 ms
55,756 KB
testcase_11 AC 118 ms
55,648 KB
testcase_12 AC 117 ms
55,788 KB
testcase_13 AC 118 ms
55,664 KB
testcase_14 AC 116 ms
55,668 KB
testcase_15 AC 119 ms
55,868 KB
testcase_16 AC 117 ms
55,680 KB
testcase_17 AC 118 ms
55,988 KB
testcase_18 AC 118 ms
56,096 KB
testcase_19 AC 116 ms
56,220 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