結果

問題 No.104 国道
ユーザー abcabc
提出日時 2016-11-04 11:47:28
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 410 bytes
コンパイル時間 2,173 ms
コンパイル使用メモリ 74,936 KB
実行使用メモリ 53,976 KB
最終ジャッジ日時 2024-05-03 21:46:06
合計ジャッジ時間 5,733 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
41,256 KB
testcase_01 AC 123 ms
40,788 KB
testcase_02 AC 127 ms
40,872 KB
testcase_03 RE -
testcase_04 AC 127 ms
40,964 KB
testcase_05 AC 126 ms
41,132 KB
testcase_06 AC 126 ms
40,924 KB
testcase_07 AC 126 ms
41,184 KB
testcase_08 AC 110 ms
39,752 KB
testcase_09 AC 122 ms
41,004 KB
testcase_10 AC 124 ms
41,404 KB
testcase_11 AC 112 ms
39,872 KB
testcase_12 AC 124 ms
41,184 KB
testcase_13 AC 122 ms
41,216 KB
testcase_14 AC 124 ms
41,096 KB
testcase_15 AC 128 ms
41,160 KB
testcase_16 AC 124 ms
40,888 KB
testcase_17 AC 125 ms
41,020 KB
testcase_18 AC 124 ms
41,052 KB
testcase_19 AC 121 ms
41,036 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        String route = sc.next();

        int road = 1;

        for (int i = 0; i < route.length(); i++) {

            road *= 2;

            if (route.charAt(i) == 'R') {
                road++;
            }

        }

        System.out.println(road);

    }

}
0