結果

問題 No.48 ロボットの操縦
ユーザー match1997match1997
提出日時 2020-08-05 15:51:42
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
WA  
実行時間 -
コード長 734 bytes
コンパイル時間 246 ms
コンパイル使用メモリ 11,868 KB
実行使用メモリ 10,204 KB
最終ジャッジ日時 2023-10-17 05:54:07
合計ジャッジ時間 2,602 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 24 ms
10,112 KB
testcase_01 AC 23 ms
10,112 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 24 ms
10,112 KB
testcase_05 AC 24 ms
10,112 KB
testcase_06 AC 23 ms
10,112 KB
testcase_07 AC 24 ms
10,112 KB
testcase_08 AC 23 ms
10,112 KB
testcase_09 AC 23 ms
10,112 KB
testcase_10 WA -
testcase_11 AC 23 ms
10,112 KB
testcase_12 AC 23 ms
10,112 KB
testcase_13 AC 23 ms
10,112 KB
testcase_14 AC 23 ms
10,112 KB
testcase_15 AC 24 ms
10,112 KB
testcase_16 AC 23 ms
10,112 KB
testcase_17 AC 23 ms
10,112 KB
testcase_18 WA -
testcase_19 AC 23 ms
10,112 KB
testcase_20 AC 24 ms
10,112 KB
testcase_21 AC 23 ms
10,112 KB
testcase_22 AC 23 ms
10,112 KB
testcase_23 AC 23 ms
10,112 KB
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

def distance(x,y,L):
    if abs(x) % L == 0:
        a = abs(x) // L
    else:
        a = (abs(x) // L)+1
    if abs(y) % L == 0:
        b = abs(y) // L
    else:
        b = (abs(y) // L)+1    
    return int(a+b)    

if X > 0 and Y > 0 :
    print( 1  + distance(X,Y,L))
if X > 0 and Y < 0 :
    print( 2 + distance(X,Y,L)) 
if X < 0 and Y > 0:
    print( 1 +distance(X,Y,L))    
if X < 0 and Y < 0:
    print( 3 +distance(X,Y,L))    
if X == 0 :
    if Y > 0 :
        print(int(Y//L))
    if Y < 0 :
        print( 2 + int(abs(Y)//L))
if Y == 0:
    if X > 0 :
        print(int(X//L))
    if X < 0 :
        print( 2 + int(abs(X)//L))   
if X == 0 and Y == 0:
    print(0)  
0