#P12335. Construct an Input for the Interactive Randomness Problem
Construct an Input for the Interactive Randomness Problem
Construct an Input for the Interactive Randomness Problem
You are given an interactive program which processes an input string consisting of characters L
and R
as follows. The program initializes a state vector of 5 unsigned integers, with only the first element set to 1. Then for each character in the string (of length \(n\)), it updates the state with one of two transitions:
- For
L
: \[ \begin{cases} b_2 = a_1 + a_3 + a_4, \\ b_4 = a_2 + a_5, \\ \text{all other } b_i = 0. \end{cases} \] - For
R
: \[ \begin{cases} b_1 = a_2,\\ b_3 = a_1 + a_5,\\ b_4 = a_2 + a_3,\\ b_5 = a_2 + a_4,\\ \text{and } b_2 = 0. \end{cases} \]
After processing all characters the program outputs the value of \(a_1\) from the final state. Your task is to construct one input (i.e. one string) such that when the given program processes it, the final output equals \(n\) (the length of the input string).
For example, one valid solution is to output the string LRLRLRLR
of length 8. A simulation gives:
- After processing
L
thenR
: \(a_1 = 1\). - After processing the second pair
L R
: \(a_1 = 2\). - After the third pair: \(a_1 = 4\).
- After the fourth pair: \(a_1 = 8\).
Since the final \(a_1 = 8\) equals \(n = 8\), this input is acceptable.
inputFormat
This problem does not require reading any input. Your program should output one valid input string which, when fed into the given interactive program, makes its output equal the input string length \(n\).
outputFormat
Your program should output a string composed only of the characters L
and R
with the property that when processed by the provided program, its output equals \(n\) (the length of the string).
sample
LRLRLRLR