結果
| 問題 | No.240 ナイト散歩 |
| コンテスト | |
| ユーザー |
zombietan
|
| 提出日時 | 2016-06-02 21:11:31 |
| 言語 | Python3 (3.15.2 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 17 ms / 2,000 ms |
| + 817µs | |
| コード長 | 409 bytes |
| 記録 | |
| コンパイル時間 | 60 ms |
| コンパイル使用メモリ | 14,592 KB |
| 実行使用メモリ | 10,240 KB |
| 最終ジャッジ日時 | 2026-11-02 22:13:53 |
| 合計ジャッジ時間 | 2,698 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 32 |
ソースコード
X,Y = map(int, input().split())
reached = set()
def search(x, y, s):
if s < 0:
return
reached.add((x, y))
search(x-2, y-1, s-1)
search(x-2, y+1, s-1)
search(x-1, y-2, s-1)
search(x-1, y+2, s-1)
search(x+1, y-2, s-1)
search(x+1, y+2, s-1)
search(x+2, y-1, s-1)
search(x+2, y+1, s-1)
search(0, 0, 3)
if (X, Y) in reached:
print('YES')
else:
print('NO')
zombietan