Execution time difference in practice section and in contest

I was solving a problem from Dec15 challenge https://www.codechef.com/problems/CHEFFILT which i had previously solved in the challenge itself. The execution time of the problem was 0.99 sec when i solved in the contest https://www.codechef.com/viewsolution/8954488 … But when i resubmitted the exactly same solution in practice section it show tle in the last case https://www.codechef.com/viewsolution/10825465 … Why did this happen?

3 Likes

Your code ran in 0.99 seconds which is only ~0.01s from the time limit. Execution time is not constant for a given program. I’ve seen it fluctuate by around 0.01-0.03s in my submissions.

2 Likes

Thanks for the explanation

2 Likes

You’re welcome!