結果

問題 No.104 国道
ユーザー takeya_okinotakeya_okino
提出日時 2017-06-21 22:00:08
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 454 bytes
コンパイル時間 2,063 ms
コンパイル使用メモリ 74,396 KB
実行使用メモリ 54,240 KB
最終ジャッジ日時 2024-04-10 09:59:57
合計ジャッジ時間 5,436 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
54,152 KB
testcase_01 AC 123 ms
53,856 KB
testcase_02 AC 124 ms
53,860 KB
testcase_03 RE -
testcase_04 AC 124 ms
54,088 KB
testcase_05 AC 125 ms
54,092 KB
testcase_06 AC 110 ms
52,944 KB
testcase_07 AC 124 ms
53,884 KB
testcase_08 AC 127 ms
53,960 KB
testcase_09 AC 126 ms
54,240 KB
testcase_10 AC 126 ms
53,976 KB
testcase_11 AC 124 ms
53,984 KB
testcase_12 AC 126 ms
53,972 KB
testcase_13 AC 127 ms
54,056 KB
testcase_14 AC 125 ms
54,052 KB
testcase_15 AC 123 ms
54,032 KB
testcase_16 AC 125 ms
53,876 KB
testcase_17 AC 127 ms
54,208 KB
testcase_18 AC 127 ms
54,096 KB
testcase_19 AC 126 ms
53,832 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    long ans = 1;
    String crlf = System.getProperty("line.separator");
    if(!(s.equals(crlf))) {
      for(int i = 0; i < s.length(); i++) {
        if(s.charAt(i) == 'L') {
          ans *= 2;
        } else {
          ans = 2 * ans + 1;
        }
      }
    }
    System.out.println(ans);
  }
}
0