結果

問題 No.48 ロボットの操縦
コンテスト
ユーザー pajannat
提出日時 2021-04-05 22:20:37
言語 PyPy3
(8.0.0 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 25 ms / 5,000 ms
+ 469µs
コード長 595 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 68 ms
コンパイル使用メモリ 82,316 KB
実行使用メモリ 56,440 KB
最終ジャッジ日時 2026-10-10 02:31:45
合計ジャッジ時間 2,177 ms
ジャッジサーバーID
(参考情報)
judge5_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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

cnt = 0

if X == 0:
	if Y == 0:
		cnt = 0
	elif Y > 0:
		cnt += math.ceil(abs(Y)/L)
	else:
		cnt += math.ceil(abs(Y)/L) + 2
elif X > 0:
	if Y == 0:
		cnt += math.ceil(abs(X)/L) + 1
	elif Y > 0:
		cnt += math.ceil(abs(X)/L) + math.ceil(abs(Y)/L) + 1
	else:
		cnt += math.ceil(abs(X)/L) + math.ceil(abs(Y)/L) + 2
else:
	if Y == 0:
		cnt += math.ceil(abs(X)/L) + 1
	elif Y > 0:
		cnt += math.ceil(abs(X)/L) + math.ceil(abs(Y)/L) + 1
	else:
		cnt += math.ceil(abs(X)/L)+ math.ceil(abs(Y)/L) + 2

print(cnt)
0