luogu#P1915. [NOI2010] 成长快乐

    ID: 880 远端评测题 1000ms 125MiB 尝试: 0 已通过: 0 难度: 9 上传者: 标签>贪心2010NOI提交答案Special Judge随机化

[NOI2010] 成长快乐

Background

Description

Nemo is a carefree little fish with an initial weight of w0w_0. Cute Nemo wants to grow as fast as possible, so it needs to eat as much food as it can. Nemo’s favorite food is shrimp in the sea.

Nemo knows the following about the food: there are nn shrimps in the sea, numbered from 11 to nn, where the weight of shrimp ii is wiw_i. Regard the ocean as an X-Y coordinate system. At time 00, shrimp ii is at position (xi,yi)(x_i, y_i). Each shrimp moves in a straight line at a constant speed. The velocity vector of shrimp ii is (pi,qi)(p_i, q_i), which means that at time tt, its position is (xi+pit,yi+qit)(x_i + p_i \cdot t, y_i + q_i \cdot t).

Nemo is at position (x0,y0)(x_0, y_0) at time 00. It can move freely in the sea, but its speed does not exceed VV. Nemo hopes, through its own effort, to maximize the total weight of shrimps it eats within TT units of time (including time TT).

If Nemo and a shrimp reach the same position at the same time, and the shrimp’s weight is less than Nemo’s current weight, then Nemo can eat that shrimp. After Nemo eats a shrimp of weight wiw_i, its own weight increases by wiw_i. Note that shrimps do not eat Nemo, and shrimps do not attack each other.

Nemo wants you to help make a growth plan so that the total weight of shrimps it eats is as large as possible.

Output Format

For the given 1010 input files nemo1.in \sim nemo10.in, you need to submit the corresponding output files nemo1.out \sim nemo10.out.

The first line of the output file contains an integer kk, indicating that in your growth plan, Nemo will eat kk shrimps.

The second line contains a real number ww, indicating the total weight of shrimps that Nemo eats in your plan.

The next kk lines each contain 44 numbers t,x,y,st, x, y, s. This means that at time tt, Nemo eats shrimp numbered ss at position (x,y)(x, y). Here t,x,yt, x, y are real numbers, and ss is an integer.

To ensure the precision of the checker, it is recommended to output all real numbers with at least 66 digits after the decimal point. In the checker, two real numbers are considered equal if their absolute difference does not exceed 10410^{-4}.

5 1 6 0 0
1
5 2 2 0 0

1
5
5 2 2 1

Hint

Sample explanation

In this sample, Nemo eats shrimp 11 at position (2,2)(2, 2) at time 55. In fact, Nemo could reach (2,2)(2, 2) earlier, but the problem only requires that the speed not exceed VV.

Scoring

For each dataset, we set 99 scoring thresholds a10,a9,,a2a_{10}, a_9, \ldots, a_2. If your output is invalid, you get zero points. Otherwise, let the increase in Nemo’s weight in your plan be wuserw_{user}. Your score is determined by the following table:

Score Condition Score Condition
10 wusera10w_{user} \geq a_{10} 5 wusera5w_{user} \geq a_5
9 wusera9w_{user} \geq a_9 4 wusera4w_{user} \geq a_4
8 wusera8w_{user} \geq a_8 3 wusera3w_{user} \geq a_3
7 wusera7w_{user} \geq a_7 2 wusera2w_{user} \geq a_2
6 wusera6w_{user} \geq a_6 1 wuser>0w_{user} \gt 0

How to use the checker

In the checker directory, run ./checker in out in the terminal.

Here, in is the input file provided by the problem, and out is your answer file for that input.

The checker only verifies the validity of your output. Final results are subject to the online judge.

Thanks to @FlierKing for providing the SPJ and to @虞皓翔 for helping improve the SPJ.

Translated by ChatGPT 5