Showing posts with label unsolved. Show all posts
Showing posts with label unsolved. Show all posts

Sunday, November 28, 2010

Unsolved: Jumping Monkey & Assembly Line from SWERC

Today there will be no solution for solved problem, rather I would post my approach, code and test data for 2 unsolved problems in recent SWERC contest and you are invited find flaws in my solution.

Jumping Monkey

This is an interesting problem. I've used bitmask DP to solve it. Each state represents the possible locations of the monkey. Now if we shoot a particular tree, if there was a monkey in the tree, it will die and cannot move to neighboring tress. If the monkey was in any other tree, it will move to any of its adjacent trees (including the one we've just shot).