結果

問題 No.48 ロボットの操縦
ユーザー バカらっくバカらっく
提出日時 2019-09-11 22:26:30
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
WA  
実行時間 -
コード長 365 bytes
コンパイル時間 447 ms
コンパイル使用メモリ 10,548 KB
実行使用メモリ 7,952 KB
最終ジャッジ日時 2023-09-15 13:59:12
合計ジャッジ時間 1,439 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,904 KB
testcase_01 AC 17 ms
7,796 KB
testcase_02 AC 16 ms
7,784 KB
testcase_03 WA -
testcase_04 AC 15 ms
7,708 KB
testcase_05 WA -
testcase_06 AC 15 ms
7,712 KB
testcase_07 AC 15 ms
7,768 KB
testcase_08 WA -
testcase_09 AC 15 ms
7,836 KB
testcase_10 WA -
testcase_11 AC 15 ms
7,948 KB
testcase_12 AC 16 ms
7,768 KB
testcase_13 AC 16 ms
7,772 KB
testcase_14 AC 15 ms
7,784 KB
testcase_15 AC 16 ms
7,892 KB
testcase_16 AC 15 ms
7,864 KB
testcase_17 AC 16 ms
7,816 KB
testcase_18 WA -
testcase_19 AC 15 ms
7,860 KB
testcase_20 AC 15 ms
7,808 KB
testcase_21 AC 15 ms
7,836 KB
testcase_22 WA -
testcase_23 AC 15 ms
7,800 KB
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8

x = int(input())
y = int(input())
l = int(input())

def move(mv):
    cnt = int(abs(mv)/l)
    if (mv % l != 0):
        cnt += 1
    return cnt

ans = 0
if (y > 0):
    ans += move(y)
    if(x != 0):
        ans += move(x)
        ans += 1
elif (y < 0):
    ans = move(y)
    ans += 2
    move(x)
else:
    ans += 1
    ans += move(x)
print(ans)

0