結果
| 問題 | No.240 ナイト散歩 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-08-23 21:32:06 |
| 言語 | Python3 (3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 15 ms / 2,000 ms |
| + 825µs | |
| コード長 | 371 bytes |
| 記録 | |
| コンパイル時間 | 46 ms |
| コンパイル使用メモリ | 14,720 KB |
| 実行使用メモリ | 10,240 KB |
| 最終ジャッジ日時 | 2026-10-28 17:16:59 |
| 合計ジャッジ時間 | 2,184 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 31 |
ソースコード
#!/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')