結果

問題 No.104 国道
ユーザー ぴろずぴろず
提出日時 2014-12-16 23:22:44
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 371 bytes
コンパイル時間 2,479 ms
コンパイル使用メモリ 71,728 KB
実行使用メモリ 56,064 KB
最終ジャッジ日時 2023-09-02 15:23:03
合計ジャッジ時間 5,877 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
55,516 KB
testcase_01 AC 119 ms
55,560 KB
testcase_02 AC 118 ms
55,504 KB
testcase_03 RE -
testcase_04 AC 120 ms
55,476 KB
testcase_05 AC 119 ms
55,636 KB
testcase_06 AC 120 ms
55,668 KB
testcase_07 AC 119 ms
55,520 KB
testcase_08 AC 120 ms
55,596 KB
testcase_09 AC 119 ms
55,516 KB
testcase_10 AC 120 ms
55,588 KB
testcase_11 AC 120 ms
55,500 KB
testcase_12 AC 119 ms
55,508 KB
testcase_13 AC 119 ms
55,560 KB
testcase_14 AC 120 ms
55,600 KB
testcase_15 AC 120 ms
55,516 KB
testcase_16 AC 121 ms
55,632 KB
testcase_17 AC 120 ms
55,740 KB
testcase_18 AC 121 ms
55,316 KB
testcase_19 AC 122 ms
55,292 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package no104;

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] s = sc.next().toCharArray();
		int n = s.length;
		long x = 1;
		for(int i=0;i<n;i++) {
			if (s[i] == 'L') {
				x = x * 2;
			}else {
				x = x * 2 + 1;
			}
		}
		System.out.println(x);
	}

}
0