U475589 [REOI 436] Binary Computer
题目背景
This is Regule Aire Olympiad in Informatics 436 (Day 1, Problem 1).
----
**For technical issues, this problem is considered interactive. However, this is a normal Special Judge problem.**
---
As we all know, computers are made under binary system only consisting of $0$ and $1$. It is following four basic operations that created the beauty of informatics:
- $a \operatorname{and} b$;
- $a \operatorname{or} b$;
- $a \operatorname{xor} b$;
- $\operatorname{not} a$.
Today, you're going to implement a calculator by using them.
题目描述
You have to implement following functions:
- $\text{Task 1}$: Given $a,b$, calculate $a+b$;
- $\text{Task 2}$: Given $a,b$, calculate $a \times b$.
- $\text{Task 3}$: Given $a,b$, check if $a > b$.
**It is guaranteed that $a,b$ are 32-bit unsigned integers.**
All results should be taken modulo $2^{32}$.
To do this, you have to output a program.
For the program, you have $10^6$ **binary** (either $0$ or $1$) bits $B_1,B_2,\dots,B_{10^6}$, all of which are originally $0$. For bit numbered $x$,
- For $x \in [0,31]$, they indicate **little endian form** of $a$.
- For $x \in [32,63]$, they indicate **little endian form** of $b$.
- For $x \in [64,95]$, they should be the **little endian form** of the answer. For task 3, the $64$-th bit will be the answer ($1$ for yes and $0$ for no) **and $[65,95]$-th bits should be all zero**.
- For $x \in [96, 10^6]$, they can be used on your own without any additional constraints.
输入格式
The only line contains an integer $x$ representing the ID of text ($x \in \{1,2,3\}$).
输出格式
Output a program. The program can include at most $10^5$ lines of followings:
- `& a b c`, making $B_c \leftarrow B_a \operatorname{and} B_b$.
- `| a b c`, making $B_c \leftarrow B_a \operatorname{or} B_b$.
- `^ a b c`, making $B_c \leftarrow B_a \operatorname{xor} B_b$.
- `~ a b`, making $B_b \leftarrow \operatorname{not} B_a$.
- `!`, terminating the program and checking your answer.
If checker meets invalid instruction, you will get Wrong Answer verdict.
When your program ends, checker checks memory in $[64,95]$. If your answer is correct, you will get Accepted verdict. Otherwise, you will get Wrong Answer verdict.
**The sample does not show any answer to any subtask.**
说明/提示
#### Sample Explanation
If the input is $10100110$, from $0$ to $7$, it will be stored as $01100101$. Therefore, $B_1 \operatorname{and} B_5=1, B_2 \operatorname{or} B_6=1, B_2 \operatorname{xor} B_7=0$.
As a result, after executing the sample, there will be $B_{100}=B_{200}=1$ and $B_{300}=0$.
#### Hint
There are multiple test points for a task. **Please submit a program outputting your answer instead of files of answers.**
#### Subtasks and Constraints
| $\text{Subtask}$ | $\text{Task}$ | $\text{Score}$ | $\text{Constraints}$ |
| :-: | :-: | :-: | :-: |
| $0$ | $1$ | $10$ | $a,b \le 3$ |
| $1$ | $1$ | $20$ | |
| $2$ | $2$ | $10$ | $a,b \le 3$ |
| $3$ | $2$ | $30$ | |
| $4$ | $3$ | $10$ | $a,b \le 3$ |
| $5$ | $3$ | $20$ | |