Codeforces functionality may be limited from June 18, 19:00 (UTC) to June 19, 3:00 AM (UTC) due to technical maintenance. Polygon will work as usual. ×

TLE in GNU C11, AC in GNU G++ 14

Revision en2, by Hyperlink_Blocked, 2019-04-27 20:12:22

I was wondering why the exact same code

https://codeforces.com/contest/833/submission/53432006

gets a TLE on test 8 when submitted in C11 but

https://codeforces.com/contest/833/submission/53431981

gets AC when submitted in G++14. Does the C++ compiler optimize the operations or something? If I'm not wrong the complexity of this solution should be O(n log max(a*b)) (I assumed the complexity of cuberoot is log n, I don't actually know what it is).

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English Hyperlink_Blocked 2019-04-27 20:12:22 8 Initial revision
en1 English Hyperlink_Blocked 2019-04-27 20:02:40 495 Initial revision (published)