結果

問題 No.104 国道
ユーザー yagi2yagi2
提出日時 2017-04-25 12:08:19
言語 Java21
(openjdk 21)
結果
AC  
実行時間 123 ms / 5,000 ms
コード長 361 bytes
コンパイル時間 1,834 ms
コンパイル使用メモリ 72,384 KB
実行使用メモリ 56,856 KB
最終ジャッジ日時 2023-10-11 09:29:48
合計ジャッジ時間 5,181 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
55,984 KB
testcase_01 AC 113 ms
55,696 KB
testcase_02 AC 108 ms
56,192 KB
testcase_03 AC 108 ms
56,220 KB
testcase_04 AC 117 ms
55,696 KB
testcase_05 AC 116 ms
55,908 KB
testcase_06 AC 116 ms
56,012 KB
testcase_07 AC 114 ms
56,268 KB
testcase_08 AC 114 ms
56,284 KB
testcase_09 AC 114 ms
56,120 KB
testcase_10 AC 112 ms
56,856 KB
testcase_11 AC 112 ms
55,964 KB
testcase_12 AC 108 ms
56,196 KB
testcase_13 AC 108 ms
56,220 KB
testcase_14 AC 108 ms
55,924 KB
testcase_15 AC 108 ms
56,100 KB
testcase_16 AC 108 ms
56,164 KB
testcase_17 AC 108 ms
56,300 KB
testcase_18 AC 108 ms
55,592 KB
testcase_19 AC 106 ms
56,344 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

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

        int N = 1;;
        for(String s : S) {
            if ("R".equals(s)) N += N+1;
            if ("L".equals(s)) N += N;
        }
        System.out.println(N);
    }
}
0