結果

問題 No.104 国道
ユーザー キョウチクキョウチク
提出日時 2022-05-19 11:30:38
言語 Java21
(openjdk 21)
結果
AC  
実行時間 129 ms / 5,000 ms
コード長 382 bytes
コンパイル時間 3,577 ms
コンパイル使用メモリ 78,676 KB
実行使用メモリ 57,596 KB
最終ジャッジ日時 2023-10-17 19:58:37
合計ジャッジ時間 7,222 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
57,416 KB
testcase_01 AC 126 ms
57,324 KB
testcase_02 AC 127 ms
57,288 KB
testcase_03 AC 127 ms
57,360 KB
testcase_04 AC 126 ms
57,388 KB
testcase_05 AC 128 ms
57,396 KB
testcase_06 AC 128 ms
57,304 KB
testcase_07 AC 126 ms
57,408 KB
testcase_08 AC 128 ms
57,344 KB
testcase_09 AC 128 ms
57,388 KB
testcase_10 AC 127 ms
57,252 KB
testcase_11 AC 128 ms
57,288 KB
testcase_12 AC 128 ms
57,284 KB
testcase_13 AC 128 ms
57,184 KB
testcase_14 AC 128 ms
57,292 KB
testcase_15 AC 129 ms
57,244 KB
testcase_16 AC 127 ms
57,256 KB
testcase_17 AC 128 ms
57,508 KB
testcase_18 AC 128 ms
57,284 KB
testcase_19 AC 128 ms
57,596 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class Test11 {
  public static void main(String[] args){
    Scanner sc=new Scanner(System.in);
    String[] line;
    line=sc.nextLine().split(" ");
    int n=line[0].length();
    int route=1;
    for(int i=0;i<n;i++){
      route*=2;
      if(line[0].charAt(i)=='R'){
        route++;
      }
    }
    System.out.println(route);
    sc.close();
  }
}
0