Number of Computations per second

I always wonder what is the number of computations that a codechef problem does in 1second.Is it of the order 10^8 or 10^9 if i have an algorithm which in worst case does 2*10^8 calculations per second will it get accepted if the time limit is given as 2 seconds?

1 Like

I guess you are correct. If you are doing too many computations inside a loop this may vary. You can always know the time for computation locally using the following code. Hope this helps!

using namespace std;
int start=clock();
/*Your code */
int stop=clock();


You cant decide about the computations done by codechef. Even for me i get many a a times time limit exceeded. It depends how many no. of test cases they have and how much time your algorithm takes to find the solution for maximum input size possible.