結果

問題 No.104 国道
ユーザー shinwisteriashinwisteria
提出日時 2018-03-04 14:10:13
言語 Java21
(openjdk 21)
結果
AC  
実行時間 128 ms / 5,000 ms
コード長 361 bytes
コンパイル時間 4,686 ms
コンパイル使用メモリ 72,500 KB
実行使用メモリ 56,296 KB
最終ジャッジ日時 2023-09-21 22:00:31
合計ジャッジ時間 8,638 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
55,804 KB
testcase_01 AC 118 ms
55,980 KB
testcase_02 AC 119 ms
56,296 KB
testcase_03 AC 119 ms
55,512 KB
testcase_04 AC 121 ms
55,900 KB
testcase_05 AC 128 ms
55,540 KB
testcase_06 AC 118 ms
55,996 KB
testcase_07 AC 119 ms
55,988 KB
testcase_08 AC 119 ms
55,672 KB
testcase_09 AC 122 ms
55,432 KB
testcase_10 AC 123 ms
55,588 KB
testcase_11 AC 124 ms
55,752 KB
testcase_12 AC 125 ms
55,680 KB
testcase_13 AC 123 ms
55,620 KB
testcase_14 AC 125 ms
55,756 KB
testcase_15 AC 124 ms
55,504 KB
testcase_16 AC 123 ms
55,572 KB
testcase_17 AC 118 ms
56,072 KB
testcase_18 AC 118 ms
55,568 KB
testcase_19 AC 119 ms
55,696 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package m.shin;
import java.util.Scanner;
public class Con104 {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		String lr = s.nextLine();
		s.close();

		long now = 1;
		for(int i = 0;i < lr.length();i++){
			if(lr.charAt(i) == 'L'){
				now *= 2;
			}else{
				now *= 2;
				now++;
			}
		}
		System.out.println(now);

	}

}
0