結果
問題 | No.104 国道 |
ユーザー |
|
提出日時 | 2021-01-01 08:53:29 |
言語 | PHP (843.2) |
結果 |
AC
|
実行時間 | 41 ms / 5,000 ms |
コード長 | 412 bytes |
コンパイル時間 | 3,770 ms |
コンパイル使用メモリ | 32,144 KB |
実行使用メモリ | 32,532 KB |
最終ジャッジ日時 | 2024-10-10 19:33:23 |
合計ジャッジ時間 | 4,081 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 16 |
コンパイルメッセージ
No syntax errors detected in Main.php
ソースコード
<?php /** * @see https://yukicoder.me/problems/no/104 */ $S = str_split(trim(fgets(STDIN))); $currentLocation = 1; foreach ($S as $directionHistory) { switch ($directionHistory) { case 'L': $currentLocation = $currentLocation * 2; break; case 'R': $currentLocation = $currentLocation * 2 + 1; break; } } echo $currentLocation . "\n";