結果
| 問題 | No.240 ナイト散歩 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-08-23 21:32:06 |
| 言語 | Python3 (3.15.2 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 17 ms / 2,000 ms |
| + 44µs | |
| コード長 | 371 bytes |
| 記録 | |
| コンパイル時間 | 57 ms |
| コンパイル使用メモリ | 14,720 KB |
| 実行使用メモリ | 10,240 KB |
| 最終ジャッジ日時 | 2026-11-02 22:14:38 |
| 合計ジャッジ時間 | 2,469 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 32 |
ソースコード
#!/usr/bin/env python3
def move(x, y):
for dx, dy in [(-2,-1),(-2,+1),(-1,-2),(-1,+2),(+1,-2),(+1,+2),(+2,-1),(+2,+1)]:
yield (x + dx, y + dy)
x, y = map(int,input().split())
ps = [(0,0)]
ans = False
for _ in range(3):
qs = []
for p in ps:
qs += list(move(*p))
ps = qs
if (x, y) in ps:
ans = True
print('YES' if ans else 'NO')