Hello Everyone, nice solutions placed all around :)
My question is the following:
I have solved the task based on exact same idea, DFS component check,
but where my solution differs is in using STL vectors for everything,
which seems to eat up memory.
Could you point me to some tutorial about memory management in competitive programming FOR C++?