問題一覧 > 通常問題

No.232 Meguru Wanders (2)

レベル : / AI推定難易度 : 975 / 実行時間制限 : 1ケース 1.000秒 / メモリ制限 : 128 MB / スペシャルジャッジ問題 (複数の解が存在する可能性があります)
タグ : (AC するまで非表示) / 解いたユーザー数 159
作問者 : LayCurse
お気に入りにしたユーザー ProblemId : 498 / 自分の提出
問題文最終更新日: 2026-06-29 08:20:26
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 112 (順位表) の他の問題:

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もしくは右上の雲マークをクリックしてアカウントを作成してください。