結果

問題 No.104 国道
ユーザー YukimotoPGYukimotoPG
提出日時 2019-02-14 22:09:07
言語 Java21
(openjdk 21)
結果
AC  
実行時間 121 ms / 5,000 ms
コード長 294 bytes
コンパイル時間 2,025 ms
コンパイル使用メモリ 71,792 KB
実行使用メモリ 56,428 KB
最終ジャッジ日時 2023-10-11 12:46:00
合計ジャッジ時間 5,255 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
55,752 KB
testcase_01 AC 120 ms
55,672 KB
testcase_02 AC 116 ms
55,748 KB
testcase_03 AC 119 ms
55,864 KB
testcase_04 AC 119 ms
55,612 KB
testcase_05 AC 118 ms
56,016 KB
testcase_06 AC 119 ms
56,296 KB
testcase_07 AC 121 ms
55,728 KB
testcase_08 AC 118 ms
55,724 KB
testcase_09 AC 118 ms
56,428 KB
testcase_10 AC 117 ms
55,776 KB
testcase_11 AC 117 ms
55,680 KB
testcase_12 AC 118 ms
53,576 KB
testcase_13 AC 118 ms
55,640 KB
testcase_14 AC 121 ms
56,084 KB
testcase_15 AC 118 ms
55,676 KB
testcase_16 AC 116 ms
54,244 KB
testcase_17 AC 117 ms
56,052 KB
testcase_18 AC 117 ms
55,676 KB
testcase_19 AC 116 ms
55,444 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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