結果

問題 No.104 国道
ユーザー ffmm00ffmm00
提出日時 2015-06-18 05:48:07
言語 Java21
(openjdk 21)
結果
AC  
実行時間 124 ms / 5,000 ms
コード長 406 bytes
コンパイル時間 5,691 ms
コンパイル使用メモリ 72,628 KB
実行使用メモリ 56,160 KB
最終ジャッジ日時 2023-09-21 09:25:15
合計ジャッジ時間 8,398 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
56,004 KB
testcase_01 AC 122 ms
56,060 KB
testcase_02 AC 123 ms
55,972 KB
testcase_03 AC 122 ms
55,436 KB
testcase_04 AC 122 ms
56,160 KB
testcase_05 AC 124 ms
55,932 KB
testcase_06 AC 123 ms
55,624 KB
testcase_07 AC 124 ms
55,468 KB
testcase_08 AC 122 ms
55,972 KB
testcase_09 AC 122 ms
56,032 KB
testcase_10 AC 121 ms
55,508 KB
testcase_11 AC 123 ms
56,056 KB
testcase_12 AC 124 ms
55,936 KB
testcase_13 AC 123 ms
55,928 KB
testcase_14 AC 123 ms
55,796 KB
testcase_15 AC 123 ms
55,948 KB
testcase_16 AC 122 ms
55,824 KB
testcase_17 AC 121 ms
55,956 KB
testcase_18 AC 121 ms
55,756 KB
testcase_19 AC 121 ms
56,104 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class N104 {

	public static void main(String[] args) {

		Scanner sca = new Scanner(System.in);

		String S = sca.nextLine();
		int A = 1;

		if (S.equals("")) {
			System.out.println(1);
			return;
		}

		char[] b = S.toCharArray();

		for (int i = 0; i < b.length; i++) {
			if (b[i] == 'L')
				A = A * 2;
			else
				A = A * 2 + 1;
		}

		System.out.println(A);

	}
}
0