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

25667번 - Kitten's Computer 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 (추가 시간 없음) 1024 MB98375.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.

제한

예제 입력 1

<no input>

예제 출력 1

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.

  1. If your output exceeds 100ドル,000円$ lines, return WA and exit immediately.
  2. If your output contains an illegal instruction, return WA and exit immediately.
  3. Perform the following process 5000ドル$ times:
    1. Given are two 64-bit unsigned integers $x$ and $y$.
    2. Clear all registers to zero and make $a_1 = x$ and $a_2 = y$.
    3. Execute your program.
    4. If the runtime exceeds 70ドル,ドル return WA and exit immediately.
    5. Check if the value of $a_1$ is $(x \cdot y) \bmod 2^{64}$. If not, return WA and exit immediately.
  4. Return OK and exit immediately.

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번

채점 및 기타 정보

  • 예제는 채점하지 않는다.
(追記) (追記ここまで)

출처

대학교 대회

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

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