/ OPS / 题库 /

Race

Race

#描述#
During the Annual Interstellar Competition for Tuned Spaceships, N spaceships will be competing. Each spaceship i is tuned in such a way that it can accelerate in zero time to its maximum speed Vi and remain cruising at that speed. Due to past achievements, each spaceship starts at a starting position Xi, specifying how many kilometers the spaceship is away from the starting line.
The race course is infinitely long. Because of the high speeds of the spaceships, the race course goes straight towards positive infinity all the time. On that straight course, spaceships can pass one another very easily, without interfering with each other.
Many people in the audience have not realized yet that the outcome of the race can be determined in advance. It is your task to show this to them, by telling them how many times spaceships will pass one another.

#格式#
##输入格式##
The first line of the input specifies the number of spaceships N (0 &lt N &lt1000). Each of the next N lines describes the properties of one spaceship. The i+1th line describes the ith ship with two integers Xi and Vi, representing the starting position and the velocity of the ith spaceship (0 &lt= Xi &lt= 1 000 000, 0 &lt Vi &lt 1 000 000). It’s guaranteed that no two spaceships are of the same position or velocity.

##输出格式##
A single line contains the number of times that spaceships pass one another during the race.

#样例1#
##样例输入1##

4
2 1
3 8
6 3
0 2

##样例输出1##

2

#限制#
1000ms
32768KB

#提示#

#来源#
Limitfan

信息

ID
1480
难度
5
分类
category1 点击显示
标签
递交数
0
已通过
0
通过率
?
上传者