結果
問題 |
No.104 国道
|
ユーザー |
![]() |
提出日時 | 2014-12-16 23:43:22 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 515 bytes |
コンパイル時間 | 2,507 ms |
コンパイル使用メモリ | 75,092 KB |
実行使用メモリ | 54,664 KB |
最終ジャッジ日時 | 2024-06-11 22:03:10 |
合計ジャッジ時間 | 5,631 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 2 RE * 1 |
other | WA * 16 |
ソースコード
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.next(); sc.close(); char dir[] = s.toCharArray(); int bunki = 1; int RoadCount = 1; int countR = 0; for (int i = 0; i < dir.length; i++) { bunki *=2; RoadCount+= bunki; } RoadCount -= bunki; for (int i = 0; i < dir.length; i++) { if(dir[i] == 'R'){ bunki /= 2; } } System.out.println(RoadCount+bunki); } }