School Team Contest #3 (Winter Computer School 2010/11) will be held on November 13 at 11:00 (UTC). This is the final team event of the series, and we will be glad to see both permanent participants and new teams.
The contest has been prepared by me, Artem Rakhov, Nikolay Kuznetsov and Ivan Fefer. All of us will soon go the ACM-ICPC regionals in St. Petersburg, and now the guys have to combine the preparations for the semifinals with writing problems for you. Special thanks for the translation of problems to Maria Belova.
Everyone can take part in it out of the competition (informal). Make up your mind :)
We decided to sum up contest results using the ITMO rating system, according to which team gets a score from 0 to 200 per contest. It will be used two best participations out of thee possible. I will not reveal secrets, saying that Gennady Korotkevich showed great results and secured the victory ahead of schedule!
Good luck in the upcoming competition, MikeMirzayanov and stern, but fair jury.
UPD. Statements in PDF: russian version and english version. The statements will be available when the contest starts.
not consecutively: 1 1 3 3 1 1 2 1 1 2 3 2 1
This problem is really good problem. I tried several times and finally get accepted :)
Let (G1,W1) (G2,W2) represent the goats and wolves on both sides of the river.
(2,2) (0,0)
(1,1) (1,1) // 1
(2,1) (0,1) // 2
(0,1) (2,1) // 3
(0,2) (2,0) // 4
(0,0) (2,2) // 5
Unless I misread the question somehow ...
"If in one place (on one of the banks or in the boat) the wolves happen to strictly outnumber the goats, then the wolves eat the goats and Vasya gets upset."
After the first move, there is 1 goat and 1 wolf on the left bank. Why will the goat get eaten? :(
"The boat can hold n animals and Vasya, in addition, he is permitted to put less than n animals in the boat."
There seems to be a contradiction. Firstly it says that the boat can hold n animals. Then it is stated that it can only hold at most n-1 animals. I guess I interpretted it wrongly and thought that the boat can hold at most n animals.
However, if that is the case, how can the input 3 2 return 11? You can only bring 1 animal over every time, and you need to bring at least 1 animal back. That means that the net movement of animals to the other bank is always 0.
Also, something seems strange. I think I can say that if the input is (m n) and the answer is -1, then for all input (k n) where k > m, the answer should also be -1. However, the answer for 2 2 is -1 and the answer for 3 2 is 11. There seems to be something wrong.
Did I misread the question somewhere?
Do you know who the setter of this problem is? Maybe we can ask him?
I don't see what's wrong with your solution either.
for input 2: