MXFACS - Editorial

time complexity in this question comes out to be O((Tsqrt(N)) which comes to be 310^7.5 which comes out to be more than 10^7 then why it is not resulting in TLE or is it 10^8 . I am pretty confuse in time complexity whether it should be 10^7 or 10^8.

You should not only consider the number of operations, but also the complexity of each operation when accounting for total execution time.

As in, 10^9 increments on an int variable can be performed in less than a fraction of a second, if the compiler is smart enough.

Like 10^7 is fine in code chef, but here it’s not always 10^7 like if you reduce N with found factors, it will be less actually.

1 Like