結果

問題 No.48 ロボットの操縦
コンテスト
ユーザー temari(hadaly)
提出日時 2019-04-01 21:20:40
言語 Python3
(3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
WA  
実行時間 -
コード長 717 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 56 ms
コンパイル使用メモリ 15,104 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2026-09-30 08:01:35
合計ジャッジ時間 1,946 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 24 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import math

distination_x = float(input())
distination_y = float(input())
distance = float(input())

turn = int(0)

if distination_y >= 0 and distination_x >= 0:
    turn = math.ceil(distination_y / distance) + math.ceil(distination_x/distance) + 1

elif distination_y >= 0 and distination_x < 0:
    turn = math.ceil(distination_y/distance) + math.ceil(-1*distination_x/distance) + 1

elif distination_y < 0 and distination_x >= 0:
    turn = math.ceil(-1*distination_y/distance) +1 +math.ceil(distination_x/distance) +1

elif distination_y < 0 and distination_x < 0:
    turn = math.ceil(-1*distination_y/distance) +1 +math.ceil(-1*distination_x/distance) +1

if distination_x == 0:
    turn = turn-1

print(turn)
0