queue算法中一般要用到的有
q.empty()若队列为空,返回true,否则返回false
q.size()返回队列中的元素个数
q.pop()删除队首元素
q.front()返回队首元素的值 ,但不删除该元素(仅适用于FIFO队列 )
q.back()返回队尾元素的值,但不删除该元素(仅适用于FIFO队列)
q.top()返回具有最高优先级的元素的值,但不删除该元素
q.push()对queue在队尾压入一个新元素
对priority_queue在基于优先级的适当位置插入新元素
A friend of you is doing research on the Traveling Knight Problem (TKP) where you are to find the shortest closed tour of knight moves that visits each square of a given set of n squares on a chessboard exactly once. He thinks that the most difficult part of the problem is determining the smallest number of knight moves between two given squares and that, once you have accomplished this, finding the tour would be easy.
Of course you know that it is vice versa. So you offer him to write a program that solves the ”difficult” part.
Your job is to write a program that takes two squares a and b as input and then determin