結果

問題 No.104 国道
ユーザー FVRChanFVRChan
提出日時 2017-09-24 15:33:16
言語 Java21
(openjdk 21)
結果
AC  
実行時間 121 ms / 5,000 ms
コード長 353 bytes
コンパイル時間 1,861 ms
コンパイル使用メモリ 74,608 KB
実行使用メモリ 41,840 KB
最終ジャッジ日時 2024-04-26 17:33:32
合計ジャッジ時間 4,988 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
41,436 KB
testcase_01 AC 121 ms
41,388 KB
testcase_02 AC 116 ms
41,204 KB
testcase_03 AC 107 ms
40,268 KB
testcase_04 AC 116 ms
41,156 KB
testcase_05 AC 118 ms
41,212 KB
testcase_06 AC 109 ms
39,988 KB
testcase_07 AC 116 ms
41,176 KB
testcase_08 AC 111 ms
40,832 KB
testcase_09 AC 117 ms
41,036 KB
testcase_10 AC 117 ms
41,156 KB
testcase_11 AC 117 ms
41,840 KB
testcase_12 AC 116 ms
41,124 KB
testcase_13 AC 117 ms
41,436 KB
testcase_14 AC 102 ms
40,060 KB
testcase_15 AC 119 ms
41,184 KB
testcase_16 AC 117 ms
40,944 KB
testcase_17 AC 114 ms
40,784 KB
testcase_18 AC 116 ms
41,228 KB
testcase_19 AC 113 ms
41,256 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class Main{
	public static void main(String args[])throws Exception{
		Scanner sc=new Scanner(System.in);
		int counter=1;
		char c[]=sc.nextLine().toCharArray();
		for(int i=0;i<c.length;i++){
			if(c[i]=='L')
				counter=counter*2;
			else if(c[i]=='R')
				counter=counter*2+1;
		}
		System.out.println(counter);
	}
}
0