結果

問題 No.104 国道
ユーザー SagTokiSagToki
提出日時 2018-05-16 14:44:11
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 753 bytes
コンパイル時間 3,348 ms
コンパイル使用メモリ 74,680 KB
実行使用メモリ 41,416 KB
最終ジャッジ日時 2024-06-28 13:19:27
合計ジャッジ時間 6,659 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
41,044 KB
testcase_01 AC 122 ms
41,100 KB
testcase_02 AC 111 ms
39,856 KB
testcase_03 RE -
testcase_04 AC 124 ms
41,392 KB
testcase_05 AC 127 ms
41,064 KB
testcase_06 AC 115 ms
40,020 KB
testcase_07 AC 110 ms
40,356 KB
testcase_08 AC 124 ms
40,992 KB
testcase_09 AC 126 ms
41,316 KB
testcase_10 AC 113 ms
40,316 KB
testcase_11 AC 125 ms
41,320 KB
testcase_12 AC 128 ms
40,984 KB
testcase_13 AC 125 ms
40,996 KB
testcase_14 AC 128 ms
41,200 KB
testcase_15 AC 126 ms
41,092 KB
testcase_16 AC 123 ms
41,092 KB
testcase_17 AC 124 ms
41,416 KB
testcase_18 AC 126 ms
41,088 KB
testcase_19 AC 122 ms
41,260 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