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 946 Solution Discussion