結果
問題 | No.48 ロボットの操縦 |
ユーザー |
![]() |
提出日時 | 2023-03-08 08:46:34 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 44 ms / 5,000 ms |
コード長 | 362 bytes |
コンパイル時間 | 241 ms |
コンパイル使用メモリ | 82,048 KB |
実行使用メモリ | 52,224 KB |
最終ジャッジ日時 | 2024-09-18 02:27:40 |
合計ジャッジ時間 | 2,016 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 |
ソースコード
y = int(input())x = int(input())l = int(input())ans = 0if x == 0 and y == 0:print(0)exit()elif y == 0:if x > 0:ans += (x+l-1)//lelse:ans += (abs(x)+l-1)//l+2elif x == 0:ans += (abs(y)+l-1)//l+1else:if x < 0:ans += 2else:ans += 1ans += (abs(x)+l-1)//l + (abs(y)+l-1)//lprint(ans)