結果

問題 No.48 ロボットの操縦
コンテスト
ユーザー akihito0000
提出日時 2016-08-15 22:46:41
言語 PyPy2
(7.3.20)
コンパイル:
pypy2 -m py_compile _filename_
実行:
/usr/bin/pypy2 Main.pyc
結果
AC  
実行時間 52 ms / 5,000 ms
+ 51µs
コード長 443 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 59 ms
コンパイル使用メモリ 81,008 KB
実行使用メモリ 81,180 KB
最終ジャッジ日時 2026-07-18 07:24:03
合計ジャッジ時間 2,963 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#!/usr/bin/python
# -*- coding: utf-8 -*-
import math
X = int(raw_input())
Y = int(raw_input())
L = int(raw_input())
ans = 0

if X != 0:
       	ans += 1 + math.ceil(math.fabs(X) * 1.0 / L)
elif X == 0 and Y < 0:
       	ans += 2 + math.ceil(math.fabs(Y) * 1.0 / L)
       	print int(ans)
       	exit()

if Y > 0:
       	ans += math.ceil(math.fabs(Y) * 1.0 / L)
elif Y < 0:
       	ans += 1 + math.ceil(math.fabs(Y) * 1.0 / L)
print int(ans)
0