hmehta's blog

By hmehta, 3 years ago, In English

Topcoder MM 129 - is now live!

Your chickens have escaped from your barn and you need to catch them quickly! Luckily you have some friends who volunteered to help. You are given an NxN grid representing the layout of your farm. Each cell is either empty, a chicken, a wall or a person. Each turn you can move one or more people into an adjacent cell (horizontally or vertically) that is empty or contains a chicken. If the person lands on a chicken then you get (N*N - turnNumber + 1) points and that chicken is collected from the grid. Now the chickens make their moves. These chickens are clever so they will try to move away from the people. Specifically, a chicken will try to move into an empty adjacent cell (horizontally or vertically) that is not adjacent to a person. If there are multiple such cells then one will be selected at random, but if there are no such cells then the chicken will stay where it is. Your task is to score as many points as possible within N*N turns.

Here is an example solution for seed=1:

Problem Setter: dimkadimon
Problem Testers:JacoCronjesullyper,and kphmd

Compete here!

Best of luck!
- the Topcoder Team

  • Vote: I like it
  • +11
  • Vote: I do not like it

| Write comment?
»
3 years ago, # |
  Vote: I like it +17 Vote: I do not like it

This is why you should raise cows and not chickens smh.