编程介的小学生 2017-11-04 02:57 采纳率: 20.5%
浏览 917
已采纳

A Runing Game

Problem Description
HDU hosts sporting meeting every year. One of the most exciting events is the 10000M-running.During the match many students are running on the track. So, how about the rank list now?

As we know, in a running , we rank the player according to the length everyone has passed . So if one player run 400M(one lap) farther than another player , it looks like they are running at the same position on the track , but the rank of the former is much better than the latter. Now given everyone’s position on the track , and one rank list , can you tell me whether the rank list is possible.

Input
The first line of input gives the number of cases, T (at most 110). the first line of each case has two intergers, n,m. (1 <= n <= 100,1 <= m <= 40000,n <= m),represents there’re n players in the m-meter running.
then n lines describe every player.

Each line have two intergers , Xi , Ri .Representing the i-th player is running at xi[0 , 399] meter in his recent lap, and ranks Ri in the ranklist .And the data make sure that no pair of the students have the same Xi or Ri. And the start point is at 0 in their first lap.

Output
If the rank list is possible, output “YES” ,output “NO” otherwise.

Sample Input
2
3 400
100 1
49 2
28 3
3 800
100 1
150 2
154 3

Sample Output
YES
NO

  • 写回答

1条回答 默认 最新

  • threenewbee 2017-11-29 15:46
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 微信小程序协议怎么写
  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看