結果
問題 | No.104 国道 |
ユーザー |
![]() |
提出日時 | 2017-04-27 21:56:59 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 69 ms / 5,000 ms |
コード長 | 571 bytes |
コンパイル時間 | 2,351 ms |
コンパイル使用メモリ | 75,676 KB |
実行使用メモリ | 50,372 KB |
最終ジャッジ日時 | 2024-09-13 14:53:38 |
合計ジャッジ時間 | 4,485 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 16 |
ソースコード
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); String S = reader.readLine(); int route = 1; for (int i = 0; i < S.length(); i++) { if (S.charAt(i) == 'L') { route = route * 2; } else { route = route * 2 +1; } } System.out.println(route); } }