結果
問題 |
No.48 ロボットの操縦
|
ユーザー |
|
提出日時 | 2020-09-10 15:13:22 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 29 ms / 5,000 ms |
コード長 | 424 bytes |
コンパイル時間 | 223 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-12-23 08:30:37 |
合計ジャッジ時間 | 1,709 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 |
ソースコード
import math X = int(input()) # 移動先の東西軸座標 正の方向を東 Y = int(input()) # 移動先の南北軸座標 正の方向を北 L = int(input()) # 1命令につき前進することができる最大の距離 execCount = 0 execCount += math.ceil(abs(X / L)) execCount += math.ceil(abs(Y / L)) # 方向転換 if Y < 0: execCount += 2 # 180度 elif X != 0: execCount += 1 # 90度 print(execCount)