QOJ.ac

QOJ

Límite de tiempo: 2 s Límite de memoria: 256 MB Puntuación total: 100

#21108. 奶牛慢跑

Estadísticas

Farmer John 的 $N$ 头奶牛($1 \leq N \leq 100,000$)又在锻炼蹄子,沿无限长跑道慢跑。每头从不同位置开始,有些速度不同。

跑道划分成多条道,奶牛可以互相超越。同道的两头奶牛不能在任何时刻位于同一位置。他不希望任何奶牛换道或调整速度,想知道若跑 $T$ 分钟($1 \leq T \leq 1,000,000,000$),需要多少条道。

输入格式

第一行含 $N$ 和 $T$。

接下来 $N$ 行各含一头奶牛的初始位置和速度。位置为非负整数,速度为正整数,两数都至多 10 亿。初始位置互不相同,并按递增顺序给出。

输出格式

输出一个整数:保证同道两头奶牛从不位于同一位置(包括时刻 $T$)所需的最少道数。

样例

输入格式 1

5 3
0 1
1 2
2 3
3 2
6 1

输出格式 1

3

题目作者:Mark Gordon,2014

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.