https://www.spoj.pl/problems/DAGCNT2
Please anyone give me some hint about the proper algorithm to solve it. My solution run in O(n^2) (and got TLE) @@.
Please anyone give me some hint about the proper algorithm to solve it. My solution run in O(n^2) (and got TLE) @@.