比赛场次 352
比赛名称 20161215
比赛状态 已结束比赛成绩
开始时间 2016-12-16 19:00:00
结束时间 2016-12-16 22:00:00
开放分组 全部用户
注释介绍
题目名称 奔跑
输入输出 stampede.in/out
时间限制 1000 ms (1 s)
内存限制 256 MiB
测试点数 15 简单对比
用户 结果 时间 内存 得分
GravatarKZNS AAWWWWWWWWWWWWW 0.726 s 1.64 MiB 13
Gravatariortheir AWWWWWWWWWWWWWW 0.194 s 1.08 MiB 6
Gravatarkxxy AWTWWTTTTTTTTTT 12.319 s 1.19 MiB 6

奔跑

★★★   输入文件:stampede.in   输出文件:stampede.out   简单对比
时间限制:1 s   内存限制:256 MiB

【题目描述】

 

农夫约翰的N头奶牛(1≤N≤50000)在FJ农场前方的路上疯狂奔跑,但他们实际上只是在赛跑,看哪头牛是最快的。

从上面看,每头奶牛被表示为一个单位长度的线段,其左上角点的坐标时间t = 0。例如,(-3,6)将表示一只牛,在时间t = 0时,

这头牛在从(-3,6)到(-2,6)的线段上。每头奶牛按一定速度向右移动(在+x方向),在指定的整数时间内她向右移动1单位的距离。

FJ不是特别兴奋,他的牛只是在外面跑,而不是在谷仓产奶。他计划在比赛结束后给他们讲一堂课。为了确定哪些他的牛是参与了比赛,FJ将自己定位在(0,0),在+Y方向沿射线进行观察。随着比赛开展,FJ能看到一些牛,因为他沿着射线在看。也就是说,某一头奶牛会不可见,如果在她穿越视线FJ的视线的整个时间内,另一头母牛始终在她的"前面"。

请计算FJ在整个比赛期间可以看到的奶牛数量。


【输入格式】

 

输入的第一行包含N,以下有N行,分别用三个整数x y r,描述了一头奶牛,对应于奶牛在时间t = 0时,她的左端点是在(x,y),移动1单位距离的速度是r单位时间。x的取值的范围是-1000..-1,y的取值范围是1..1000000(明显每头奶牛会防止任何可能的碰撞),r值的范围在1..1000000。


【输出格式】

一个整数,FJ在整个比赛可以看到的(T = 0起)奶牛数量。

【样例输入】

3
-2 1 3
-3 2 3
-5 100 1

【样例输出】

2

【提示】

FJ可以看到牛1、牛2而看不到牛3。

题目原文:

Farmer John's N cows (1 <= N <= 50,000) appear to be stampeding along the road at the front of FJ's farm, but they are actually just running in a foot race to see which cow is the fastest. Viewed from above, each cow is represented by a unit-length horizontal line segment, specified by the coordinates of its left corner point at time t=0. For example, (-3,6) would specify a cow who at time t=0 is represented by the segment from (-3,6) to (-2,6). Each cow is moving to the right (in the +x direction) at a certain rate, specified by the integer amount of time it takes her to move 1 unit to the right. FJ is not particularly thrilled that his cows are outside running instead of in the barn producing milk. He plans to admonish them with a stern lecture after the race ends. In order to determine which of his cows are participating in the race, FJ situates himself at (0,0) and looks along a ray extending in the +y direction. As the race unfolds, FJ sees a cow if she is ever the first cow visible along this ray. That is, a cow might not be visible if another cow is "in front" of her during the entire time she crosses FJ's line of sight. Please compute the number of cows FJ can see during the entire race.

【来源】

在此键入。