I had just taken in the input and outputed -1 for every query input.But still i received TLE on it.Have a look at my code
https://www.codechef.com/viewsolution/35689520
Can you believe it!!
Before this I had tried many solutions but i received TLE on each and every submission.Has anyone else faced the same issue?? What is the problem here.I think this contest has been ruined for me because of this issue.
2 Likes
Use β\nβ instead of endl
4 Likes
Many people donβt know the output buffer is flushed every time endl is used whereas β/nβ would fill up the output buffer and flush it only once at the end of the program.Using endl instead of β/nβ can cost you an AC solution
and for that I defined -
#define endl '\n'
Contest me ricks nhi lene ka
I asked the setter about this during the contest only and He said we have accepted solutions in almost all languages so the time limit is fine
Too fell into the endl trap