P10396 Champion Frog...

Background

After breaking out of prison, the little frog started to focus on physical training. He became a sports **champion**. His story continues...

Description

**This is an output-only problem.** Your brain needs training. You are a bot. You have a memory array of size $300$ (indexed from $1\sim 300$), initially all $0$. Each cell stores a $32$-bit integer (i.e., `int` in C++). You need to construct a grid graph. Some grid nodes contain an instruction, and the robot operates and moves according to these instructions. In the following, nodes that have instructions are called special nodes. The instructions on nodes are of the following types: - Increment/Decrement: increase or decrease the integer at some memory index by $1$, then move one step in a specified direction. - Compare: compare the values at indices $i,j$ in memory, then move one step in a specified direction based on the comparison result. - Input: the robot starts from here, then moves one step in a specified direction. **This node must not be visited more than once.** - Output: when the robot reaches this node, it stops and outputs the values at specified positions. **The input node and the output node must both exist and be unique.** Tasks: 1. Read $a,b$ into the initial memory indices $1,2$, and output $a+b$. It is guaranteed that $0\leq a,b\leq 100$. 2. Read $a$ into the initial memory index $1$, and output $2^a$. It is guaranteed that $0\leq a\leq 20$. 3. Read $a$ into the initial memory index $1$, and output $a^2$. It is guaranteed that $1\leq a\leq 1000$. 4. Read $a,b$ into the initial memory indices $1,2$, and output $a\oplus b$. It is guaranteed that $0\leq a,b

Input Format

N/A

Output Format

**This problem is judged with `Special Judge`.** For the $6$ tasks given in the statement, you need to submit your output files `robot1.out~robot6.out` respectively. For each file, your output should have the following format: The first line outputs two positive integers $n,m$, indicating that the grid size is $n$ rows and $m$ columns. You must ensure that $n\times m\leq 10^7$. The second line outputs a positive integer $k$, the number of special nodes. Here $1\leq k \leq n \times m$. In the next $k$ lines, each line has the following format: The first two output integers $x,y$ indicate that the special node is located at row $x$, column $y$, where $1\leq x\leq n,1\leq y\leq m$, and all $(x,y)$ are distinct. Then, depending on the node type, output different contents: - If it is an increment node, output `+`; if it is a decrement node, output `-`. Then output an integer indicating the memory index $i$ to increment/decrement, where $1\leq i\leq 300$. Finally output a character from `LRUD` indicating the moving direction (corresponding to left, right, up, down; the same below). - If it is a compare node, output `c`, then two integers $i,j$ indicating the indices to compare; you need to ensure $1\leq i,j\leq 300$. Finally output two characters from `LRUD`, indicating the moving direction when the value at index $i$ is greater than the value at index $j$, and when the value at index $i$ is less than or equal to the value at index $j$, respectively. - If it is an input node, output `i`, then output a character from `LRUD` indicating the moving direction. - If it is an output node, output `o`, then output an integer $p$ indicating the output size, followed by $p$ **pairwise distinct integers** $a_1\sim a_p$ indicating the memory indices you want to output. You need to ensure $1\leq p,a_i\leq 300$. **You need to ensure that among the special nodes you provide, the input node and the output node must exist and be unique.**

Explanation/Hint

The sample above gives a program that reads $a,b$ and outputs $\max(a,b)$. ------------ Scoring: If your output format is wrong or the result is wrong, you get $0$ points. Otherwise, for each test point, your score is related to the size of $n\times m$. Each test point has $2$ scoring parameters $c_1,c_2$. If $n\times m\leq c_1$, you get full points for that test point; otherwise, if $c_1< n\times m\leq c_2$, you get $60\%$ of the points; otherwise, you get $40\%$ of the points. | Task Id | $c_1 =$ | $c_2 =$ | pts | | :----------: | :----------: | :----------: | :----------: | | 1 | $6$ | $9$ | $10$ | | 2 | $9$ | $12$ | $15$ | | 3 | $9$ | $10$ | $15$ | | 4 | $35$ | $48$ | $20$ | | 5 | $499$ | $999$ | $20$ | | 6 | $3\times 10^3$ | $3\times 10^5$ | $20$ | ------------ The distributed `附件.zip` contains files that are helpful for solving the problem. - `./checker/checker.cpp`, whose implementation is roughly the same as the `Special Judge` used in evaluation. - `./toy/index.html` can be used in a browser. It is the web-based visualization tool for this problem; see the internal `instruction` for usage. Translated by ChatGPT 5