結果

問題 No.104 国道
ユーザー ほげ太郎ほげ太郎
提出日時 2018-02-23 09:36:07
言語 Java21
(openjdk 21)
結果
AC  
実行時間 132 ms / 5,000 ms
コード長 375 bytes
コンパイル時間 2,097 ms
コンパイル使用メモリ 74,132 KB
実行使用メモリ 41,576 KB
最終ジャッジ日時 2024-04-16 01:57:20
合計ジャッジ時間 5,548 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
41,512 KB
testcase_01 AC 130 ms
41,380 KB
testcase_02 AC 132 ms
41,404 KB
testcase_03 AC 130 ms
41,576 KB
testcase_04 AC 128 ms
41,152 KB
testcase_05 AC 129 ms
41,308 KB
testcase_06 AC 127 ms
41,500 KB
testcase_07 AC 127 ms
41,356 KB
testcase_08 AC 132 ms
41,284 KB
testcase_09 AC 129 ms
41,416 KB
testcase_10 AC 131 ms
41,452 KB
testcase_11 AC 129 ms
41,276 KB
testcase_12 AC 127 ms
41,372 KB
testcase_13 AC 129 ms
41,432 KB
testcase_14 AC 128 ms
41,196 KB
testcase_15 AC 129 ms
41,424 KB
testcase_16 AC 128 ms
41,352 KB
testcase_17 AC 130 ms
41,420 KB
testcase_18 AC 131 ms
41,308 KB
testcase_19 AC 132 ms
41,156 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String iStr = sc.nextLine();

        long route = 1;
        for (int i = 0; i < iStr.length(); i++) {
            route <<= 1;
            if (iStr.charAt(i) == 'R') route++;
        }
        System.out.println(route);
    }
}
0