結果
問題 |
No.104 国道
|
ユーザー |
![]() |
提出日時 | 2018-02-09 20:16:51 |
言語 | Java (openjdk 23) |
結果 |
RE
|
実行時間 | - |
コード長 | 383 bytes |
コンパイル時間 | 2,873 ms |
コンパイル使用メモリ | 76,328 KB |
実行使用メモリ | 41,656 KB |
最終ジャッジ日時 | 2024-10-08 05:36:07 |
合計ジャッジ時間 | 5,502 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 RE * 1 |
other | AC * 16 |
ソースコード
import java.util.*; public class Main { static Scanner sc = new Scanner(System.in); public static void main(String[] args) { String s = ""; s += sc.next(); if (s.equals("")) {System.out.println(1);} else { long ans = 1; for (int i=0; i<s.length(); i++) { if (s.charAt(i)=='R') {ans = ans*2 + 1;} else {ans = ans*2;} } System.out.println(ans); } } }