結果
問題 | No.104 国道 |
ユーザー |
![]() |
提出日時 | 2020-11-10 15:38:58 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 133 ms / 5,000 ms |
コード長 | 421 bytes |
コンパイル時間 | 2,319 ms |
コンパイル使用メモリ | 74,048 KB |
実行使用メモリ | 41,532 KB |
最終ジャッジ日時 | 2024-07-22 17:32:10 |
合計ジャッジ時間 | 5,819 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 16 |
ソースコード
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.nextLine(); int current = 1; for (char c : s.toCharArray()) { if (c == 'L') { current *= 2; } else { current = current * 2 + 1; } } System.out.println(current); } }