結果
問題 | No.48 ロボットの操縦 |
ユーザー |
![]() |
提出日時 | 2025-04-15 22:24:48 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 431 bytes |
コンパイル時間 | 1,538 ms |
コンパイル使用メモリ | 81,480 KB |
実行使用メモリ | 53,404 KB |
最終ジャッジ日時 | 2025-04-15 22:27:02 |
合計ジャッジ時間 | 3,814 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 18 WA * 7 |
ソースコード
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)