結果

問題 No.104 国道
ユーザー abcabc
提出日時 2016-11-04 11:48:23
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 410 bytes
コンパイル時間 1,812 ms
コンパイル使用メモリ 74,176 KB
実行使用メモリ 41,636 KB
最終ジャッジ日時 2024-05-03 21:46:41
合計ジャッジ時間 5,254 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 110 ms
40,960 KB
testcase_01 AC 118 ms
41,636 KB
testcase_02 AC 117 ms
41,276 KB
testcase_03 RE -
testcase_04 AC 105 ms
40,984 KB
testcase_05 AC 113 ms
41,028 KB
testcase_06 AC 112 ms
41,336 KB
testcase_07 AC 114 ms
40,940 KB
testcase_08 AC 98 ms
40,284 KB
testcase_09 AC 108 ms
41,268 KB
testcase_10 AC 108 ms
41,252 KB
testcase_11 AC 99 ms
40,012 KB
testcase_12 AC 109 ms
41,160 KB
testcase_13 AC 106 ms
40,232 KB
testcase_14 AC 108 ms
40,960 KB
testcase_15 AC 107 ms
40,520 KB
testcase_16 AC 100 ms
40,000 KB
testcase_17 AC 99 ms
40,236 KB
testcase_18 AC 101 ms
40,860 KB
testcase_19 AC 101 ms
40,616 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