题目链接:1337: Car race game

参考资料:⑴ Car race game 树状数组 棋煜,⑵ 树状数组,⑶ 离散化

补充资料:⑴ qsort,⑵ 二分查找

Description

Bob is a game programming specialist. In his new car race game, there are some racers(n means the amount of racers (1<=n<=100000)) racers star from someplace(xi means Starting point coordinate),and they possible have different speed(V means speed).so it possibly takes place to overtake(include staring the same point ). now he want to calculate the maximal amount of overtaking.

有 n 名参赛者,每名参赛者从自己的位置(Xi)以速度(Vi)匀速运动,问最后有多少次超越?

Input

The first line of the input contains an integer n-determining the number of racers. Next n lines follow, each line contains two integer Xi and Vi.(xi means the ith racer’s Starting point coordinate, Vi means the ith racer’s speed.0<Xi, Vi<1000000).

Output

For each data set in the input print on a separate line, on the standard output, the integer that represents the maximal amount of overtaking.

Sample Input

2
2 1
2 2
5
2 6
9 4
3 1
4 9
9 1
7
5 5
6 10
5 6
3 10
9 10
9 5
2 2

Sample Output

1
6
7

分析

WUSTOJ 1337: Car race game(C)树状数组,离散化的更多相关文章

  1. hdu4605 树状数组+离散化+dfs

    Magic Ball Game Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) ...

  2. BZOJ_5055_膜法师_树状数组+离散化

    BZOJ_5055_膜法师_树状数组+离散化 Description 在经历过1e9次大型战争后的宇宙中现在还剩下n个完美维度, 现在来自多元宇宙的膜法师,想偷取其中的三个维度为伟大的长者续秒, 显然 ...

  3. POJ 2299 【树状数组 离散化】

    题目链接:POJ 2299 Ultra-QuickSort Description In this problem, you have to analyze a particular sorting ...

  4. HDU 2227 Find the nondecreasing subsequences (DP+树状数组+离散化)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2227 Find the nondecreasing subsequences             ...

  5. BZOJ-1227 虔诚的墓主人 树状数组+离散化+组合数学

    1227: [SDOI2009]虔诚的墓主人 Time Limit: 5 Sec Memory Limit: 259 MB Submit: 914 Solved: 431 [Submit][Statu ...

  6. POJ 2299 树状数组+离散化求逆序对

    给出一个序列 相邻的两个数可以进行交换 问最少交换多少次可以让他变成递增序列 每个数都是独一无二的 其实就是问冒泡往后 最多多少次 但是按普通冒泡记录次数一定会超时 冒泡记录次数的本质是每个数的逆序数 ...

  7. [HDOJ4325]Flowers(树状数组 离散化)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4325 关于离散化的简介:http://blog.csdn.net/gokou_ruri/article ...

  8. HDU4456-Crowd(坐标旋转+二位树状数组+离散化)

    转自:http://blog.csdn.net/sdj222555/article/details/10828607 大意就是给出一个矩阵 初始每个位置上的值都为0 然后有两种操作 一种是更改某个位置 ...

  9. Bzoj 1901: Zju2112 Dynamic Rankings 主席树,可持久,树状数组,离散化

    1901: Zju2112 Dynamic Rankings Time Limit: 10 Sec  Memory Limit: 128 MBSubmit: 6321  Solved: 2628[Su ...

  10. Bzoj1818: [Cqoi2010]内部白点 && Tyvj P2637 内部白点 扫描线,树状数组,离散化

    1818: [Cqoi2010]内部白点 Time Limit: 10 Sec  Memory Limit: 64 MBSubmit: 704  Solved: 344[Submit][Status] ...

随机推荐

  1. 第06组 Alpha冲刺(1/6)

    队名:拾光组 组长博客链接 作业博客链接 团队项目情况 燃尽图(组内共享) 宋奕 过去两天完成了哪些任务 主要完成了用户模块接口 具体完成了用户注册登录,忘记.修改密码,修改.查看个人信息 GitHu ...

  2. php手记之05-tp5获取器与修改器

    获取器 命名规范为: getFieldNameAttr 例如,我们需要对状态值进行转换,可以使用: <?php class User extends Model { public functio ...

  3. idea 如何新建一个Maven项目并且写第一个servlet

    使用idea已经有段时间了,但是一直没有自己亲自新建一个项目,从头开始写一个Servlet,今天就来学习一下,并且记一个笔记. 一. 1.首先,打开idea new-->Project 2.选择 ...

  4. excel自增编号

    1.首先在单元格 A2:C2 中输入数据. 2.选择 A3:A500, 我们按键盘的 CTRL G 键, 拉起定位框, 然后在参考位置, 输入 A3:A500, 然后单击 "确定" ...

  5. restful swagger api java go

    rest框架使用swagger api,接口越来越多后性能会很差,如何优化? - 知乎https://www.zhihu.com/question/59349319 golang restful 框架 ...

  6. CentOS / RHEL 7 更改时区

    timedatectl 是 RHEL7 上的一项新功能.它可用于查询和更改系统时钟及其设置. 按照以下步骤将时区更改为中国.(以root用户身份执行以下命令). 1.使用以下命令列出所有可用的时区.你 ...

  7. 泡泡一分钟:Semi-Dense Visual-Inertial Odometry and Mapping for Quadrotors with SWAP Constraints

    张宁 Semi-Dense Visual-Inertial Odometry and Mapping for Quadrotors with SWAP Constraints 具有SWAP约束的四旋翼 ...

  8. 深入学习c++--智能指针(四)--使用建议

    1. 不要自己手动管理资源 2. 一个裸指针不要用两个shared_ptr管理,unique_ptr 3. 使用shared_ptr作为函数的接口,如果有可能用 const shared_ptr&am ...

  9. 修改excel图表中的“系列一”

    修改excel图表中的"系列一" 觉得有用的话,欢迎一起讨论相互学习~Follow Me 参考文献 https://zhidao.baidu.com/question/153915 ...

  10. 【440】Tweet 元素意义

          参考:Tweet Object 参考:Geo Objects 参考:User Object Ref: Place data dictionary Tweet Object Attribut ...