guessing the game

c

#1

getting tle in guessing game bcoz of nested loops , any alternative??


#2

Try different approach, be more mathematical, just a hint: there is no Nested loop required.

No more hints, cos its ongoing Contest. more detailed hints will be against rules


#3

okay thanks


#4

How did you decide, you are getting TLE becoz of nested loop ?
If your nested loops are if & else only, they won’t effect your time much, they are O(1).

Hint : Most probably, problem is somewhere else.


#5

somewhere else means???


#6

If you are using some loops such as for and while which run for long time with large inputs then it will show TLE because your program didnt stop in the stipulated time.


#7

the solution is o(1) for each test case :smiley: . 3-5 line answer(excluding includes and declarations). purely mathematical.