結果

問題 No.104 国道
ユーザー YatsukuYatsuku
提出日時 2015-12-12 04:49:00
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 359 bytes
コンパイル時間 1,734 ms
コンパイル使用メモリ 71,756 KB
実行使用メモリ 56,576 KB
最終ジャッジ日時 2023-10-13 11:38:31
合計ジャッジ時間 4,963 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 107 ms
55,712 KB
testcase_01 AC 107 ms
56,104 KB
testcase_02 AC 105 ms
55,884 KB
testcase_03 RE -
testcase_04 AC 110 ms
55,980 KB
testcase_05 AC 110 ms
56,264 KB
testcase_06 AC 112 ms
55,696 KB
testcase_07 AC 113 ms
55,944 KB
testcase_08 AC 114 ms
56,352 KB
testcase_09 AC 109 ms
55,908 KB
testcase_10 AC 110 ms
55,844 KB
testcase_11 AC 108 ms
55,972 KB
testcase_12 AC 109 ms
55,776 KB
testcase_13 AC 111 ms
55,436 KB
testcase_14 AC 109 ms
55,568 KB
testcase_15 AC 107 ms
55,904 KB
testcase_16 AC 107 ms
56,028 KB
testcase_17 AC 115 ms
55,764 KB
testcase_18 AC 112 ms
56,124 KB
testcase_19 AC 117 ms
56,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class No_104 {
	public static void main(String args[]) {
		Scanner stdIn = new Scanner(System.in);		

		String road = stdIn.next();
		String[] lr = road.split("");

		int N = 1;
		for (int i = 0; i < lr.length; i++) {
			if ( lr[i].equals("L")) {
				N *= 2;	
			} else {
				N = (N * 2) + 1;
			}
		}
		System.out.println(N);
	}
}
0