dp and priority queue