Help for ELOMAX

https://www.codechef.com/viewsolution/37285290

Can anyone let me know what’s wrong/mistake in this submission?

this might help :https://www.codechef.com/viewsolution/37271939