Hello,
My program continually TLEs on test case 10 (https://mirror.codeforces.com/contest/1344/submission/79225885) and I have no clue why. My code has passed larger cases quickly and I've yet to find bugs leading to infinite loops.
Any help would be greatly appreciated
If I'm not mistaken, in
isDAG
you don't do anything withvis2
, so your program could easily explode to be exponential.