結果

問題 No.48 ロボットの操縦
ユーザー 綾地寧々綾地寧々
提出日時 2015-05-14 17:36:00
言語 PHP
(8.3.4)
結果
AC  
実行時間 38 ms / 5,000 ms
コード長 273 bytes
コンパイル時間 3,240 ms
コンパイル使用メモリ 32,016 KB
実行使用メモリ 31,264 KB
最終ジャッジ日時 2024-05-01 13:36:33
合計ジャッジ時間 4,472 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
30,808 KB
testcase_01 AC 35 ms
30,844 KB
testcase_02 AC 35 ms
30,884 KB
testcase_03 AC 35 ms
31,144 KB
testcase_04 AC 36 ms
30,928 KB
testcase_05 AC 34 ms
31,264 KB
testcase_06 AC 36 ms
30,796 KB
testcase_07 AC 36 ms
31,044 KB
testcase_08 AC 34 ms
31,032 KB
testcase_09 AC 36 ms
30,584 KB
testcase_10 AC 38 ms
30,956 KB
testcase_11 AC 38 ms
31,216 KB
testcase_12 AC 37 ms
31,184 KB
testcase_13 AC 37 ms
30,780 KB
testcase_14 AC 37 ms
31,124 KB
testcase_15 AC 38 ms
31,124 KB
testcase_16 AC 36 ms
31,148 KB
testcase_17 AC 37 ms
31,220 KB
testcase_18 AC 36 ms
30,920 KB
testcase_19 AC 36 ms
31,136 KB
testcase_20 AC 36 ms
30,928 KB
testcase_21 AC 36 ms
30,964 KB
testcase_22 AC 35 ms
30,676 KB
testcase_23 AC 37 ms
30,928 KB
testcase_24 AC 35 ms
31,160 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
$ew = trim(fgets(STDIN));
$ns = trim(fgets(STDIN));
$walk_max = trim(fgets(STDIN));
$cue_time = ceil(abs($ew)/$walk_max);
$cue_time += ceil(abs($ns)/$walk_max);
$cue_time += ($ew != 0) ? 1:0;
if ( $ns < 0 ) {
	$cue_time += ($ew == 0) ? 2:1;
}
echo $cue_time.PHP_EOL;
0