結果

問題 No.48 ロボットの操縦
ユーザー 村上史弥
提出日時 2022-10-25 19:14:08
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 505 bytes
コンパイル時間 87 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-07-03 16:48:02
合計ジャッジ時間 1,730 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 19 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

X = int(input())
Y = int(input())
L = int(input())
x = y = 0
count = count_x = count_y = 0

if X < 0:
    x = X * (-1)
else:
    x = X
if Y < 0:
    y = Y * (-1)
else:
    y = Y

if x > L:
    count_x = x // L
    if x % L > 0:
        count_x += 1
elif x == 0:
    count_x = 0
else:
    count_x += 1

if X < 0:
    count_x += 1

if y > L:
    count_y = y // L
    if y % L > 0:
        count_y += 1
elif y == 0:
    count_y = 0
else:
    count_y += 1

if Y < 0:
    count_y += 1

print(count_x + count_y)
0