結果
| 問題 |
No.48 ロボットの操縦
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-05-03 20:25:20 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 42 ms / 5,000 ms |
| コード長 | 275 bytes |
| コンパイル時間 | 186 ms |
| コンパイル使用メモリ | 82,816 KB |
| 実行使用メモリ | 52,224 KB |
| 最終ジャッジ日時 | 2024-11-21 21:02:42 |
| 合計ジャッジ時間 | 1,971 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 25 |
ソースコード
X = int(input())
Y = int(input())
L = int(input())
cnt = 0
dir = 0
if Y>0:
cnt+=Y//L + (0 if Y%L==0 else 1)
X = abs(X)
if X>0:
cnt+=1
dir+=1
cnt+= X//L + (0 if X%L==0 else 1)
if Y<0:
cnt+=2-dir
Y=abs(Y)
cnt+=Y//L + (0 if Y%L==0 else 1)
print(cnt)