пятница, 10 мая 2013 г., 6:45:54 UTC-5 пользователь Adii написал:
> Round 1C 2012,Problem A

Not sure what you mean here - problem is slightly modified Depth First Search. 
Do you really need STL for DFS? I think you can easily find handful of DFS 
implementations in any language on the web. Then there is question of what do 
you need to tweak a little bit to make it work in this problem - basically if 
in classical DFS you encounter the same vertex twice you just skip it (this is 
usually done by marking vertices on the first visit), in Diamond inheritance 
problem the fact that you encountered the same vertex twice is the moment you 
looking for - you can immediately withdraw from the search and answer to the 
test case is "YES". In case you did a full DFS search starting from all 
vertices one by one and never encountered same vertex twice in the process - 
answer is "NO".

DFS algorithm is something you should definitely have in your toolbox (as 
stated in another post of mine).

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-code/-/0QhwuuD0nHEJ.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to