結果

問題 No.48 ロボットの操縦
コンテスト
ユーザー T
提出日時 2025-11-17 11:48:55
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 35 ms / 5,000 ms
コード長 289 bytes
コンパイル時間 431 ms
コンパイル使用メモリ 12,288 KB
実行使用メモリ 10,368 KB
最終ジャッジ日時 2025-11-17 11:48:57
合計ジャッジ時間 2,424 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

X = int(input())
Y = int(input())
L = int(input())

# X方向の移動回数
move_x = (abs(X) + L - 1) // L

# Y方向の移動回数
move_y = (abs(Y) + L - 1) // L

count = move_x + move_y

# 方向転換
if (Y < 0) :
    count += 2
elif (X != 0):
    count += 1
else:
	pass

print(count)
0