結果
問題 |
No.3108 Luke or Bishop
|
ユーザー |
|
提出日時 | 2025-04-19 11:44:52 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 433 bytes |
コンパイル時間 | 436 ms |
コンパイル使用メモリ | 12,160 KB |
実行使用メモリ | 10,496 KB |
最終ジャッジ日時 | 2025-04-19 11:44:55 |
合計ジャッジ時間 | 2,714 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 1 |
other | AC * 19 WA * 7 |
ソースコード
gx, gy = map(int, input().split()) def rook_moves(x, y): if x == 0 and y == 0: return 0 elif x == 0 or y == 0: return 1 else: return 2 def bishop_moves(x, y): if (x + y) % 2 != 0: return -1 # impossible for bishop if x == 0 and y == 0: return 0 elif abs(x) == abs(y): return 1 else: return 2 print(min(rook_moves(gx, gy), bishop_moves(gx, gy)))