#P9218. 「TAOI-1」Apollo
「TAOI-1」Apollo
Background
Execution.
This problem was originally called std::cout << std::fixed << std::setprecision(1) << 6.5 << '\n';.
[The picture deleted by the person involved.jpg]
【Upd 2023/04/15 21:42】A set of hack testdata was added in Subtask 2, #13. Now, in theory, all -point submissions during the contest can only get points.
Problem Description
You are given decimal numbers .
For a number , define its precision as the smallest non-negative integer such that is an integer. For an integer , define . For two decimal numbers , define as the minimum value of over all numbers .
For all , you need to compute and output the value of .
A decimal number is defined as a number that has an integer part and a fractional part, and whose fractional part is not . The reason it is described in such a silly way is that the input guarantees every number has a decimal point, but it seems no matter how it is written, someone will complain. Sorry about that. So I still have to look at the picture deleted by the person involved. So if I write some nonsense here, can anyone see it.
Input Format
The first line contains an integer .
The next lines each contain a decimal number .
Output Format
Output lines. Each line contains an integer, representing the answer for .
5
11.4514
11.4778
11.1338
11.1236
11.4789
10
11
9
9
11
8
1.1145
1.114
1.1145
1.514
1.19198
1.1154
1.114
1.1145
24
21
24
10
18
22
21
24
Hint
Constraints
This problem uses bundled tests.
Let .
- Subtask 1 (15 points): , , .
- Subtask 2 (15 points): , , .
- Subtask 3 (20 points): .
- Subtask 4 (15 points): .
- Subtask 5 (35 points): No special constraints.
For all testdata, , , , it is guaranteed that has no trailing , and it is not guaranteed that are pairwise distinct.
Sample Explanation
Take as an example:
- : take , .
- : take , .
- : take , .
- : take , .
- : take , .
Therefore, $\sum\limits_{j=1}^n g(a_1, a_j) = 4 + 2 + 1 + 1 + 2 = 10$. For the same , among all the given above, there may also be other different such that is also minimal.
Translated by ChatGPT 5