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?
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;
/*Your code */
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.