Confusion About TLE

Hi all,

I keep getting TLE on a current competition question. Since I don’t wish to discuss this problem in particular or really anything about the question itself, I will keep things very general.

I have written C++ code that finally gets past the WA barrier and into correct numbers. However, it receives TLE according to the judge. In an attempt to see which problems / corner cases have given it the most trouble, I’ve implemented a simple stopwatch using std::chrono and some timepoint checks. I’ve made sure to include all I/O for the problem before the stopwatch clicks back in. The results are confusing.

When putting in a maximum size input file (according to competition specifications), every single test case comes to under 150 microseconds and all except one (the first one, which reads the standard fast IO statements) comes under 50 microseconds. Even if the judge file is 1000 of the worst case in my simulated test, that is still only 0.15 seconds. And yet my program receives TLE even in the restricted case!

Now, I ask the question–what could possibly be the cause of this TLE? Is it a corner case I haven’t considered, or do I need to find another way to measure the time of the program that is more accurate? Because right now to me it feels as though the judge itself is flawed.

Thanks,

-Voxelated

Hello voxelated,

Does the competition question being solved by you doesn’t even have one successful submission

Or accuracy>0.0

if no

then the problem is well and good and your approach is wrong try more optimized approach or a adequate data structure

if yes

this block rarely executes as if something is wrong with the problem Codechef community will help fix the problem, let the problemsetter know and rejudge all the submissions for that problem.

finally

Don’t worry and try and try until you get AC :slight_smile: