QOJ.ac

QOJ

Límite de tiempo: 4 s Límite de memoria: 512 MB Puntuación total: 100

#3418. 未来高速公路

Estadísticas

现在是 23413 年,量子道路管理局(QRA)需要你协助设计一条新的量子高速公路。量子高速公路与普通高速公路最大的区别在于,量子汽车可以瞬间切换车道,即在时间 $t_1$ 时量子汽车可以在一条车道上,而在时间 $t_2$ 时(只要 $t_1 \neq t_2$),它就可以在另一条车道上。

当然,在 23413 年,未来预测管理局(FPA)掌握了所有将使用这条新高速公路的车辆信息。对于每一辆将在你的量子高速公路上行驶的量子汽车,FPA 会提供给你一个值 $t$,即量子汽车进入高速公路的时间,以及一个值 $v$,代表量子汽车在量子高速公路上行驶的速度。

你的高速公路长度为 100 个长度单位。在 1 个时间单位内,一辆速度为 $v$ 的量子汽车将行驶恰好 $v$ 个长度单位。量子汽车的尺寸相对于高速公路的长度可以忽略不计;它应被视为一个点。

你的任务是确保这条量子高速公路上不会发生碰撞。量子汽车配备了非常先进的防碰撞机制:只要量子高速公路上的车道足够多,汽车就会“神奇地”切换车道以避免碰撞。但如果任何时候在高速公路的某个特定位置,车辆数量超过了车道数量,碰撞仍然会发生。正如样例所示,这种碰撞甚至可能发生在高速公路的起点或终点。

请问为了确保不会发生碰撞,最少需要多少条车道?

输入格式

对于每个测试用例:

  • 一行包含一个整数 $n$ ($1 \le n \le 35\,000$):将在你的高速公路上行驶的量子汽车数量。
  • $n$ 行,每行包含两个整数:
    • $t_i$:量子汽车 $i$ 进入你的量子高速公路的时间 ($1 \le t_i \le 10\,000$)。
    • $v_i$:量子汽车 $i$ 的速度 ($1 \le v_i \le 100$)。

输出格式

对于每个测试用例,输出一行,包含一个整数:确保不会发生碰撞所需的最少车道数。

样例

输入 1

3
15 20
19 100
10 10
3
10 20
10 10
10 30
2
10 10
10 10
2
10 1
20 100

输出 1

3
3
2
2

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.