5. On a grid paper, there is a 1x2011 strip, with the number 1 written in the first cell and the number 2 in the last cell. Petya and Vasya take turns writing the numbers 1 and 2 in any of the free cells. Petya goes first and writes only ones, while Vasya writes only twos. When the free cells run out, Petya counts the number of pairs of adjacent cells with the same number, and Vasya counts the pairs with different numbers. If Petya's number is greater, he wins; otherwise, Vasya wins. Who will win with the correct strategy?
Answer: Vasya. Solution: Let's divide the cells of the strip from the second to the 2011th into pairs of adjacent cells («dominoes»). Additionally, mark the cell 2010. Vasya's strategy: 1) as long as the marked cell is empty, after each of Petya's moves into a cell of some domino, move into the other cell of the same domino; 2) if Petya makes a move into the marked cell and the game is not yet over, make a move into any cell of any empty domino and mark the second cell of this domino. It is easy to verify that with such a strategy, after each of Vasya's moves, the marked cell is empty, the second cell of the same domino is filled, and in all other dominoes, either both cells are empty or both cells are filled. Moreover, by parity, the last move is Petya's, so Petya will not be able to force Vasya to make a move into the marked cell. Therefore, Vasya will always be able to make the necessary move.

By playing this way, Vasya will ensure that at the end of the game, each domino contains two different digits, and he will win because there are 1005 dominoes, and the total number of pairs of adjacent cells on the strip is 2010.