結果
問題 | No.48 ロボットの操縦 |
ユーザー |
|
提出日時 | 2016-10-03 14:56:54 |
言語 | PHP (843.2) |
結果 |
AC
|
実行時間 | 40 ms / 5,000 ms |
コード長 | 643 bytes |
コンパイル時間 | 881 ms |
コンパイル使用メモリ | 32,148 KB |
実行使用メモリ | 32,532 KB |
最終ジャッジ日時 | 2024-11-21 18:55:23 |
合計ジャッジ時間 | 2,097 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 |
コンパイルメッセージ
No syntax errors detected in Main.php
ソースコード
<?php$input_lines = trim(fgets(STDIN));$input_lines = str_replace(array("\r\n","\r","\n"), "", $input_lines);do {$tmpStr[] = $input_lines;$input_lines = trim(fgets(STDIN));$input_lines = str_replace(array("\r\n","\r","\n"), "", $input_lines);} while ($input_lines !== "");$x = $tmpStr[0];$y = $tmpStr[1];$move = $tmpStr[2];$changeAngleCount = getChangeAngleCount((int)$x,(int)$y);$moveCount = ceil(abs($x) / $move) + ceil(abs($y) / $move);echo $changeAngleCount + $moveCount;function getChangeAngleCount($i_x,$i_y){if($i_y >= 0){if($i_x === 0){return 0;}else{return 1;}}else{return 2;}}