[Graphs] Snake mask

Revision en2, by calmhandtitan, 2015-07-22 10:47:09

From quite a long time I was trying to solve this problem 225D - Snake, but I am stuck on how to create a mask for this snake and how to extract information from the mask for doing further BFS.

I referred to I_love_Tanya_Romanova's solution 4086309 for the same, but was unable to understand the magic behind his mask.

So can someone help me understanding how to create mask for this problem.

Many others have used a hash function to solve this problem. I wonder how?

Tags bfs, bitmask, graph

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English calmhandtitan 2015-07-22 10:47:09 0 (published)
en1 English calmhandtitan 2015-07-22 09:01:44 532 Initial revision (saved to drafts)