結果
| 問題 | No.104 国道 |
| コンテスト | |
| ユーザー |
tenten
|
| 提出日時 | 2020-11-10 15:38:58 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
AC
|
| 実行時間 | 81 ms / 5,000 ms |
| コード長 | 421 bytes |
| 記録 | |
| コンパイル時間 | 1,567 ms |
| コンパイル使用メモリ | 82,552 KB |
| 実行使用メモリ | 46,652 KB |
| 最終ジャッジ日時 | 2026-04-03 10:14:37 |
| 合計ジャッジ時間 | 3,473 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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);
}
}
tenten