CF30C.Shooting Gallery
普及+/提高
通过率:0%
时间限制:2.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
One warm and sunny day king Copa decided to visit the shooting gallery, located at the Central Park, and try to win the main prize — big pink plush panda. The king is not good at shooting, so he invited you to help him.
The shooting gallery is an infinite vertical plane with Cartesian coordinate system on it. The targets are points on this plane. Each target is described by it's coordinates x__i, and y__i, by the time of it's appearance t__i and by the number p__i, which gives the probability that Copa hits this target if he aims at it.
A target appears and disappears instantly, so Copa can hit the target only if at the moment t__i his gun sight aimed at (x__i, y__i). Speed of movement of the gun sight on the plane is equal to 1. Copa knows all the information about the targets beforehand (remember, he is a king!). He wants to play in the optimal way, which maximizes the expected value of the amount of hit targets. He can aim at any target at the moment 0.
一个温暖而晴朗的日子,科帕国王决定前往中央公园的射击场,尝试赢得头奖——一只巨大的粉红色毛绒熊猫。国王的射击技术并不好,因此他邀请你来帮助他。
射击场是一个无限延伸的竖直平面,其上建立了笛卡尔坐标系。靶子是该平面上的点。每个靶子由其坐标 xi、yi、出现时刻 ti 以及数值 pi 描述;其中 pi 表示若科帕瞄准该靶子,则在该时刻命中它的概率。
每个靶子瞬间出现并瞬间消失,因此科帕仅当在时刻 ti 将枪的准星精确对准点 (xi,yi) 时,才能击中该靶子。准星在平面上的移动速度为 1。科帕事先已知晓所有靶子的全部信息(别忘了,他可是国王!)。他希望以最优策略进行游戏,使得命中靶子数量的期望值最大化。在时刻 0,他可以将准星对准任意一个靶子。
输入格式
The first line contains integer n (1 ≤ n ≤ 1000) — amount of targets in the shooting gallery. Then n lines follow, each describing one target. Each description consists of four numbers x__i, y__i, t__i, p__i (where x__i, y__i, t__i — integers, - 1000 ≤ x__i, y__i ≤ 1000, 0 ≤ t__i ≤ 109, real number p__i is given with no more than 6 digits after the decimal point, 0 ≤ p__i ≤ 1). No two targets may be at the same point.
第一行包含一个整数 n(1≤n≤1000)—— 射击场中目标的数量。随后是 n 行,每行描述一个目标。每个目标的描述由四个数 xi、yi、ti、pi 组成(其中 xi、yi、ti 为整数,满足 −1000≤xi,yi≤1000,0≤ti≤109;实数 pi 的小数点后最多有 6 位数字,且 0≤pi≤1)。任意两个目标不可能位于同一点。
输出格式
Output the maximum expected value of the amount of targets that was shot by the king. Your answer will be accepted if it differs from the correct answer by not more than 10 - 6.
输出国王射击到的目标数量的最大期望值。只要你的答案与正确答案的差值不超过 10−6,即视为正确。
输入输出样例
输入#1
1 0 0 0 0.5
输出#1
0.5000000000
输入#2
2 0 0 0 0.6 5 0 5 0.7
输出#2
1.3000000000
输入解题思路,AI测评打分。不知道怎么写?