結果

問題 No.104 国道
ユーザー SagTokiSagToki
提出日時 2018-05-16 14:44:11
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 753 bytes
コンパイル時間 3,816 ms
コンパイル使用メモリ 72,220 KB
実行使用メモリ 55,956 KB
最終ジャッジ日時 2023-09-10 22:20:20
合計ジャッジ時間 7,431 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
55,296 KB
testcase_01 AC 123 ms
55,508 KB
testcase_02 AC 121 ms
55,584 KB
testcase_03 RE -
testcase_04 AC 122 ms
55,452 KB
testcase_05 AC 123 ms
55,384 KB
testcase_06 AC 121 ms
55,660 KB
testcase_07 AC 122 ms
55,408 KB
testcase_08 AC 120 ms
55,536 KB
testcase_09 AC 122 ms
55,396 KB
testcase_10 AC 122 ms
53,760 KB
testcase_11 AC 124 ms
55,676 KB
testcase_12 AC 123 ms
55,636 KB
testcase_13 AC 123 ms
55,740 KB
testcase_14 AC 121 ms
55,244 KB
testcase_15 AC 122 ms
55,544 KB
testcase_16 AC 120 ms
55,804 KB
testcase_17 AC 121 ms
55,612 KB
testcase_18 AC 121 ms
55,956 KB
testcase_19 AC 121 ms
55,768 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.InputMismatchException;

public class NationalHighway {
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        String string = scanner.next();
        int Road = 1;
        char[] NewString = string.toCharArray();
         
        for(int i = 0 ; i < string.length() ; i++){
            //System.out.print("test");
            if(NewString[i] == 'R'){
                Road = Road * 2 + 1;
            }else if(NewString[i] == 'L'){
                Road = Road * 2 ;
            }else{
                //何もしない
            }
        }
        System.out.println(Road);
            
    }
}
0