結果
問題 |
No.104 国道
|
ユーザー |
![]() |
提出日時 | 2018-02-09 20:20:51 |
言語 | Java (openjdk 23) |
結果 |
RE
|
実行時間 | - |
コード長 | 368 bytes |
コンパイル時間 | 5,044 ms |
コンパイル使用メモリ | 77,880 KB |
実行使用メモリ | 41,236 KB |
最終ジャッジ日時 | 2024-10-08 05:57:40 |
合計ジャッジ時間 | 4,978 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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); } } }