Inconsistency in Codechef Judge

Hello coders,

I sometimes feel that there is inconsistency in the reported time taken by Codechef judge and Online IDE.
Please see my two submissions:

  1. CodeChef: Practical coding for everyone
  2. CodeChef: Practical coding for everyone

Both submissions are exactly same and still one is TLE and other is AC for subtask #1.

Considering that test cases may be randomly generated, many times when I test my code on online IDE, I find my verdict: Time Limit Exceeded(5 Sec). but, when I resubmit exact same code it shows code executed in 0.02 Sec.

Can someone explain what I am missing?

3 Likes

They are not same…

One has ,

int l,r

#another has,

long int l,r

And you are comparing “int” to “long int” in the solution u got TLE…(i.e in condition of “for” loop because “i,j” are long int and “l,r” are int)

1 Like

keeping them in same data type may resolve ur issue…

Oops, Sorry submission id got changed I edited with EXACT same code.

  1. CodeChef: Practical coding for everyone

  2. CodeChef: Practical coding for everyone

Also, In CPP, it typecast accordingly. The problem arises if either of two value is above the range which was not the case here. Peace.

@vijju123 Can you help me with anything in this?

Let me have a look.

@admin you might wanna look into it!

If I am looking into it, it means that there is a high chance that I will drag @admin as well xD

Forwarded the case to them already, and they are looking over it.

any follow-up?

Most probably it is a judge issue. The issue was fixed a few months ago and they are contemplating on why this occurred. But nothing I said above is concrete- they are still looking over it - so it might not be the actual reason.

I’d automatically update if I receive any follow up from them dear. :slight_smile: