Can someone help me in solving this game theory problem? I am not able to get the discussions /editorial , this problem is very tough . Please Help !!!!!!!!!!
Problem Link :
# | User | Rating |
---|---|---|
1 | tourist | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 161 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | awoo | 154 |
8 | Dominater069 | 154 |
10 | luogu_official | 151 |
Can someone help me in solving this game theory problem? I am not able to get the discussions /editorial , this problem is very tough . Please Help !!!!!!!!!!
Problem Link :
Name |
---|
First observation: the values of the stones by themselves doesnt matter, what matters is their value mod 3. In particular, what matters is the ammount of each stone on each mod value. From now on when i talk about value im talking about the value mod 3.
Second observation: you can never start with a stone that has value 0, so you will have to pick either one with value 1 or 2. After you pick a stone with value 2, you cant pick a stone with value 1, so you will have to pick a stone with value 2, and then you will have to pick a stone with value 1, and them two, and so it goes. The order you need to take the stones is fixed
Third observation: stones with value 0 essentially skip the turn. If the number of them is even, then nothing can be done because if you want to skip the turn the opponent can always skip back. If its odd, then you will be able to skip the turn if it favors you, even if the opponent tries to fight against that.
Solution: test for picking a stone with value 1 first, then for picking a stone with value 2 first. You will keep alternating between them after that, and the loser is the one who runs out of stones of the type he wants that turn (you also need to think of the scenario where all of the stones run out, which is really annoying). If the number of stones with value 0 is odd, then the loser is the opposite (because of the third observation). Then you pick which situation is the one that is better for the first player, because they are going to choose which one the game starts.