Codeforces celebrates 10 years! We are pleased to announce the crowdfunding-campaign. Congratulate us by the link ×

[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 - Змейка, 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


  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)