POJ No.2341, priority queue, change a way of thinking the problem.