Hi,
I am trying to solve to solve this question.
I have also read the editorial 2-3 times but i am not getting the basic concept on how to solve this question.
Please help.
# | 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 | 150 |
Hi,
I am trying to solve to solve this question.
I have also read the editorial 2-3 times but i am not getting the basic concept on how to solve this question.
Please help.
Name |
---|
Which part? Trie stuff or game theory? Game theory in this problem is simply calculating the winner for each state of the game. If you can move the other player into a losing state from somewhere it is a winning state else it is a losing state. And if the state is a leaf of trie it is a losing state.
EDIT 1: And for this problem you need to calculate "can you lose if you want to" too in a similar way.
Game theory part.Am not clear what the states actually represent and how transition is done among states.Trie part is clear
As i said you need to calculate can you lose if you want to in a different array. But think for the normal problem first.Here is my submission 7403866 (yeah debugs everywhere). Each node of trie represents the string made by chars you have to pass through starting from the root. And you can calculate is a string is a wining or losing state for the Player Making Move On It(PMMOI) by checking each valid string you can make your move. If any of them are losing states for the PMMOI your string is a winning state because if you make that move other player will lose. But if there is no such move you will lose. You can fill the array win[] which holds is that stae is winning or not by iterating all trie array backwards because all childs of a node have a bigger id than that node. I fill the array lose at the same which holds can you lose if you want to for that string same way. After you have this information you can know which player can win or lose a one game you can find out who will win the Kth game.