結果

問題 No.48 ロボットの操縦
ユーザー takeya_okinotakeya_okino
提出日時 2017-07-14 09:30:17
言語 PHP
(8.3.4)
結果
AC  
実行時間 44 ms / 5,000 ms
コード長 334 bytes
コンパイル時間 88 ms
コンパイル使用メモリ 30,604 KB
実行使用メモリ 31,164 KB
最終ジャッジ日時 2024-04-16 19:24:01
合計ジャッジ時間 1,941 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
30,956 KB
testcase_01 AC 40 ms
31,064 KB
testcase_02 AC 44 ms
30,756 KB
testcase_03 AC 44 ms
30,928 KB
testcase_04 AC 40 ms
30,692 KB
testcase_05 AC 40 ms
31,164 KB
testcase_06 AC 39 ms
31,156 KB
testcase_07 AC 39 ms
30,764 KB
testcase_08 AC 39 ms
30,944 KB
testcase_09 AC 40 ms
30,760 KB
testcase_10 AC 39 ms
30,940 KB
testcase_11 AC 40 ms
31,112 KB
testcase_12 AC 40 ms
30,936 KB
testcase_13 AC 40 ms
30,820 KB
testcase_14 AC 40 ms
31,060 KB
testcase_15 AC 40 ms
30,756 KB
testcase_16 AC 40 ms
30,844 KB
testcase_17 AC 40 ms
31,148 KB
testcase_18 AC 41 ms
30,904 KB
testcase_19 AC 41 ms
31,140 KB
testcase_20 AC 40 ms
30,856 KB
testcase_21 AC 41 ms
31,156 KB
testcase_22 AC 41 ms
31,132 KB
testcase_23 AC 41 ms
30,844 KB
testcase_24 AC 40 ms
30,996 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
$X = trim(fgets(STDIN));
$Y = trim(fgets(STDIN));
$L = trim(fgets(STDIN));
$ans = 0;
if($Y >= 0) {
  $ans += (intdiv($Y + $L - 1, $L));
  $ans += (intdiv(abs($X) + $L - 1, $L));
  if($X != 0) $ans += 1;
} else if($Y < 0) {
  $ans += (intdiv(abs($Y) + $L - 1, $L) + 2);
  $ans += (intdiv(abs($X) + $L - 1, $L));
}
print($ans);
?>
0