結果
問題 | No.240 ナイト散歩 |
ユーザー |
|
提出日時 | 2016-08-23 21:32:06 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 34 ms / 2,000 ms |
コード長 | 371 bytes |
コンパイル時間 | 423 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-10-07 21:27:57 |
合計ジャッジ時間 | 2,463 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 30 |
ソースコード
#!/usr/bin/env python3def 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 = Falsefor _ in range(3):qs = []for p in ps:qs += list(move(*p))ps = qsif (x, y) in ps:ans = Trueprint('YES' if ans else 'NO')