結果
問題 |
No.104 国道
|
ユーザー |
![]() |
提出日時 | 2018-02-09 20:18:58 |
言語 | Java (openjdk 23) |
結果 |
RE
|
実行時間 | - |
コード長 | 367 bytes |
コンパイル時間 | 2,059 ms |
コンパイル使用メモリ | 74,152 KB |
実行使用メモリ | 54,212 KB |
最終ジャッジ日時 | 2024-10-08 05:49:26 |
合計ジャッジ時間 | 5,294 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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 = sc.next(); if (s==null) {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); } } }