Hostel visit problem

, https://ide.codingblocks.com/s/123328
plss tell me where i am wrong.

in line no 56 you have to pop element from last which is not possible in priority queue try to use map here