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