QOJ.ac

QOJ

총점: 100 출력 전용

#12200. 成長快樂

통계

Nemo 是一條無憂無慮的小魚,它的初始體重為 $w_0$。可愛的 Nemo 希望自己能夠盡快地成長,因此需要吃盡量多的食物。Nemo 最喜愛的食物是海裡的小蝦。

已知 Nemo 對食物的情況了解如下:大海裡共有 $n$ 隻小蝦,從 $1$ 到 $n$ 編號,其中編號為 $i$ 的小蝦的重量為 $w_i$。將大海看作一個 X-Y 座標系,在 $0$ 時刻編號為 $i$ 的小蝦所在的位置為 $(x_i,y_i)$。小蝦在大海中作勻速直線運動,其中編號為 $i$ 的小蝦的速度向量為 $(p_i,q_i)$,即在時刻 $t$,它的位置為

$$ (x_i+p_i*t,y_i+q_i*t) $$

Nemo 在 $0$ 時刻的位置為 $(x_0,y_0)$,它可以在海中隨意移動,但速度不超過 $V$。Nemo 希望透過自己的努力,在 $T$ 個單位時間內(含 $T$ 時刻)吃到的小蝦重量總和盡量大。當 Nemo 與某隻小蝦同時移動到同一個位置上,且小蝦的重量小於 Nemo 當時的重量,則 Nemo 可以將該小蝦吃掉。當 Nemo 吃掉重量為 $w_i$ 的小蝦之後,它的體重將增加 $w_i$。注意,小蝦不會吃 Nemo,且小蝦之間也不會自相殘殺。

Nemo 希望你來幫助它制定一個成長計劃,使得它吃掉的小蝦重量總和盡量大。

輸入格式

該題為提交答案型試題,所有輸入資料 nemo1.in~nemo10.in 已在試題目錄下。

對於每份資料,輸入檔案中第一行為五個實數 $w_0,V,T,x_0,y_0$,分別表示 Nemo 的初始體重、最大移動速度、時間限制以及 Nemo 在 $0$ 時刻的位置。

第二行為一個整數 $n$,表示大海中小蝦的隻數。

接下來 $n$ 行,每行 5 個實數,包括 $w_i,x_i,y_i,p_i,q_i$,分別表示編號為 $i$ 的小蝦的重量、在 $0$ 時刻的位置和速度向量。

輸出格式

針對給定的 10 個輸入檔案 nemo1.in~nemo10.in,你需要分別提交你的輸出檔案 nemo1.out~nemo10.out。

輸出檔案第一行包含一個整數 $k$,表示在你的成長計劃中,Nemo 將吃到 $k$ 隻小蝦。

第二行包含一個實數 $w$,表示在你的成長計劃中,Nemo 吃到的小蝦的重量總和。

接下來 $k$ 行,每行 4 個數 $t,x,y,s$,表示在時刻 $t$,Nemo 在位置 $(x,y)$ 處吃掉了編號為 $s$ 的小蝦。其中 $t,x,y$ 為實數,$s$ 為整數。

為保證驗證程式的精度,所有實數建議至少輸出到小數點後 6 位。在驗證程式中,兩個實數絕對誤差不超過 $10^{-4}$ 時,即視為相等。

範例

輸入格式 1

5 1 6 0 0
1
5 2 2 0 0

輸出格式 1

1
5
5 2 2 1

說明

在這個範例中,Nemo 在時刻 $5$ 在位置 $(2,2)$ 吃掉了 $1$ 號小蝦。其實 Nemo 到達 $(2,2)$ 的時間可以更早,但題中僅要求速度不超過 $V$ 即可。

子任務

對於每組資料,我們設定了 9 個評分參數 $a_{10},a_9,\ldots,a_2$。如果選手的輸出不合法,則得零分。否則,設在你的方案中,Nemo 體重的增加量為 $w_{user}$,你的分數將會由下表給出:

得分 條件 得分 條件
$10$ $w_{user}\ge a_{10}$ $5$ $w_{user}\ge a_5$
$9$ $w_{user}\ge a_9$ $4$ $w_{user}\ge a_4$
$8$ $w_{user}\ge a_8$ $3$ $w_{user}\ge a_3$
$7$ $w_{user}\ge a_7$ $2$ $w_{user}\ge a_2$
$6$ $w_{user}\ge a_6$ $1$ $w_{user}>0$

如果有多項滿足,則取滿足條件中的最高得分。

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.