TLE in GUESSNUM problem

For the above problem i am unable to understand why is it showing TLE
This is my solution CodeChef: Practical coding for everyone
please help

bro one problem which i saw is your code is taking a lot of memory and to compile that big code for large input it is taking more than given time