| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 2048 MB | 12 | 4 | 4 | 80.000% |
Your best friend Ken has really gotten into the new Street fighter game (Ultra Ultimate Street Fighter 2 Turbo Championship Edition DX+ \& Knuckles). Unfortunately, he is not very good yet, especially on defence, and really wants to attend the Fighting Pro Cup (FPC) in a few months. To get better, he has set up a training mode room where he can set a dummy computer player to fight him one on one using a specific set of actions. Reyn's goal is to consistently hit the training mode dummy without getting hit. To give him an example for how to always play optimally under these particular circumstances, you have decided to write a program that, provided with any computer player actions, always hits the dummy with an attack first.
The fight starts with the player and the dummy $n$ spaces away from each other. They then proceed to take turns taking actions at a regular interval of $1$ unit of time (the dummy takes an action, then the player takes an action $1$ unit of time later, followed by the dummy taking an action $1$ unit of time after that). The completion of every action takes two units of time, but some moves have an additional cooldown of $\mathit{2$ or $\mathit{4}$ units of time after the move is finished}, in which no action can be taken, effectively "skipping" the user's next move(s). The player and the dummy both have a predetermined set of actions to choose from, detailed below:
Training Mode Dummy:
W")
J")
K")
H")
Player:
N")
K")
H")
S")
This is an interactive problem. Your submission will be run against an interactor, which reads the standard output of your submission and writes to the standard input of your submission. This interaction needs to follow a specific protocol:
The interactor first sends one line containing one integer $n$ ($1 \leq n \leq 100$), the initial number of spaces between the players. After that begins the following process:
-" to signify a cooldown.-" to signify a cooldown.This process continues until either player manages to land a successful attack within its range on the other player. A test is considered passed if, at the end of the process, the only successful attack to end the game is made by the player. A correct solution is indicated by the interactor by inputting the symbol "V" on the last line. Tests with no correct solution possible will not be used.
To prevent infinite loops, the dummy makes a move forward ("W" or "J") at least once every five moves. Additionally, a limit of $1000$ moves has been placed on the number of actions the player can make, after which the solution will be considered incorrect.
Make sure you flush the buffer after each write.
A testing tool is provided to help you develop your solution. Instructions on how to use it can be found in the comments at the top of that file.
3 W K V
K
3 K - V
H -
6 H - W H - J V
H - H - H -