Can anyone give reason as in why this O(n^2) * testcases approach getting TLE . This is November 2019 long Challenge question (PHCUL)

Here is mycode

Please can anyone give a genuine reason as in why am getting a TLE for this problem solution which is in python, because when solved using in same time complexity( O(n^2)*testcases ) in Java or C++, it gets complete AC.

python is too slow and time multiplier should be custom depending on the problem.(but cc says that it guarantees a solution to the question only in c++ and java)

and cf doesn’t even have a time multiplier(although pypy passes usually)

1 Like

Alright, Thanks !!