QOJ.ac

QOJ

Limite de temps : 2 s Limite de mémoire : 256 MB Points totaux : 100

#21108. 牛のジョギング

Statistiques

Farmer John の $N$ 頭の牛($1 \leq N \leq 100,000$)はまた蹄の運動で無限のコースを走ります。初期位置は全員異なり、一部は速さも異なります。

追い越せるようコースをレーンに分けます。同じレーンの二頭はどの時刻も同じ位置になれません。レーン変更や速度変更をさせず、$T$ 分間($1 \leq T \leq 1,000,000,000$)走るには何レーン必要か知りたいです。

入力

最初の行は $N$ と $T$ です。

続く $N$ 行は各牛の初期位置と速さです。位置は非負整数、速さは正整数で、どちらも最大十億です。初期位置はすべて異なり、昇順で与えられます。

出力

同じレーンの二頭が同じ位置になることのない(時刻 $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.