結果

問題 No.48 ロボットの操縦
ユーザー lam6er
提出日時 2025-04-16 15:50:51
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 431 bytes
コンパイル時間 254 ms
コンパイル使用メモリ 81,860 KB
実行使用メモリ 53,768 KB
最終ジャッジ日時 2025-04-16 15:51:42
合計ジャッジ時間 2,046 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 18 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

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

Dx = abs(X)
Dy = abs(Y)

x_steps = (Dx + L - 1) // L if Dx != 0 else 0
y_steps = (Dy + L - 1) // L if Dy != 0 else 0

directions = 0
if x_steps > 0:
    directions += 1
if y_steps > 0:
    directions += 1

if directions == 0:
    print(0)
elif directions == 1:
    if y_steps > 0:
        print(y_steps)
    else:
        print(1 + x_steps)
else:
    print(y_steps + x_steps + 1)
0