| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 3 초 (추가 시간 없음) | 2048 MB | 64 | 9 | 5 | 8.929% |
This is an interactive run-twice problem.
What is a game without a little gambling? But wait... we're serious people here, and gambling is not for us! Instead, let's dive into the world of encryption algorithms. However, to keep things intriguing, we will introduce a new encryption algorithm that uses randomness derived from rolling dice!
You will be given a number $x$ ranging from $0$ to $10^{100}$. Your task is to encrypt this number through a series of dice rolls and then decrypt it to return to the original value.
The encryption process consists of exactly $18\,500$ steps. At each step, you will be given three six-faced dice. The dice are fair: all faces have an equal probability of being selected. Each face of each die displays an integer from $0$ to $9$ selected uniformly at random, independently of the others. You will then select one of the three given dice. After that, the jury will roll your chosen die once, and record the outcome.
The program will run two times.
In the first run, the first line contains the number $1$. Then the jury's program prints a line with the number $x$ ($0 \leq x \leq 10^{100}$). After that, exactly $18\,500$ steps happen. In each step:
In every test, the jury's program produces the same output for the same input.
In the second run, the first line contains the number $2$. Then the jury's program provides a single line without spaces containing the results of the $18\,500$ rolls in the same order as the first run. The participant's program should then output the original number $x$ and terminate.
1 1 2 1 8 2 5 9 2 8 2 6 2 9 9 0 3 8 5 7 2 0 9 7 2 9 3 2 5 5 2 0 6 8 8 8 4 9 4 6 0 9 9 9 7 7 0 7 6 6 6 0 4 6 9 2 5 3 3 4 2 9 2 1 2 2 7 0 5 3 5 5 0 5 8 3 1 9 3 0 7 7 6 7 0 4 8 1 2 5 0 0 9 1 2 9 0 4 9 3 1 5 7 9 3 7 5 9 2 6 9 2 6 9 5 6 7 4 3 6 5 2 3 0 2 2 5 8 3 5 0 7 7 4 3 2 2 0 2 4 3 3 0 8 4 4 7 6 9 8 3 6 2 8 5 3 9 9 3 3 1 4 0 5 2 4 1 8 6 6 4 3 4 3 2 4 6 0 2 5 8 8 1 4 8 3 9 1 5 6 6 8
1 2 3 1 2 3 1 2 3 2
2 2639063848
1
The example contains only $10$ steps. This is only to demonstrate the format of input and output. During system testing, there will be exactly $18\,500$ steps.