結果

問題 No.104 国道
ユーザー FVRChanFVRChan
提出日時 2017-09-24 15:33:16
言語 Java19
(openjdk 21)
結果
AC  
実行時間 117 ms / 5,000 ms
コード長 353 bytes
コンパイル時間 2,053 ms
コンパイル使用メモリ 71,960 KB
実行使用メモリ 56,376 KB
最終ジャッジ日時 2023-08-09 01:56:40
合計ジャッジ時間 5,435 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 111 ms
56,280 KB
testcase_01 AC 114 ms
56,100 KB
testcase_02 AC 106 ms
55,932 KB
testcase_03 AC 110 ms
56,108 KB
testcase_04 AC 108 ms
56,300 KB
testcase_05 AC 113 ms
56,376 KB
testcase_06 AC 113 ms
55,880 KB
testcase_07 AC 112 ms
55,792 KB
testcase_08 AC 117 ms
56,084 KB
testcase_09 AC 115 ms
55,820 KB
testcase_10 AC 115 ms
56,168 KB
testcase_11 AC 115 ms
56,152 KB
testcase_12 AC 110 ms
56,112 KB
testcase_13 AC 111 ms
55,948 KB
testcase_14 AC 111 ms
55,844 KB
testcase_15 AC 109 ms
54,168 KB
testcase_16 AC 107 ms
56,300 KB
testcase_17 AC 114 ms
56,048 KB
testcase_18 AC 112 ms
55,908 KB
testcase_19 AC 114 ms
56,088 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