ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1809. Chapaev and Potatoes

hint
Posted by ASK 28 Mar 2014 20:30
There are too many different cases to consider, use a brute-force approach to get AC on the first attempt with one page of code:

1) write a function that checks that the situation is good;

2) for every coordinate make a list of four interesting values (all values taken by existing potatoes and some others if this is not enough);

3) try all possible ways to move none, one, or two potatoes, so that the coordinates of the new position are from the interesting values.
Re: hint
Posted by Vert 6 Oct 2015 04:14
Disagree.
There're only 7 cases to consider.