CHEFCH TLE Grader Bug

I think something is very wrong with the CHEFCH grader because I have

O(|S|)

solutions that work perfectly fine on my computer, with very big tests (

T=7

,

|S|=100000

), but I am getting timeouts. I also tested it with the CodeChef IDE and it worked with

T=7

and

|S|=10

.

In these solutions, I used either

getchar()

or

getchar_unlocked()

for I/O, but when I made a solution with the same basic logic that used

scanf()

for I/O instead, it passed as AC on all test cases. I am assuming that admins will be able to see my solutions at the link for my status of this problem, so I won’t share it here. I will note, however, that in the first two solutions, I assumed the input ended with a newline since CodeChef specifies their format in lines, and I usually take the definition of a line as a bunch of characters than end in a newline.

If I did something wrong that would yield a TLE in these test cases, please just comment that I did something wrong, but I don’t see how a TLE is possible with my previous solutions when my new solution is just about the same.

check if u have return 0;

I have

exit(0);

which usually works just fine on CodeChef. If that’s really the problem, that’s a bug with CodeChef’s grader.

I just got AC on CHEFEQ using

exit(0);

, so I don’t think that’s the problem.

I solved CHEFCH and there was no problem with my code so maybe check if u have infinite loop or smth…

I don’t. It works on the IDE for certain small test cases within Subtask 1 and on my computer for very big test cases within Subtask 3.

Now I’m certain there’s a bug because I was able to pass AC with all test cases with an almost identical solution to my previous ones.

I just noticed that it might’ve been because I assumed the input ended in a newline, but I’m pretty sure that’s a safe assumption.

The last input doesnt end with a ‘\n’…rather it ends with an EOF…so check for an EOF as well!!!

Cool, make sure you show it to us after the contest is over :slight_smile: have fun

Oh…Well, I think that’s kind of confusing, but OK. Thanks for telling me that, kunal361!