結果

問題 No.48 ロボットの操縦
ユーザー deepjuggling
提出日時 2023-03-08 08:45:07
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 359 bytes
コンパイル時間 160 ms
コンパイル使用メモリ 82,196 KB
実行使用メモリ 54,124 KB
最終ジャッジ日時 2024-09-18 02:27:38
合計ジャッジ時間 2,146 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 24 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

y = int(input())
x = int(input())
l = int(input())
ans = 0
if x == 0 and y == 0:
    print(0)
    exit()
elif y == 0:
    if x > 0:
        ans += (x+l-1)//l
    else:
        ans += (x*(-1)+l-1)//l+2
elif x == 0:
    ans += (y+l-1)//l+1
else:
    if x < 0:
        ans += 2
    else:
        ans += 1
    ans += (abs(x)+l-1)//l + (abs(y)+l-1)//l
print(ans)

0