Logo
(追記) (追記ここまで)

28042번 - City Folding 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
0.1 초 1024 MB123675260.465%

문제

Joe’s bedroom is so dirty that the germs have developed civilization! They have communities and cities everywhere, and the bedroom is their world: Joe’s shoes are giant caves, his fishbowl is an ocean, his moldy pizza boxes are jungles, etc.

One of the biggest germ metropolis, Long City, is built on a long strip of paper left on the floor. It’s an awkward city layout, so the inhabitants decided to go three-dimensional: they will fold the strip several times and turn it into a stack! This way, transportation across the city will be much easier, by moving up and down across layers.

Specifically, the germs will repeat the following procedure $N$ times:

  • find the exact middle of the current strip;
  • then either fold the left side on top of the right side, or vice versa.

The result will be a stack of 2ドル^N$ paper layers.

Amelia is a powerful and wealthy amoeba who inhabits Long City, and like everyone else, she’s looking forward to the folding. However, she has a particular preference: after the folding process is complete, she would like her home to end up in the $H$-th layer from the ground, because $H$ is her lucky number. To achieve this, Amelia can influence the folding process: at each of the $N$ steps, she can decide whether to fold the left side over the right side, or vice versa.

Now she needs your help to decide the exact sequence of folds to perform. According to Amelia, if you were to divide Long City into 2ドル^N$ sections of equal length, her home would be on the $P$-th section from left to right. Given $N,ドル $P,ドル and $H,ドル find the answer she wants.

The figure below illustrates the first sample. Amelia’s home is on the fourth section of the strip, and after the three shown folds it ends up in the seventh layer from the ground.

입력

The input consists of a single line that contains three integers $N$ (1ドル ≤ N ≤ 60$), $P$ and $H$ (1ドル ≤ P, H ≤ 2^N$), indicating respectively the number of folds, the initial position of Amelia’s home on the strip, and the desired final height in the stack.

출력

Output a single line with a string of length $N$ such that its i-th character indicates how to perform the $i$-th fold. The uppercase letter “L” means folding the left side on top of the right side, while the uppercase letter “R” means folding the right side on top of the left side. It is guaranteed that a unique solution exists.

제한

예제 입력 1

3 4 7

예제 출력 1

LRL

예제 입력 2

4 16 16

예제 출력 2

LLLR

힌트

출처

ICPC > Regionals > Latin America > Latin America Regional Contests > Latin America Regional Contests 2022 C번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /