|
|
Try this 1 1 2 2 3 3 4 4 2 change 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. Disagree. There're only 7 cases to consider. Thenks, I have AC Edited by author 27.09.2013 15:34 Some test that helped me to go through WA 17, 27, 28, 57 10 1 10 2 10 3 10 4 Changes: 2 1 1 2 1 3 1 2 2 Changes: 1 1 1 1 2 1 3 2 4 Changes: 1 1 1 1 5 10 1 20 1 Changes: 1 I have WA at test #72. Could I get content of this test? Pls :) Edited by author 07.11.2010 22:46 test#1 1 1 1 2 5 5 5 6 ans#1 1 1 1 2 5 5 5 6 0 change test#2 1 1 1 2 1 3 1 4 ans#2 2 1 2 2 1 3 1 4 2 change test#3 1 1 1 2 1 3 2 2 ans#3 1 1 2 4 1 3 2 2 1 change Edited by author 03.11.2010 18:06 |
|
|