結果
| 問題 | No.48 ロボットの操縦 |
| コンテスト | |
| ユーザー |
mmTa
|
| 提出日時 | 2019-07-14 19:56:36 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 734 bytes |
| 記録 | |
| コンパイル時間 | 771 ms |
| コンパイル使用メモリ | 20,700 KB |
| 実行使用メモリ | 15,372 KB |
| 最終ジャッジ日時 | 2026-05-18 15:46:53 |
| 合計ジャッジ時間 | 4,421 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 24 WA * 1 |
ソースコード
def count_prog(start, end, prog):
distance = end - start
if distance < 0:
distance *= -1
if distance % prog == 0:
count = distance // prog
else:
count = (distance // prog) + 1
return count
(TARGET_X) = int(input().rstrip())
(TARGET_Y) = int(input().rstrip())
(MAX_PROG) = int(input().rstrip())
nof_ope = 0
# 回転する回数を数える
# ---Y---
# |+|0|-|
# |+|1|1|2|
# X0|0|-|2|
# |-|1|1|2|
if TARGET_Y < 0:
nof_ope += 2
elif TARGET_Y == 0:
nof_ope += 1
elif TARGET_X != 0:
nof_ope += 1
# 南北の移動回数を求める
nof_ope += count_prog(0, TARGET_Y, MAX_PROG)
# 東西の移動回数を求める
nof_ope += count_prog(0, TARGET_X, MAX_PROG)
print(nof_ope)
mmTa