Getting TLE for latest G++23 and 20 but solution is accepted in G++17.

Revision en2, by I_am_Mahi, 2025-01-14 14:00:28

I was solving a question Weird Sum, I wrote a solution and according to me it was within the constraints. It passed sample test cases on VS code but when I submitted it on the codeforces it gave TLE on the sample test case only. I tried changing the version of G++ and it worked. It got accepted on G++17. However, I cannot understand what my mistake was and what the improvements could be.

(Here's my submission: https://mirror.codeforces.com/contest/1648/submission/300963112)

Tags c++ compilers, tle, size_t, long arithmetic

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English I_am_Mahi 2025-01-14 14:00:28 85
en1 English I_am_Mahi 2025-01-14 13:58:31 512 Initial revision (published)