Hide

Problem I
Even Odd Game

Accepted submissions to this problem will be granted a score of 100

As every Saturday, Eve is paying her local game club a visit. Today, Bob has brought a new game he has designed on his own. After thorough investigation, you claim that there exists a dominant strategy, so one player can always win. Bob is hesitant to accept that his game is boring to play, so he challenges you to play a round! Since you claim that there exists a dominant strategy, you may determine who begins the game.

\includegraphics[width=0.78\textwidth ]{cards}
Figure 1: The cards in the two sample interactions.

The rules are as follows. There are $n$ cards on the table, each containing a maths operation (+ or *) and an integer, as shown in Figure 1. Eve and Bob alternate picking cards to manipulate a common number using one of the cards. For instance, if the current value of the number is $5$, and the card says $+3$, then the value gets updated to $8$. Each card can only be used once, and the game ends when all the cards have been used. The player who makes the first move wins if the final number is odd, and the other player wins if the final number is even. Given the list of cards and the starting value, help Eve win the game.

Interaction

The interactor begins by outputting the starting state of the game in the following format:

  • One line with an integer $n$ ($1 \le n \le 300$), the number of cards.

  • $n$ lines, each with a character $o$ and an integer $x$ ($o \in \{ $+$, $*$\} $, $1 \le x \le 10^6$) indicating one of the cards.

  • One line with an integer $x$ ($1 \le x \le 10^6$), the starting value.

It is guaranteed that the $n$ cards in the input are distinct.

Then, your submission must output one of “me” or “you”, depending on if you want to go first or you want the interactor to go first.

Then your submission and the interactor alternate outputting cards in the same format as above. No card can be played more than once. Your submission must exit when all cards have been played, regardless of which player made the last move.

Your submission will be accepted if it follows all the rules above and the final value has the parity indicated on the first line of your output.

Make sure you flush the buffer after each write.

A testing tool is provided to help you develop your solution.

Read Sample Interaction 1 Write
3
+ 7
* 4
+ 2
1
me
+ 2
* 4
+ 7
Read Sample Interaction 2 Write
2
+ 8
* 5
10
you
+ 8
* 5

Please log in to submit a solution to this problem

Log in