結果

問題 No.48 ロボットの操縦
ユーザー penicillin0
提出日時 2019-03-05 03:19:30
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 30 ms / 5,000 ms
コード長 398 bytes
コンパイル時間 108 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-06-23 14:08:12
合計ジャッジ時間 1,694 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

X, Y, L = int(input()), int(input()), int(input())
ans = 0
if X == Y == 0:
    print(0)
    exit()

if X == 0 and Y > 0:
    ans += 0
elif Y >= 0:
    ans += 1
else:
    ans += 2

X_count, Y_count = 0, 0

if abs(X) % L == 0:
    X_count = abs(X) // L
else:
    X_count = abs(X) // L + 1


if abs(Y) % L == 0:
    Y_count = abs(Y) // L
else:
    Y_count = abs(Y) // L + 1

print(ans+X_count+Y_count)
0