REALBIN TLE for same logic for my submission as ACCEPTED

I don’t know if this exactly is against the guidelines, since the contest is over, please help as to why this is TLE, its a O(1) solution, what’s there to TLE. I’ve matched input for test case and two numbers. Output the value, worked and tested in my local setup.

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

While this submission by a different user following the same logic got accepted?

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

Could be as simple as the fact that you used endl instead of \n.

3 Likes

what ?? using endl instead of \n gives TLE. :expressionless:

@default619
@parag_619
endl is much slower than ‘\n’, there are many problems which will give you tle when you will use endl , it is highly recommended to use ‘\n’ , In today contest also many people got tle on problem REALBIN due to this .

1 Like

Had 5-6 TLEs in a row.
Incorporating the famous/infamous

#define fast std::ios_base::sync_with_stdio(0);std::cin.tie(0);std::cout.tie(0);

worked.

https://www.codechef.com/viewsolution/48160643
Checkout My Submission . I have converted endl to \n in the define process
still giving TLE

Try using fastio as well:

(or the post directly above yours :slight_smile: )

take long long int a , b instead of int and use fast IO

fast I/O.

I have defined int as long long int and using fast io too. ":slightly_smiling_face:. Still tle :man_shrugging:

link to solution ?

1 Like