結果
問題 | No.104 国道 |
ユーザー |
![]() |
提出日時 | 2018-02-09 20:21:19 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 123 ms / 5,000 ms |
コード長 | 372 bytes |
コンパイル時間 | 2,235 ms |
コンパイル使用メモリ | 74,304 KB |
実行使用メモリ | 54,268 KB |
最終ジャッジ日時 | 2024-10-08 05:59:32 |
合計ジャッジ時間 | 5,295 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
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.nextLine(); 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); } } }