Half test case passed

https://ide.codingblocks.com/s/204881 .please help
do i need to sort vector ??

yes u need to sort the vector
with respect to increasing end time

can u please check my code https://ide.codingblocks.com/s/204881 .after sorting still getting wrong answer

added comments where ur code was wrong