結果

問題 No.104 国道
ユーザー yagi2yagi2
提出日時 2017-04-25 12:07:27
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 357 bytes
コンパイル時間 1,936 ms
コンパイル使用メモリ 71,596 KB
実行使用メモリ 56,572 KB
最終ジャッジ日時 2023-10-11 09:29:03
合計ジャッジ時間 5,488 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
56,068 KB
testcase_01 AC 117 ms
54,180 KB
testcase_02 AC 116 ms
55,748 KB
testcase_03 RE -
testcase_04 AC 117 ms
55,956 KB
testcase_05 AC 116 ms
55,476 KB
testcase_06 AC 113 ms
55,948 KB
testcase_07 AC 115 ms
56,196 KB
testcase_08 AC 113 ms
56,128 KB
testcase_09 AC 115 ms
55,632 KB
testcase_10 AC 115 ms
56,132 KB
testcase_11 AC 116 ms
56,092 KB
testcase_12 AC 114 ms
56,096 KB
testcase_13 AC 115 ms
56,220 KB
testcase_14 AC 114 ms
56,348 KB
testcase_15 AC 116 ms
55,916 KB
testcase_16 AC 114 ms
56,232 KB
testcase_17 AC 113 ms
55,896 KB
testcase_18 AC 116 ms
55,888 KB
testcase_19 AC 117 ms
55,848 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] S = sc.next().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