Hostel Visit using PBDS

I used PBDS in hostel visit question which is in challenges-stl. It gave wrong answer to the last test case. Can anyone tell what could be wrong with my code?

this is my code