Need help CAKEDOOM

link to question https://www.codechef.com/problems/CAKEDOOM

my solution https://www.codechef.com/viewsolution/27233088

please tell me why my solution is wrong