結果

問題 No.48 ロボットの操縦
ユーザー tokutaro
提出日時 2019-11-23 19:37:26
言語 Python2
(2.7.18)
結果
AC  
実行時間 12 ms / 5,000 ms
コード長 403 bytes
コンパイル時間 43 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2024-10-11 07:01:08
合計ジャッジ時間 1,151 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

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

count = 0

direction = 'N'

# change direction
if Y >= 0 and X < 0:
    count = 1
elif Y < 0 and X <= 0:
    count = 2
elif Y >= 0 and X > 0:
    count = 1
elif Y < 0 and X > 0:
    count = 2

# go
X = max([X, -1 * X])
Y = max([Y, -1 * Y])
count += int(X / L) if X % L == 0 else int(X / L) + 1
count += int(Y / L) if Y % L == 0 else int(Y / L) + 1

print(str(count))
0