結果

問題 No.104 国道
ユーザー YukimotoPGYukimotoPG
提出日時 2019-02-14 22:05:27
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 353 bytes
コンパイル時間 1,962 ms
コンパイル使用メモリ 71,416 KB
実行使用メモリ 55,956 KB
最終ジャッジ日時 2023-10-11 12:45:51
合計ジャッジ時間 5,231 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
55,256 KB
testcase_01 AC 117 ms
55,432 KB
testcase_02 AC 117 ms
55,904 KB
testcase_03 RE -
testcase_04 AC 116 ms
55,872 KB
testcase_05 AC 115 ms
55,468 KB
testcase_06 AC 115 ms
55,200 KB
testcase_07 AC 116 ms
55,720 KB
testcase_08 AC 116 ms
55,956 KB
testcase_09 AC 116 ms
55,720 KB
testcase_10 AC 116 ms
55,696 KB
testcase_11 AC 115 ms
55,808 KB
testcase_12 AC 115 ms
55,868 KB
testcase_13 AC 115 ms
55,568 KB
testcase_14 AC 115 ms
55,472 KB
testcase_15 AC 119 ms
55,820 KB
testcase_16 AC 114 ms
55,792 KB
testcase_17 AC 115 ms
55,828 KB
testcase_18 AC 115 ms
55,880 KB
testcase_19 AC 116 ms
55,496 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		
		String s = sc.next();
		if (s.equals("")) {
			System.out.println(1);
			return;
		}
		int n = 1;
		for (int i=0; i<s.length(); i++) {
			if (s.charAt(i) == 'L') n *= 2;
			else n = n*2 + 1;
		}
		System.out.println(n);
		
	}
}
0