結果

問題 No.104 国道
ユーザー spacenautspacenaut
提出日時 2016-05-22 16:37:33
言語 Java21
(openjdk 21)
結果
AC  
実行時間 158 ms / 5,000 ms
コード長 335 bytes
コンパイル時間 2,203 ms
コンパイル使用メモリ 77,660 KB
実行使用メモリ 41,448 KB
最終ジャッジ日時 2024-04-16 06:48:10
合計ジャッジ時間 6,127 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 145 ms
41,180 KB
testcase_01 AC 143 ms
41,196 KB
testcase_02 AC 140 ms
41,276 KB
testcase_03 AC 136 ms
40,900 KB
testcase_04 AC 145 ms
41,284 KB
testcase_05 AC 146 ms
41,208 KB
testcase_06 AC 145 ms
40,968 KB
testcase_07 AC 140 ms
41,240 KB
testcase_08 AC 146 ms
41,392 KB
testcase_09 AC 158 ms
41,068 KB
testcase_10 AC 138 ms
41,108 KB
testcase_11 AC 138 ms
41,264 KB
testcase_12 AC 136 ms
41,384 KB
testcase_13 AC 138 ms
41,200 KB
testcase_14 AC 135 ms
41,040 KB
testcase_15 AC 140 ms
41,340 KB
testcase_16 AC 141 ms
41,428 KB
testcase_17 AC 138 ms
40,980 KB
testcase_18 AC 136 ms
41,448 KB
testcase_19 AC 137 ms
40,928 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class No0104{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		int now = 1;

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