22030_Run

2022-5-16 18:21| 发布者: Hocassian| 查看: 24| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-4-8950654680200-Problem List-采集的数据-后羿采集器.html

Pro.ID

22030

Title

Run

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=22030

AC

12

Submit

58

Ratio

20.69%

时间&空间限制

  • Time Limit: 1000/500 MS (Java/Others)     Memory Limit: 131072/32768 K (Java/Others)
  • 描述

    Since members of Wuhan University ACM Team are lack of exercise, they plan to participate in a ten-thousand-people Marathon. It is common that the athletes run very fast at first but slow down later on. Start from this moment, we can assume that everyone is moving forward in a constant speed. ACMers love algorithms, so they want to know not only the result but also who may be in the leading position. Now we know all athletes' position and speed at a specific moment. The problem is, starting from this moment, how many athletes may be the leader. Please notice that there's no leader if two or more athletes are at the leading position at the same time. No two athletes may have the same speed.

    输入

    The input consists of several test cases. The first line of input consists of an integer T, indicating the number of test cases. The first line of each test case consists of an integer N, indicating the number of athletes. Each of the following N lines consists of two integers: p, v, indicating an athlete's position and speed.

    T ≤ 20

    0 < N ≤ 50000

    0 < p, v ≤ 2000,000,000

    An athlete's position is the distant between him/her and the start line.

    The Marathon is so long that you can assume there's no finishline.

    输出

    Description

    Since members of Wuhan University ACM Team are lack of exercise, they plan to participate in a ten-thousand-people Marathon. It is common that the athletes run very fast at first but slow down later on. Start from this moment, we can assume that everyone is moving forward in a constant speed. ACMers love algorithms, so they want to know not only the result but also who may be in the leading position. Now we know all athletes' position and speed at a specific moment. The problem is, starting from this moment, how many athletes may be the leader. Please notice that there's no leader if two or more athletes are at the leading position at the same time. No two athletes may have the same speed.

    Input

    The input consists of several test cases. The first line of input consists of an integer T, indicating the number of test cases. The first line of each test case consists of an integer N, indicating the number of athletes. Each of the following N lines consists of two integers: p, v, indicating an athlete's position and speed.

    T ≤ 20

    0 < N ≤ 50000

    0 < p, v ≤ 2000,000,000

    An athlete's position is the distant between him/her and the start line.

    The Marathon is so long that you can assume there's no finishline.

    Output

    For each test case, output the number of possible leaders on a separate line.

    Sample Input

    1
    3
    1 1
    2 3
    3 2

    Sample Output

    2

    Source

    样例输入

    1
    3
    1 1
    2 3
    3 2

    样例输出

    2

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部