結果

問題 No.104 国道
ユーザー tentententen
提出日時 2020-11-10 15:37:02
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 395 bytes
コンパイル時間 1,955 ms
コンパイル使用メモリ 71,732 KB
実行使用メモリ 58,356 KB
最終ジャッジ日時 2023-09-29 23:37:24
合計ジャッジ時間 5,516 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
55,624 KB
testcase_01 AC 114 ms
56,224 KB
testcase_02 AC 114 ms
55,912 KB
testcase_03 RE -
testcase_04 AC 114 ms
56,016 KB
testcase_05 AC 114 ms
55,640 KB
testcase_06 AC 115 ms
55,924 KB
testcase_07 AC 117 ms
55,848 KB
testcase_08 AC 116 ms
56,188 KB
testcase_09 AC 116 ms
55,676 KB
testcase_10 AC 114 ms
55,916 KB
testcase_11 AC 116 ms
55,992 KB
testcase_12 AC 115 ms
55,668 KB
testcase_13 AC 116 ms
56,580 KB
testcase_14 AC 115 ms
56,260 KB
testcase_15 AC 114 ms
55,740 KB
testcase_16 AC 114 ms
55,684 KB
testcase_17 AC 114 ms
55,620 KB
testcase_18 AC 115 ms
56,208 KB
testcase_19 AC 114 ms
55,636 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int current = 1;
        for (char c : sc.next().toCharArray()) {
            if (c == 'L') {
                current *= 2;
            } else {
                current = current * 2 + 1;
            }
        }
        System.out.println(current);
    }
}
0