A O(1) solution times out to a problem that has constraints t <= 2e5

Revision en1, by NeverMa573r, 2023-04-15 20:56:39

Hi, in my solution below, I created a algorithm that uses only addition, subtraction, and some simple functions to get my answer. https://codeforces.me/contest/1811/submission/202086856 However, this O(1) solution times out to this problem : https://codeforces.me/contest/1811/problem/B

Can I have an in depth explanation as to why this is the case? I suspect it is because I'm using doubles, but even then I don't see how this can cause such it to be so slow.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English NeverMa573r 2023-04-15 20:56:39 536 Initial revision (published)