結果
| 問題 |
No.240 ナイト散歩
|
| ユーザー |
akanaya
|
| 提出日時 | 2020-04-01 21:02:23 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 665 bytes |
| コンパイル時間 | 86 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 11,136 KB |
| 最終ジャッジ日時 | 2024-06-27 06:49:38 |
| 合計ジャッジ時間 | 2,266 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 3 |
| other | AC * 14 WA * 16 |
ソースコード
xy = list(map(int, input().split(' ')))
df = [
[1, 2],
[-1, 2],
[1, -2],
[-1, -2],
[2, 1],
[-2, 1],
[2, -1],
[-2, -1]
]
def check(pos, cand, n):
if n == 0:
return 'NO'
else:
result = []
for c in cand:
for d in df:
temp = [
c[0] + d[0],
c[1] + d[1]
]
if temp[0] == pos[0] and temp[1] == pos[1]:
return 'Yes'
else:
result.append(temp)
return check(pos, result, n - 1)
current = [[0, 0]]
result = check(xy, current, 4)
print(result)
akanaya