結果
| 問題 |
No.240 ナイト散歩
|
| ユーザー |
Konton7
|
| 提出日時 | 2019-05-19 20:05:20 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 32 ms / 2,000 ms |
| コード長 | 524 bytes |
| コンパイル時間 | 110 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-09-17 06:32:32 |
| 合計ジャッジ時間 | 2,330 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 30 |
ソースコード
position_list = [(0,0)]
def knight_move(inlist):
y, x = inlist[0], inlist[1]
outlist = [ (y+1, x+2), (y+2, x+1), (y-1, x+2), (y-2, x+1), (y+1, x-2), (y+2, x-1), (y-1, x-2), (y-2, x-1) ]
return outlist
for i in range(3):
moved_list = []
for j in position_list:
moved_list += knight_move(j)
position_list += moved_list
position_list = list(set(position_list))
target = tuple( int(v) for v in input().split() )
if target in position_list:
print("YES")
else:
print("NO")
Konton7