QOJ.ac

QOJ

実行時間制限: 2 s メモリ制限: 256 MB 満点: 100

#3535. Boedium

統計

Andrew 喜欢观看冬季两项比赛,和许多其他粉丝一样,他喜欢红头发的 Josya。多年来,Andrew 收集了关于即将到来的比赛中每位参赛选手的足够统计数据。现在,他想计算 Josya 在即将到来的个人赛中登上领奖台的概率,并向你寻求帮助。

个人赛由 5 圈滑行和 4 轮射击组成(2 轮卧姿射击和 2 轮立姿射击)。每轮射击有 5 发子弹和 5 个目标。每次脱靶会给运动员的总时间增加一分钟。

我们拥有关于每位运动员的一些信息。我们知道他们的单圈滑行时间,以及卧姿和立姿射击命中目标的概率。为简化起见,我们假设所有运动员在射击场花费的时间相同。Josya 的出发顺序是第一位。

比赛结束时,运动员的名次 $X$ 等于滑行时间严格快于该运动员的人数加一。所有获得第一、第二或第三名的运动员都将登上领奖台。注意,多名运动员可以并列同一名次。

输入格式

第一行包含一个整数 $n$ —— 比赛的参赛人数。

接下来的 $n$ 行中,每行包含三个数字 $time_i, down_i, up_i$,其中 $time_i$ 是整数单圈滑行时间(以秒为单位),$down_i$ 是卧姿射击命中目标的概率,$up_i$ 是立姿射击命中目标的概率。$up_i$ 和 $down_i$ 是小数点后恰好有三位数字的实数。

数据范围

$1 \le n \le 50000$ $1 \le time_i \le 600$ $0 \le down_i, up_i \le 1$

输出格式

输出唯一的实数 —— Josya 登上领奖台的概率。绝对或相对误差不得超过 $10^{-9}$。

样例

输入 1

4
45 0.700 0.700
60 0.800 0.800
90 0.900 0.900
120 1.000 1.000

输出 1

0.675394632273

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.