No.232 Meguru Wanders (2)
タグ : / 解いたユーザー数 159
作問者 :
LayCurse
Problem Statement
Charo, Senpai!
This game?
Right now, I, Meguru, am playing an old classic RPG!
Brings back memories, doesn't it!
I'm trying out a cheat trick listed in one of those cheat-encyclopedia books, but the conditions are really complicated...
You move the hero's party with the D-pad, and once every $10$ frames they move according to the keys being pressed at that moment.
When you jump into this whirlpool, you warp to the middle of the desert, and then $10T$ frames later, that is, after moving exactly $T$ times, you have to arrive exactly at a certain square!
If I stop along the way, I lose track of which frame I'm on, so I want to keep moving the whole time, but I wonder if that's even possible...
Senpai, please help me!
Let me explain the situation in a bit more detail.
The D-pad has $4$ keys: up, down, left and right. You can't press up and down at the same time, or right and left at the same time, but you can press, say, up and right at the same time.
For the $T$ moves: if you're pressing the up key you move just $1$ step up, if you're pressing the right key you move just $1$ step right, and if you're pressing both up and right you move to the place $1$ step up and $1$ step right!
The place you warp to is in the middle of the desert with no obstacles or anything, so you can move around freely.
Oh yeah, the destination is the place reached by going $A$ steps up and $B$ steps right from the middle of the desert!
Huh? Why not just move to the destination and wait there the whole time?
You have to "arrive" at that square from a different square exactly $10T$ frames later, otherwise it doesn't count...
Ugh, why are old games always like this?
Input
$T$ $A$ $B$
$1 \leq T \leq 100000 = 10^5$
$0 \leq A \leq 100000 = 10^5$
$0 \leq B \leq 100000 = 10^5$
Output
If you can arrive at the destination square by moving exactly $T$ times, print $\verb|YES|$ on the $1$st line.
Then, on the following $T$ lines, it seems you print the D-pad keys pressed for each move.
Represent the up key with the character $\verb|^|$, the down key with $\verb|v|$, the left key with $\verb|<|$ and the right key with $\verb|>|$.
In other words, each line should be a string of $1$ or $2$ characters.
It seems there's no rule about which character has to be printed first, but you have to be careful not to print things like the up key and the down key on the same line...
Hey, wait, are you listening, Senpai!?
If it's impossible, you just print $\verb|NO|$ on a single line.
Also, this problem uses a special judge, so an invalid format probably goes straight to $\verb|WA|$...
It seems the samples are included in the judge's test cases too, so make sure to check them properly!
Sample
Sample 1
Input
5 5 5
Output
YES ^> >^ ^> ^> >^
You just keep holding up-right the whole time!
It'd be easy if it were always like this...
Sample 2
Input
4 1 1
Output
YES >^ >^ < v
It's a path like $(0,0) \to (1,1) \to (2,2) \to (2,1) \to (1,1)$!
Sample 3
Input
3 1 4
Output
NO
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。