QOJ.ac

QOJ

実行時間制限: 2 s メモリ制限: 512 MB 満点: 100 ハック可能 ✓

#1898. 竞赛

統計

体育场内正在举行一场有 $n$ 名运动员参加的比赛。运动员们在体育场的 $n$ 条线性跑道上奔跑。我们将每条跑道视为一条水平线,第 $i$ 条跑道为直线 $y = i$。

第 $i$ 名运动员从点 $(s_i, i)$ 出发,以速度 $v_i$ 向右奔跑。比赛很长,我们可以认为它永不结束,且运动员从不停下。

t = 0

年轻的摄影师丹尼尔正在观看比赛。他想知道在某个时刻,最多会有多少名运动员位于同一条直线上。请帮他找出这个数字!

t = 1

输入格式

输入的第一行包含一个整数 $n$ —— 参赛选手的数量 ($1 \le n \le 300$)。

接下来的 $n$ 行描述运动员,第 $i$ 行包含两个整数 $s_i$ 和 $v_i$ —— 第 $i$ 名运动员的初始 $x$ 坐标及其速度 ($-10^6 \le s_i \le 10^6$;$1 \le v_i \le 10^6$)。

输出格式

输出一个整数 —— 在比赛过程中,位于同一条直线上的运动员的最大数量。

样例

输入 1

3
0 1
0 3
3 2

输出 1

3

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.