結果

問題 No.104 国道
ユーザー FVRChan
提出日時 2017-09-24 15:33:16
言語 Java
(openjdk 23)
結果
AC  
実行時間 129 ms / 5,000 ms
コード長 353 bytes
コンパイル時間 2,289 ms
コンパイル使用メモリ 74,304 KB
実行使用メモリ 54,420 KB
最終ジャッジ日時 2024-11-14 07:09:40
合計ジャッジ時間 5,741 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

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