結果

問題 No.104 国道
ユーザー eagleeagle
提出日時 2022-06-15 14:18:19
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 423 bytes
コンパイル時間 2,138 ms
コンパイル使用メモリ 74,276 KB
実行使用メモリ 54,328 KB
最終ジャッジ日時 2024-04-14 22:45:22
合計ジャッジ時間 5,725 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
53,860 KB
testcase_01 AC 126 ms
54,048 KB
testcase_02 AC 126 ms
54,188 KB
testcase_03 RE -
testcase_04 AC 126 ms
54,216 KB
testcase_05 AC 126 ms
54,296 KB
testcase_06 AC 129 ms
54,228 KB
testcase_07 AC 127 ms
53,816 KB
testcase_08 AC 127 ms
54,016 KB
testcase_09 AC 126 ms
54,148 KB
testcase_10 AC 128 ms
54,188 KB
testcase_11 AC 127 ms
53,976 KB
testcase_12 AC 129 ms
53,884 KB
testcase_13 AC 126 ms
53,896 KB
testcase_14 AC 129 ms
54,128 KB
testcase_15 AC 128 ms
54,140 KB
testcase_16 AC 127 ms
54,328 KB
testcase_17 AC 127 ms
54,212 KB
testcase_18 AC 127 ms
53,840 KB
testcase_19 AC 127 ms
53,848 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		//分岐の方向
		String S = sc.next();
		long rute = 1;
		for(int i = 0; i < S.length(); i++) {
			char c = S.charAt(i);
			if(c == 'L') {
				rute = rute * 2;
			} else {
				rute = rute * 2 + 1;
			}
		}
		System.out.println(rute);
	}
}
0