結果
問題 | No.104 国道 |
ユーザー |
![]() |
提出日時 | 2015-12-29 22:39:27 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 53 ms / 5,000 ms |
コード長 | 532 bytes |
コンパイル時間 | 2,379 ms |
コンパイル使用メモリ | 74,568 KB |
実行使用メモリ | 37,200 KB |
最終ジャッジ日時 | 2024-09-19 08:31:06 |
合計ジャッジ時間 | 3,700 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 16 |
ソースコード
import java.io.*; import java.util.*; import java.math.*; class Main104 { public static void out (Object out) { System.out.println(out); } public static void main (String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int ans = 0; String s = br.readLine(); for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c == 'R') { ans += (int)Math.pow(2, s.length() - i - 1); } } out(ans + (int)Math.pow(2, s.length())); } }