Computation - Task 9
Time limit1sMemory limit1024 MB
Write an instruction sequence in this restricted language that reads 16 reals and prints them in ascending order.
- Level
Medium5 of 10
- Topics
- Sorting, Implementation
- Solved
- No attempts yet
Problem
Let denote the result of the -th instruction. The permitted instructions, their syntax, and the result are listed below.
Here , where is the base of the natural logarithm.
The P, M, and * operators carry a penalty. See the grading section for details.
The operations have finite precision. Results are accurate only up to 90 digits after the decimal point, and the rest is rounded. Likewise, the argument of the adding constant instruction can have at most 90 digits in its decimal part.
For the left and right shift instructions, must be a non-negative integer not exceeding 10000.
For each instruction, the parameters and must be smaller than the current instruction number . Instructions run in order, one at a time.
Task 1: Given with , where and have at most 9 digits in their decimal parts, compute .
Task 2: Given with , where has at most 9 digits in its decimal part, compute .
Task 3: Given with , where has at most 9 digits in its decimal part, compute if , if , and if .
Task 4: Given with , where has at most 9 digits in its decimal part, compute the absolute value .
Task 5: Given with each , read as a binary number, where is the most significant bit and is the least significant bit. Compute its value in base 10.
Task 6: Given an integer with , output 32 integers giving the binary representation of . Print the most significant bit first and the least significant bit last. If has fewer than 32 bits, add leading 0s.
Task 7: Given integers with , compute the bitwise XOR of and .
Task 8: Given with , where has at most 9 digits in its decimal part, output .
Task 9: Given with , where each has at most 9 digits in its decimal part, print 16 real numbers that are the values sorted in ascending order.
Task 10: Given integers with and , compute the remainder when is divided by , that is, .
Output
The -th line describes the -th instruction. First, output a letter for the operation. Then output zero or more integers for its parameters. Put a single space between the operator and each parameter.
You can output at most lines.