Help with TLE

Problem : TREDIFF Problem - CodeChef

Solution : CodeChef: Practical coding for everyone

First, you should clear adjacency lists between test cases

Also, you might get WA on top of that, because on line 67 you should include 100

1 Like

Mine gives TLE too. Sub-tasks passed, but TLE for the second task.
Submission.

Use fast I/O (and get rid of endl)

1 Like

It Worked! Thanks!

thanks a lot, you are very helpful, great to have you support here. :muscle: AC.