QOJ.ac

QOJ

总分: 100 仅输出

#12200. 成長快樂

统计

Nemo 係一條無憂無慮嘅小魚,初始體重係 $w_0$。可愛嘅 Nemo 希望盡快長大,所以需要食盡量多嘅食物。Nemo 最鍾意食海入面嘅小蝦。

Nemo 對食物嘅了解如下:海入面總共有 $n$ 隻小蝦,由 $1$ 至 $n$ 編號,其中第 $i$ 隻小蝦嘅重量係 $w_i$。將大海睇成一個 $X$-$Y$ 座標系,第 $i$ 隻小蝦喺時刻 $0$ 嘅位置係 $(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$ 行,每行有五個實數 $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$ 行,每行有四個數 $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}\geq a_{10}$ $5$ $w_{user}\geq a_5$
$9$ $w_{user}\geq a_9$ $4$ $w_{user}\geq a_4$
$8$ $w_{user}\geq a_8$ $3$ $w_{user}\geq a_3$
$7$ $w_{user}\geq a_7$ $2$ $w_{user}\geq a_2$
$6$ $w_{user}\geq a_6$ $1$ $w_{user}\geq 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.