結果
問題 | No.104 国道 |
ユーザー |
![]() |
提出日時 | 2017-06-18 22:56:09 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 52 ms / 5,000 ms |
コード長 | 483 bytes |
コンパイル時間 | 2,789 ms |
コンパイル使用メモリ | 74,040 KB |
実行使用メモリ | 37,092 KB |
最終ジャッジ日時 | 2024-10-01 20:34:09 |
合計ジャッジ時間 | 4,599 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 16 |
ソースコード
/*No.104 国道*/import java.io.*;public class No104 {public static void main(String[] args) {try(BufferedReader input =new BufferedReader(new InputStreamReader(System.in))){String route =input.readLine();int walkway=1;for(byte i=0;i<route.length();i++){if(route.charAt(i)=='L'){walkway*=2;}else if(route.charAt(i)=='R'){walkway=2*walkway+1;}}System.out.println(walkway);}catch(Exception e){e.printStackTrace();}}}