| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 (추가 시간 없음) | 1024 MB | 9 | 8 | 3 | 75.000% |
Kitten recently planned to build a computer of his own. The computer has 400ドル$ registers, each of which can store a 64ドル$-bit binary integer, that is, an integer in the range $[0, 2^{64} - 1]$. The value stored in the $i$-th ($i \in [1, 400]$) register is denoted as $a_i$. This computer supports 7 assembly instructions:
SET i j : Let $a_i := a_j$.XOR i j k : Let $a_i := a_j \oplus a_k$ ($\oplus$ is the bitwise XOR operation).AND i j k : Let $a_i := a_j \operatorname{\&} a_k$ ($\operatorname{\&}$ is the bitwise AND operation).OR i j k : Let $a_i := a_j \operatorname{|} a_k$ ($\operatorname{|}$ is the bitwise OR operation).NOT i j : Let $a_i := \operatorname{\sim} a_j$ ($\sim$ is the unary bitwise NOT operation).LSH i x : Shift $a_i$ left by $x$ bits. The vacant bit-positions are filled with 0ドル$.RSH i x : Shift $a_i$ right by $x$ bits. The vacant bit-positions are filled with 0ドル$.Note that you have to ensure that 1ドル \le i,j,k \le 400$ and 0ドル \le x < 64$.
You may think that this computer is not powerful enough, but the kitten's computer is not an ordinary computer! This computer has a powerful parallel computing method that can compute all non-interfering instructions simultaneously.
Formally, let us track $t_1, t_2, \ldots, t_{400},ドル denoting the times when the register values were assigned. Initially, all $t_i$ are zeroes. Whenever you execute a command, if it requires $a_{j_1}, a_{j_2}, \ldots, a_{j_n}$ as arguments to calculate, and outputs the result to $a_i,ドル then assign $t_i$ to $\max\{ t_{j_1}, t_{j_2}, \ldots, t_{j_n} \} + 1$. The runtime of your program is the maximum value of all $t_i$ generated during the sequential execution of all instructions.
Today, Kitten wants to use his computer to design a calculator. This calculator is used to quickly calculate the multiplication of 64-bit unsigned integers. At the beginning, registers $a_1$ and $a_2$ are set to two 64-bit unsigned integers $x$ and $y,ドル respectively, while the other registers are set to 0ドル$. You need to help Kitten design a series of instructions for his program so that the final value of $a_1$ is the result of multiplying $x$ and $y,ドル modulo 2ドル^{64}$.
Kitten requires that the total number of your instructions does not exceed 100ドル,000円,ドル and the runtime of your program does not exceed 70ドル$.
There is no input for this problem.
Output any number of lines (from 0ドル$ to 100ドル,000円$), each containing exactly one instruction formatted as shown above.
<no input>
NOT 2 1 RSH 2 63 NOT 3 1 RSH 3 62 NOT 4 1 RSH 4 61 LSH 2 1 LSH 3 9 LSH 4 3 OR 5 2 3 OR 1 5 4
The example output does not solve the problem, it is given only to demonstrate the format.
When checking your output, the checker will perform the following checks.
Note that the checker will only check the register $a_1$. The final values of all other registers can be arbitrary.
The 5000ドル$ pairs of $x$ and $y$ for the checker are fixed in advance.
Camp > Petrozavodsk Programming Camp > Summer 2022 > Day 3: Qingyu, flower and their friends’ Contest K번