QOJ.ac

QOJ

Time Limit: 2.0 s Memory Limit: 1024 MB Total points: 100 Hackable ✓

#17161. 蚁丘/蜜罐模拟器

Statistics

一个拥有 $N \approx 10^{100}$ 只蚂蚁的蚁穴位于一个无限平面上。除此之外,该平面上仅包含一个半径为 $R$ 的圆形蜜罐,其圆心与蚁穴的距离为 $d$。

所有蚂蚁最初都位于蚁穴中。然后,它们开始彼此独立地运动。每只蚂蚁随机选择其运动方向,并以 $(\Delta t)^{-1/2}$ 的速度在所选方向上运动 $\Delta t$ 个时间单位,从而移动 $\sqrt{\Delta t}$ 单位的距离,其中 $\Delta t \approx 10^{-100}$ 是一个极小的数。然后,每只蚂蚁不断重复整个过程。每当蚂蚁位于蜜罐内部时,它在里面每度过一个时间单位就会收集一单位的蜂蜜。

你的任务是模拟从开始起 $T$ 个时间单位内的蚁穴和蜜罐,并计算两个数值:在 $T$ 个时间单位后最终位于蜜罐内部的蚂蚁比例 $f$,以及每只蚂蚁收集的平均蜂蜜量 $h$。

输入格式

输入的第一行包含一个整数 $k$,表示测试用例的数量($1 \le k \le 1000$)。

接下来的 $k$ 行中,每行描述一个测试用例,包含三个实数 $d$、$R$ 和 $T$,小数点后最多保留四位数字($0 \le d \le 100$;$0.01 \le R \le 100$;$0.01 \le T \le 100$)。

输出格式

你需要输出 $k$ 行,每个测试用例对应一行。每行应包含 $f$ 和 $h$ 的值,用一个或多个空格隔开。你输出的 $f$ 值与正确值的误差不能超过 $10^{-8}$,输出的 $h$ 值与正确值的误差不能超过 $10^{-8} \cdot T$。

样例

输入样例 1

7
0 1 1
2 1 3
1 2 0.999
1 2 1
1 2 1.001
1 1 1
0 10 10

输出样例 1

0.6321205588285579 0.8515044932240781
0.09157635496981011 0.1733100735950181
0.8767916692090618 0.9555113318223997
0.8766185521451777 0.9563880369284812
0.8764454902564369 0.9572645689450815
0.3457458387231645 0.4012213611982974
0.9999546000702375 9.999961697595344

Editorials

IDTypeStatusTitlePosted ByLast UpdatedActions
#1212EditorialOpen题解jiangly2026-03-06 00:35:31View

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.