QOJ.ac

QOJ

حد الوقت: 1.0 s حد الذاكرة: 2048 MB مجموع النقاط: 100

#15936. 粒子碰撞

الإحصائيات

粒子碰撞机难以建造,且运行实验的成本高昂。在进行任何实际实验之前,最好先进行模拟以测试想法。你需要为这个问题编写一个非常简单的模拟器。

该系统中只有三个粒子,所有粒子都被限制在一个无限平面上,因此它们可以被建模为圆。它们的位置仅由其圆心的坐标 $(x_i, y_i)$ 指定($1 \le i \le 3$)。所有三个粒子都具有相同的半径 $r$,且最初都是静止的。

我们得到了一个向量 $(x_v, y_v)$,它指定了实验开始时粒子 1 将移动的方向。当粒子 $i$ 碰撞到粒子 $j$ 时,粒子 $j$ 将开始沿着与接触点切线垂直的方向移动,并远离粒子 $i$。粒子 $i$ 将不复存在并转化为辐射。一个没有碰撞到其他粒子的运动粒子将无限期地继续运动。

你的模拟器应该识别以下几种可能的情景:

  1. 粒子 1 碰撞到粒子 2,粒子 2 进而碰撞到粒子 3;
  2. 粒子 1 碰撞到粒子 3,粒子 3 进而碰撞到粒子 2;
  3. 粒子 1 碰撞到粒子 2,且粒子 2 无限期运动;
  4. 粒子 1 碰撞到粒子 3,且粒子 3 无限期运动;
  5. 粒子 1 无限期运动。

输入格式

输入包含四行。

前三行每行包含两个整数 $x_i$ 和 $y_i$($|x_i|, |y_i| \le 1000$),依次描述粒子 1、2 和 3。

第四行包含三个整数 $x_v$、$y_v$ 和 $r$($|x_v|, |y_v| \le 1000$,$0 < r \le 50$)。

你可以假设最初没有两个粒子接触或重叠,且粒子 2 和 3 的圆心之间的距离大于 $4r$。

输出格式

输出一个整数,表示上述对应情景的编号(1–5)。

尽管你应该小心计算,但保证如果将初始向量 $(x_v, y_v)$ 向任意方向旋转 1 度,结果也不会改变。

样例

输入样例 1

0 0
50 45
91 50
42 50 10

输出样例 1

1

输入样例 2

0 0
50 50
141 50
41 50 10

输出样例 2

3

输入样例 3

0 0
50 50
131 50
100 50 10

输出样例 3

4

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.