結果

問題 No.48 ロボットの操縦
ユーザー tomosuto
提出日時 2016-10-23 20:36:16
言語 Python2
(2.7.18)
結果
AC  
実行時間 13 ms / 5,000 ms
コード長 668 bytes
コンパイル時間 326 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2024-11-24 02:06:33
合計ジャッジ時間 1,359 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

X, Y, L = int(raw_input()), int(raw_input()), int(raw_input())
order = 0
currentPosition = (0, 0)
def countTurn(x, y):
    global order
    if  currentPosition == (x, y):
        order = 0
    else:
        if x == 0 and y > 0:
            order = 0
        else:
            if y >= 0:
                order += 1
            else:
                order += 2
def countMoveFoward(n):
    global order
    n = abs(n)
    if n != 0:
        if n <= L:
            order += 1
        else:
            if n % L == 0:
                order += n/L
            else:
                order += n/L + 1
    pass
countTurn(X, Y)
countMoveFoward(X)
countMoveFoward(Y)
print order 
0