Is codechef judge broken?

These submissions differ only in lines 44-45


    l--; r--;
    if (c1[l] + c2[r] - 1 >= (r - l + 1))


    // l--; r--;
    if (c1[l - 1] + c2[r - 1] - 1 >= (r - l + 1))

Can anyone explain the reason behind this?

Looks very weird to me. Also, I couldn’t find any out of bounds that can cause any undefined behavior. Maybe @ssjgz knows.

1 Like

I also can’t find anything wrong. Since it was an external contest, I wouldn’t be surprised if the testcases were malformed.

Not a single Python AC, interestingly - Python will complain much more loudly if there are inputs missing.


You could probably test this by submitting something that just reads in input and asserts if it finds something wrong (including eof, etc).