結果

問題 No.48 ロボットの操縦
ユーザー takaaaa6takaaaa6
提出日時 2022-03-07 19:02:11
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 504 bytes
コンパイル時間 99 ms
コンパイル使用メモリ 10,764 KB
実行使用メモリ 7,932 KB
最終ジャッジ日時 2023-09-29 20:01:55
合計ジャッジ時間 2,084 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,796 KB
testcase_01 AC 16 ms
7,832 KB
testcase_02 WA -
testcase_03 AC 14 ms
7,824 KB
testcase_04 AC 15 ms
7,872 KB
testcase_05 AC 14 ms
7,860 KB
testcase_06 AC 14 ms
7,832 KB
testcase_07 AC 15 ms
7,756 KB
testcase_08 AC 14 ms
7,792 KB
testcase_09 AC 14 ms
7,900 KB
testcase_10 AC 14 ms
7,752 KB
testcase_11 AC 14 ms
7,824 KB
testcase_12 AC 14 ms
7,828 KB
testcase_13 AC 14 ms
7,932 KB
testcase_14 AC 14 ms
7,848 KB
testcase_15 AC 14 ms
7,844 KB
testcase_16 AC 14 ms
7,860 KB
testcase_17 AC 15 ms
7,800 KB
testcase_18 AC 15 ms
7,824 KB
testcase_19 AC 15 ms
7,780 KB
testcase_20 AC 15 ms
7,828 KB
testcase_21 AC 14 ms
7,784 KB
testcase_22 AC 15 ms
7,776 KB
testcase_23 AC 15 ms
7,756 KB
testcase_24 AC 15 ms
7,844 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

X=int(input())
Y=int(input())
L=int(input())

def xset(x):
    global X

    if x == 0:
        X = 0

    elif x%L == 0:
        X = int(abs(x)/L)+1

    elif x%L != 0:
        X = int(abs(x)/L)+2

    return X

if Y == 0:
    xset(X)

elif Y > 0:
    if Y%L == 0:
        Y = int(abs(Y)/L)
        xset(X)

    else:
        Y = int(abs(Y)/L)+1
        xset(X)

elif Y < 0:
    if Y%L == 0:
        xset(X)
        Y = int(abs(Y)/L)+1

    else:
        xset(X)
        Y = int(abs(Y)/L)+2

print(X+Y)
0