QOJ.ac

QOJ

时间限制: 5 s 内存限制: 1024 MB 总分: 100

#6734. 点击圆圈

统计

这是一个关于游戏 osu! 的修改版本。 游戏中有两种类型的物体:

  1. 圆形 (Circle):$c_x, c_y, t$
    • 该圆形的圆心位于 $(c_x, c_y)$,打击时间为 $t$。
    • 该圆形在游戏中的存在时间区间为 $[t - d, t + d]$。
    • 所有圆形的半径均为 $r$。
  1. 滑条 (Slide):$s_x, s_y, t_x, t_y, u, v$ 滑条包含两个部分: (a) 一个移动的圆形,其半径也为 $r$。 (b) 一个承载该圆形路径的框架。

    滑条承载着一个移动圆形的路径,其半径始终为 $r$。 移动过程描述如下: (a) 在时间 $u - d$ 时,圆形与框架一同出现,圆心位于 $(s_x, s_y)$。 (b) 在时间 $u$ 时,圆心开始以恒定速度向 $(t_x, t_y)$ 移动。 (c) 在时间 $v$ 时,圆心到达 $(t_x, t_y)$。 (d) 在时间 $v + d$ 之后,圆形和框架消失。

如果两个物体在某一时刻 $t$ 同时存在且它们的形状发生重叠(包含边界),则认为它们相交。 滑条的两个组成部分应被视为两个不同的物体。 给定 $r$、$d$ 以及 $n$ 个物体,计算相交的物体对数量。

输入格式

第一行包含三个正整数 $n, r, d$ ($1 \le n, r, d \le 10^3$)。 接下来的 $n$ 行描述这些物体。每行以一个数字 $type \in \{1, 2\}$ 开头,表示物体的类型。 如果 $type = 1$,则后面会有三个整数 $c_x, c_y, t$,表示一个圆形。 如果 $type = 2$,则后面会有六个整数 $s_x, s_y, t_x, t_y, u, v$,表示一个滑条。

保证 $1 \le c_x, c_y, s_x, s_y, t_x, t_y \le 10^4$,$1 \le t, u, v \le 10^3$ 且 $u < v$。

输出格式

输出一行,包含一个整数,表示相交的物体对数量。

样例

输入 1

2 1 1
1 1 1 2
1 2 2 3

输出 1

1

输入 2

2 1 1
1 1 1 2
1 3 2 3

输出 2

0

输入 3

2 1 1
1 3 3 2
2 5 5 5 1 2 4

输出 3

3

输入 4

2 1 1
2 1 1 1 5 2 4
2 5 5 5 1 2 4

输出 4

2

输入 5

2 1 1
2 10 1 10 20 2 4
2 1 10 20 10 2 4

输出 5

6

Editorials

IDTypeStatusTitlePosted ByLast UpdatedActions
#152EditorialOpen题解jiangly2025-12-12 23:36:07View

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.