Graph Problem
I was trying to solve this graph problem .
my idea is the same as the editorial but I get TLE in test 34 can anyone help me ?
here is my code
Codeforces Round 945 Solution Discussion (with myself)
Atcoder ABC #354 Solution Discussion