結果

問題 No.104 国道
ユーザー YukimotoPGYukimotoPG
提出日時 2019-02-14 22:04:22
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 290 bytes
コンパイル時間 2,562 ms
コンパイル使用メモリ 71,560 KB
実行使用メモリ 57,616 KB
最終ジャッジ日時 2023-10-11 12:45:46
合計ジャッジ時間 6,309 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
55,752 KB
testcase_01 AC 116 ms
55,420 KB
testcase_02 AC 115 ms
54,108 KB
testcase_03 RE -
testcase_04 AC 116 ms
56,036 KB
testcase_05 AC 116 ms
55,836 KB
testcase_06 AC 115 ms
55,584 KB
testcase_07 AC 114 ms
57,616 KB
testcase_08 AC 114 ms
55,676 KB
testcase_09 AC 115 ms
55,912 KB
testcase_10 AC 114 ms
56,008 KB
testcase_11 AC 116 ms
55,908 KB
testcase_12 AC 114 ms
55,648 KB
testcase_13 AC 113 ms
55,856 KB
testcase_14 AC 112 ms
55,556 KB
testcase_15 AC 116 ms
55,404 KB
testcase_16 AC 114 ms
55,772 KB
testcase_17 AC 117 ms
55,584 KB
testcase_18 AC 120 ms
55,652 KB
testcase_19 AC 117 ms
55,908 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		
		String s = sc.next();
		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