#P15861. [LBA-OI R3 A] A_Step_Back
[LBA-OI R3 A] A_Step_Back
Description
We use to denote the length of the sequence .
Given an integer , you are required to construct a sequence that satisfies:
- For all , .
- There are exactly pairs such that and .
You must ensure and minimize the length of the sequence. It can be proven that there exists a sequence with the minimal length satisfying the conditions.
The special scoring rules are detailed in the data constraints.
Input Format
A single integer on a line.
Output Format
The first line outputs the length of the sequence. The second line outputs integers separated by spaces, representing the constructed sequence.
0
2
114 514
15
6
1 4 16 64 512 32768
Hint
For of the data, .
| Subtask ID | Special Property | Score | |
|---|---|---|---|
| ✗ | |||
| ✓ | |||
| ✗ | |||
| ^ | |||
| Unrestricted | ✓ | ||
| ^ | ✗ |
Special Property: There exists a positive integer such that
Additionally, each test case has the following special scoring rule:
Let be the minimal possible length of , and be the length of your sequence . If the test case is worth points, you will obtain
$$\left\lfloor P\times \frac{\left\lfloor 100\cdot\left(\frac{s+114}{l+114}\right)^{1.14} \right\rfloor}{100} \right\rfloor$$points. There may be minor differences due to precision issues.
京公网安备 11011102002149号