刷题时的一些小经验: 队列使用collections.deque() 或 list模拟指针, 不要使用queue.Queue() 优先队列使用heapq, 不要使用queue.PriorityQueue()