結果

問題 No.104 国道
ユーザー kenji_shioyakenji_shioya
提出日時 2016-06-25 17:17:31
言語 Java21
(openjdk 21)
結果
AC  
実行時間 60 ms / 5,000 ms
コード長 439 bytes
コンパイル時間 3,562 ms
コンパイル使用メモリ 74,524 KB
実行使用メモリ 37,064 KB
最終ジャッジ日時 2024-04-20 03:05:05
合計ジャッジ時間 5,432 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 50 ms
36,836 KB
testcase_01 AC 53 ms
37,060 KB
testcase_02 AC 54 ms
37,024 KB
testcase_03 AC 57 ms
36,952 KB
testcase_04 AC 60 ms
36,876 KB
testcase_05 AC 46 ms
36,860 KB
testcase_06 AC 55 ms
37,064 KB
testcase_07 AC 53 ms
36,808 KB
testcase_08 AC 49 ms
37,064 KB
testcase_09 AC 52 ms
37,024 KB
testcase_10 AC 56 ms
36,852 KB
testcase_11 AC 53 ms
36,760 KB
testcase_12 AC 56 ms
36,868 KB
testcase_13 AC 49 ms
36,908 KB
testcase_14 AC 52 ms
36,772 KB
testcase_15 AC 54 ms
36,640 KB
testcase_16 AC 54 ms
36,792 KB
testcase_17 AC 56 ms
37,024 KB
testcase_18 AC 47 ms
37,016 KB
testcase_19 AC 54 ms
36,748 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;

public class Exercise124{
  public static void main (String[] args) throws IOException{

    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String s = new String(in.readLine());
    char[] sa = s.toCharArray();
    int a = 1;
    for(int lOrR: sa){
      if(lOrR == 'L'){
        a *= 2;
      }else{
        a = a * 2 + 1;
      }
    }
    System.out.println(a);
	}
}
0