結果

問題 No.104 国道
ユーザー mits58mits58
提出日時 2016-07-02 13:48:52
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 310 bytes
コンパイル時間 1,740 ms
コンパイル使用メモリ 74,824 KB
実行使用メモリ 54,244 KB
最終ジャッジ日時 2024-04-20 05:41:42
合計ジャッジ時間 4,500 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 101 ms
53,780 KB
testcase_01 AC 101 ms
53,888 KB
testcase_02 AC 113 ms
54,076 KB
testcase_03 RE -
testcase_04 AC 106 ms
54,140 KB
testcase_05 AC 106 ms
54,020 KB
testcase_06 AC 103 ms
54,244 KB
testcase_07 AC 98 ms
54,224 KB
testcase_08 AC 102 ms
54,060 KB
testcase_09 AC 100 ms
54,008 KB
testcase_10 AC 104 ms
54,044 KB
testcase_11 AC 103 ms
54,064 KB
testcase_12 AC 96 ms
53,716 KB
testcase_13 AC 99 ms
53,904 KB
testcase_14 AC 103 ms
53,976 KB
testcase_15 AC 93 ms
52,848 KB
testcase_16 AC 102 ms
53,116 KB
testcase_17 AC 100 ms
54,116 KB
testcase_18 AC 100 ms
53,880 KB
testcase_19 AC 103 ms
54,148 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		long ans=1;
		String str=sc.next();
		for(int i=0;i<str.length();i++){
			if(str.charAt(i)=='L') ans*=2;
			else if(str.charAt(i)=='R') ans=2*ans+1;
		}
		System.out.println(ans);
	}
}
0