結果
| 問題 | No.240 ナイト散歩 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-06-04 16:35:20 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 159 ms / 2,000 ms |
| コード長 | 404 bytes |
| 記録 | |
| コンパイル時間 | 944 ms |
| コンパイル使用メモリ | 20,824 KB |
| 実行使用メモリ | 15,360 KB |
| 最終ジャッジ日時 | 2026-05-23 08:13:30 |
| 合計ジャッジ時間 | 6,789 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 30 |
ソースコード
G = tuple(map(int, input().split()))
if G == (0, 0):
print('YES')
exit()
st = {(0, 0)}
for _ in range(3):
new_st = set()
for x, y in st:
for dx, dy in ((1, 2), (2, 1), (1, -2), (-2, 1),
(-1, 2), (2, -1), (-1, -2), (-2, -1)):
new_st.add((x + dx, y + dy))
st = new_st
if G in st:
print('YES')
break
else:
print('NO')