Holiday Accommodation question

sir,
while submitting the code at SPOJ it’s showing runtime error.
can you check it once
here is my code
https://ide.codingblocks.com/s/65649

Hi,

increase the list size of v to 100001 from 10000 ( it is showing runtime error for n=100000)

Hit like if you get it!
Cheers! :smiley:

I have coded as explained in video and it passes all sample cases also. But shows TLE on submission.
https://ide.codingblocks.com/s/72367
Please Help

I have modified somewhat https://ide.codingblocks.com/s/72400 but still same problem.
Please help

it is showing wrong answer not TLE.

It shows “Time Limit Exceeded” error when the code is run on SPOJ HOLI problem.

Moreover i would like to have some suggestion on how to correct it, please !

the same problem is occurring with me. I write exact code as explained in video by prateek bhaiya. then why I am getting the time limit exceeded!. please help me

my code link: https://ide.codingblocks.com/s/415095