WTH is wrong with Python/pypy SAVWATER (TLE)

How can adding a comment on top make a code run?

AC (any comment on top) - CodeChef: Practical coding for everyone
TLE(original code) - CodeChef: Practical coding for everyone

The problem lies somewhere in the functions I wrote between lines 1-57 ( which are not necessary for the problem at all). Commenting out/ removing even one of the functions also makes the code run.

TLE (Original ) - CodeChef: Practical coding for everyone
AC (one the functions removed) - CodeChef: Practical coding for everyone

A similar thing happened during prev April Cookoff Div2 Problem A, where I had to change my input statement to get over TLE. ( I was taking input in a list and then converting it to set)

TLE - CodeChef: Practical coding for everyone
(using stdin which is probably is the fastest )
TLE - CodeChef: Practical coding for everyone
(using input().split() and map it to list of int)
AC - CodeChef: Practical coding for everyone
(using input().split() and map it to set of int)

Idk why all of these errors occured, please let me know, and thank you for going through my doubt.

1 Like

You didn’t even use those functions (You declared them, but never called them). Even then there is a huge difference in execution times :thinking:.

@admin might want to resolve this issue ASAP.

I don’t think it should matter. It never does. I use this same template for all the platforms ( Codeforces, Codechef, Hackerearth etc). And adding a comment on top to get over tle doesn’t make sense.

It’s a bug. It has nothing to do with adding or removing comments.