結果
| 問題 | 
                            No.48 ロボットの操縦
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2021-06-28 16:41:29 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 33 ms / 5,000 ms | 
| コード長 | 493 bytes | 
| コンパイル時間 | 94 ms | 
| コンパイル使用メモリ | 12,416 KB | 
| 実行使用メモリ | 10,880 KB | 
| 最終ジャッジ日時 | 2024-06-25 12:11:50 | 
| 合計ジャッジ時間 | 1,702 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 25 | 
ソースコード
X = int(input())
Y = int(input())
L = int(input())
rota = 0
gost = 0
if Y > 0:
    if X != 0:
        rota += 1
elif Y == 0:
    if X != 0:
        rota += 1
else:
    if X == 0:
        rota += 2
    else:
        rota += 2
#print(rota)        
if X % L == 0:
    gost += abs(X // L)
elif X < 0:
    gost += abs(X // L) 
else:
    gost += abs(X//L)+1
if Y % L == 0:
    gost += abs(Y //L)
elif Y < 0 :
    gost += abs(Y//L) 
else:
    gost += abs(Y//L) +1
#print(gost)   
print(rota+gost)