#P17237. 『STA - R10』介电常数

    ID: 19738 远端评测题 1000ms 512MiB 尝试: 0 已通过: 0 显示难度提高+/省选− 上传者: 标签>数学提交答案Special JudgeO2优化

『STA - R10』介电常数

Problem Description

You have 52 memory cells and 4 types of computation nodes. Initially, memory cell 1 and 2 store real numbers aa and bb respectively (0.09a,b0.10.09 \le a,b \le 0.1). The values in other cells are unspecified, and you are not allowed to reference them before assigning values to them.

You may use the following four types of computation nodes (the result of the ii-th computation is stored in memory cell i+2i+2):

  1. Constant node 0 c: returns the constant cc (up to 15 significant digits).
  2. Addition node 1 x y: returns the sum of the numbers in memory cell xx and memory cell yy.
  3. Multiplication node 2 x y: returns the product of the numbers in memory cell xx and memory cell yy.
  4. Function node 3 x s: returns the result of applying function s to the value in memory cell xx. Here s is one of the following strings: sin cos tan sec csc cot asin acos atan asec acsc acot (you may search for and understand their definitions on your own).

You need to complete the following two computation tasks:

  • A+B task: use only computation nodes 1, 3, and 4 to compute a+ba+b, and store it in the memory cell with the largest index among those you assigned.
  • A*B task: use only computation nodes 1, 2, and 4 to compute a×ba \times b, and store it in the memory cell with the largest index among those you assigned.

If the checker determines that the absolute error between your computed result and the correct answer is at most 10910^{-9}, your output is considered correct. The checker used for judging can be downloaded from the provided files. Due to floating-point errors, the final judging result is based on the checker.

Input Format

This is an output-only problem, so you can submit a compressed package of your answer directly. However, you may also choose to read the task number tt from input. Here, t=1t=1 means you need to solve the A+B task, and t=2t=2 means you need to solve the A*B task.

Output Format

The first line contains a positive integer nn, indicating the number of computation nodes you call (n50n \le 50).

The next nn lines each describe one computation node.

1

1
0 114514

Hint

The sample is for reference only and cannot get any points.

If you complete one task perfectly correctly, you get 50 points; otherwise, you get 0 points.

Translated by ChatGPT 5