| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 2048 MB | 13 | 5 | 5 | 38.462% |
This is an interactive problem.
Two players, Red and White, are playing a game according to the following rules (inspired by the rules of "Magic: the Gathering"):
Given $L$, $n$, $r$, $m$, and $w$, select a player and play for that player against the interactor to win.
The interaction starts with reading the given game state.
The first line contains an integer $n$ ($1 \le n \le 1000$): the number of cards in Red's hand. The next $n$ lines contain $n$ integers $r_1, r_2 \ldots, r_n$ ($1 \le r_i \le 10^6$): the values of Red's cards, one value per line.
The next line contains an integer $m$ ($1 \le m \le 1000$): the number of cards in White's hand. The next $m$ lines contain $m$ integers $w_1, w_2 \ldots, w_m$ ($1 \le w_i \le 10^6$): the values of White's cards, one value per line.
Different cards may have the same value.
The next line contains an integer $L$ ($1 \le L \le 10^6$): the initial life total.
After reading all these values, print a single line containing either a word "Red" or "White". This denotes the player you will play for.
After that, the game starts with Red's turn.
At your turn, if you want to pass, print "pass". If you want to play a card from your hand, print "play $x$", where $x$ is the value of the card you want to play; that card must be available to you.
At the interactor's turn, read a line. This line says either "pass" or "play $x$", where $x$ is the value of the card that the interactor has played from the hand.
If the interactor's pass causes you to win, your program should print "win" and terminate gracefully.
If your pass causes you to lose, the interactor will print "win". After reading that line, terminate your program gracefully to receive the "Wrong Answer" verdict.
After printing something, do not forget to output end of line and flush the output. Otherwise, you will get the "Idleness limit exceeded" verdict. To flush the output this, use:
fflush(stdout) or cout.flush() in C++;System.out.flush() in Java;flush(output) in Pascal;stdout.flush() in Python;3 6 2 2 1 9 6 play 2 play 2 play 6 pass pass
White pass pass play 9 pass win
Camp > Petrozavodsk Programming Camp > Summer 2024 > Day 4: Danil Zashikhin && Atilla Gün Contest, supported by Pinely E번