結果

問題 No.104 国道
ユーザー kanra661kanra661
提出日時 2014-12-17 00:38:13
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 428 bytes
コンパイル時間 3,811 ms
コンパイル使用メモリ 70,976 KB
実行使用メモリ 55,828 KB
最終ジャッジ日時 2023-09-02 15:42:06
合計ジャッジ時間 5,855 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
55,444 KB
testcase_01 AC 123 ms
55,544 KB
testcase_02 AC 123 ms
55,376 KB
testcase_03 RE -
testcase_04 AC 120 ms
55,564 KB
testcase_05 AC 121 ms
55,452 KB
testcase_06 AC 121 ms
55,552 KB
testcase_07 AC 121 ms
55,536 KB
testcase_08 AC 121 ms
55,668 KB
testcase_09 AC 122 ms
55,552 KB
testcase_10 AC 121 ms
55,548 KB
testcase_11 AC 122 ms
55,372 KB
testcase_12 AC 120 ms
55,596 KB
testcase_13 AC 123 ms
55,484 KB
testcase_14 AC 122 ms
55,588 KB
testcase_15 AC 125 ms
55,412 KB
testcase_16 AC 123 ms
55,616 KB
testcase_17 AC 122 ms
55,828 KB
testcase_18 AC 122 ms
55,344 KB
testcase_19 AC 124 ms
55,368 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		sc.close();
		char dir[] = s.toCharArray();
		int lNum = 1;
		if(dir.length==0)
		{
			System.out.println(lNum);
			return ;
		}
		for (int i = 0; i < dir.length; i++) {
				lNum *= 2 ;
				if(dir[i] == 'R') lNum++;
		}
		System.out.println(lNum);
	}

}
0