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.