C++ abs() causing TLE?

Revision en1, by iamujj15, 2022-08-27 20:30:51

In the last Educational Codeforces Round 134, I did a submission for Problem B. In this submission, I got a TLE. While this submission got Accepted.

The only difference both of these codes are having, is of the "abs()" function. When I used "abs()" (Although, it was redundant) it gave TLE, no loops nothing. And when I just removed (effectively) "abs()" in it, it got Accepted.

I'm wondering if "abs()" alone can cause this TLE, or there is something, very subtle about it, which was causing it. Please refer to the Links given above for both of my submissions and, in case you want to see it, the problem.

Tags tle, c++

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English iamujj15 2022-08-27 21:37:58 314 Tiny change: 'oblem.\n\n#Edit 1 : A' -> 'oblem.\n\n*Edit 1 : A'
en1 English iamujj15 2022-08-27 20:30:51 808 Initial revision (published)