We have set of vertixes $G$ and 4 types of queries:↵
↵
1. Add/Remove direct edge $(uv)$.↵
2. Mark vertex $v$.↵
3. Check for some vertex $v$ if there is a path from marked vertex $u$ to $v$.↵
↵
$N <= 1000000,Mqueries <= 1000$,↵
Should be better $O(N^2)$, online.↵
↵
I have no idea how to solve this, any hint?
↵
1. Add/Remove direct edge $(uv)$.↵
2. Mark vertex $v$.↵
3. Check for some vertex $v$ if there is a path from marked vertex $u$ to $v$.↵
↵
$N <= 1000000,
Should be better $O(N^2)$, online.↵
↵
I have no idea how to solve this, any hint?