結果
| 問題 | No.3595 A Queen |
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2026-07-24 21:27:12 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 69 ms / 2,000 ms |
| + 580µs | |
| コード長 | 418 bytes |
| 記録 | |
| コンパイル時間 | 241 ms |
| コンパイル使用メモリ | 96,040 KB |
| 実行使用メモリ | 79,232 KB |
| 最終ジャッジ日時 | 2026-07-24 21:27:15 |
| 合計ジャッジ時間 | 2,397 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 12 |
ソースコード
from itertools import product
def can_reach(src, dst):
src_x, src_y = src
dst_x, dst_y = dst
for cx, cy in product((-1, 0, 1), repeat=2):
if cx == cy == 0:
continue
if cx * src_x + cy * src_y == cx * dst_x + cy * dst_y:
return True
return False
N = int(input())
h, w = [int(s) for s in input().split()]
print("Yes" if can_reach((1, 1), (h, w)) else "No")