#P10400. 『STA - R5』消失的计算机

『STA - R5』消失的计算机

Problem Description

This is an output-only problem.

The judge has a positive integer nn (you do not know the exact value of nn).

You have 10310^3 variables p1,p2,,p103p_1,p_2,\cdots,p_{10^3}. Initially, p1=np_1=n, and p2=p3==p103=0p_2=p_3=\cdots=p_{10^3}=0.

You need to write a program to complete some tasks. Your program may use the following statements:

  • new x: set nn+1n\gets n+1, and pxnp_x\gets n.
  • dec x: set pxpx1p_x\gets p_x-1.
  • assign x y: set pxpyp_x\gets p_y.
  • iftry x goto l: if px0p_x \ge 0, jump to statement ll.
  • ifeq x y goto l: if px=pyp_x = p_y, jump to statement ll.
  • ifneq x y goto l: if pxpyp_x\neq p_y, jump to statement ll.

For the last three statements, if the current statement is statement l0\bm{l_0}, then it is required that l<l0\bm{l<l_0}.

You may not use more than 10001000 statements, and you may not use variables with indices greater than 10001000. The actual number of executed statements of your program may not exceed 10510^5.

Let the value of nn before running the program be the input, and the value of nn after running the program be the output. You need to complete the following 1010 tasks:

  1. Input nn, output 2n2n.
  2. Input nn, output (n2)\binom n2.
  3. Input nn, output 600600.
  4. Input nn, output n+1n + 1.
  5. Input nn, output n21n^2 - 1.
  6. Input nn, output n+2000n + 2000.
  7. Input nn, output n+log2nn + \lfloor \log_2 n\rfloor.
  8. Input nn, output n+(nmod2)+1n + \left(n \bmod 2\right) + 1.
  9. Input nn, output n+gcd(n,n4)+1n+\gcd(n, n - 4) + 1.
  10. Input nn, output a positive integer xx such that xnlnn30|x-n\ln n|\le 30.

Note: The subtasks are sorted by length, and this is unrelated to difficulty.

Input Format

This is an output-only problem. For each test point, the corresponding task can be found in the "Description".

Output Format

For the given 1010 tasks, you need to submit your output files 1.out to 10.out separately.

Each file should output several lines.

The first line contains a non-negative integer LL, representing the number of statements you use.

The next LL lines each contain one statement.

Hint

Scoring

For each test point, several groups of testdata will be evaluated.

If your output has any of the following issues, then you will get 00 points for that test point:

  • The output does not meet the requirement.
  • The actual number of executed statements is greater than 10510^5.
  • There are unrecognizable or invalid statements.
  • More than 10001000 statements are used, or variables with indices greater than 10001000 are used.

Otherwise, let the scoring baseline for the corresponding subtask be L0L_0. Then your score is:

$$\mathrm{score}=\begin{cases}11&L_0>L\\\Big\lfloor\frac{10}{\exp\left(1-\frac {L_0}L\right)}\Big\rfloor&\text{otherwise.}\end{cases}$$

The scoring baselines L0L_0 for each task are given below:

ID 11 22 33 44 55 66 77 88 99 1010
L0L_0 33 99 233233 11 1010 2929 1414 77 1818 1414

Constraints

It is guaranteed that 5n1005 \le n \le 100.

Translated by ChatGPT 5