Chef and Round Run Help

Question Link - https://www.codechef.com/AUG16/problems/CHEFRRUN
My Solution Link - https://www.codechef.com/viewsolution/37181940

I am trying to do this question using Strongly Connected Components. Any idea on how to optimize code more for not getting TLE in last case ?

You can check your AC solution here: SAME SOLUTION AC

Check it out and you will get your mistake.

1 Like

Oh, Thanks. Never thought this can make code give TLE. Will keep this in mind now. Thanks :slight_smile:

1 Like