結果
問題 |
No.104 国道
|
ユーザー |
![]() |
提出日時 | 2017-10-20 17:58:05 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 410 bytes |
コンパイル時間 | 1,945 ms |
コンパイル使用メモリ | 73,948 KB |
実行使用メモリ | 54,248 KB |
最終ジャッジ日時 | 2024-11-21 10:48:59 |
合計ジャッジ時間 | 5,063 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 RE * 1 |
other | WA * 16 |
ソースコード
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); if(sc.hasNext()) { System.out.println(1); return; } String s = sc.next(); int n = s.length(); int ans = 1; for(int i = 0 ; i < n ; i++) { if(s.charAt(i) == 'R') { ans = ans * 2 + 1; } else { ans = ans * 2; } } System.out.println(ans); } }