結果

問題 No.3108 Luke or Bishop
ユーザー Sohan Kanna
提出日時 2025-04-18 20:17:28
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 328 bytes
コンパイル時間 289 ms
コンパイル使用メモリ 12,160 KB
実行使用メモリ 10,112 KB
最終ジャッジ日時 2025-04-18 20:17:30
合計ジャッジ時間 1,900 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 2
other WA * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

def min_steps_to_goal(Gx, Gy):
    if Gx == 0 or Gy == 0:
        luke_steps = 1
    else:
        luke_steps = 2

    if Gx == Gy or Gx == -Gy:
        bishop_steps = 1
    elif (Gx + Gy) % 2 != 0:
        bishop_steps = float('inf')  # Cannot reach
    else:
        bishop_steps = 2

    return min(luke_steps, bishop_steps)
0