結果

問題 No.104 国道
ユーザー dazydazy
提出日時 2016-09-11 03:42:20
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 371 bytes
コンパイル時間 3,001 ms
コンパイル使用メモリ 74,924 KB
実行使用メモリ 41,364 KB
最終ジャッジ日時 2024-04-28 10:14:02
合計ジャッジ時間 6,379 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
41,100 KB
testcase_01 AC 92 ms
39,332 KB
testcase_02 AC 103 ms
39,936 KB
testcase_03 RE -
testcase_04 AC 111 ms
41,132 KB
testcase_05 AC 96 ms
39,744 KB
testcase_06 AC 104 ms
40,392 KB
testcase_07 AC 95 ms
39,424 KB
testcase_08 AC 110 ms
41,012 KB
testcase_09 AC 104 ms
41,336 KB
testcase_10 AC 107 ms
41,128 KB
testcase_11 AC 109 ms
40,780 KB
testcase_12 AC 117 ms
40,960 KB
testcase_13 AC 99 ms
40,156 KB
testcase_14 AC 110 ms
40,972 KB
testcase_15 AC 107 ms
40,140 KB
testcase_16 AC 110 ms
40,588 KB
testcase_17 AC 102 ms
39,904 KB
testcase_18 AC 102 ms
40,212 KB
testcase_19 AC 107 ms
41,076 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Run {
    public static void main (String arg[]) {
        Scanner scan = new Scanner(System.in);
        String S = scan.next();
        long Road = 1;
        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i)=='L') Road = Road*2;
            else Road = Road*2 + 1;
        }
        System.out.println(Road);
    }
}
0