End of the World 2 : Help : WA

Hello Chefs, Will you please help me, I am getting WrongAnswer for the problem End of the World 2
Since 12 hours I am on this problem. Help please.

@admin will you please provide any corner TCs for this solution - https://www.codechef.com/viewsolution/29927294

do you have a loop with 3141^5 iterations??

No.
Why that many iterations?

That’ll give TLE right!!!?

in line 3: maxK=3141**5.
in line 56: for i in range(2,maxK+1)

Line 61 is having
if power>maxK :
Break

Power iterates from 2 to maxK+1, each time the power gets updated by power**3, and if it is greater than maxK, the above statement breaks the loop.

Oops I think I Missed something over there
I have to check.
But still my Solution is giving WA not TLE

run it locally and see what happens

1 Like