133. Border time limit per test: 0.25 sec. Along the border between states A and B there are N defence outposts. For every outpost k, the interval [Ak,Bk] which is guarded by it is known. Because of financial reasons, the president of country A decided that some of the outposts should be abandoned. In fact, all the redundant outposts will be abandoned. An outpost i is redundant if there exists some outpost j such that Aj<Ai and Bi<Bj. Your task is to find the number of redundant outposts. Input The first line of the input will contain the integer number N (1<=N<=16 000). N lines will follow, each of them containing 2 integers: Ak and Bk (0<= Ak < Bk <= 2 000 000 000), separated by blanks. All the numbers Ak will be different. All the numbers Bk will be different. Output You should print the number of redundant outposts. Sample Input 5 Sample Output 3 |
#include <cstring>
|
相关文章
- 快速切题 sgu120. Archipelago 计算几何
- 快速切题 poj 2993 Emag eht htiw Em Pleh 模拟 难度:0
- uni-app&H5&Android混合开发三 || uni-app调用Android原生方法的三种方式 uni-app跨平台框架介绍和快速入门uni-app跨平台框架介绍和快速入门uni-app&H5&Android混合开发一 || 最全面的uni-app离线打包Android平台教程uni-app&H5&Android混合开发二 || 使用Android Studio打包应用APKuni-app&H5&Android混合开发三 || uni-app调用And
- Tensorflow 2 Cifar10离线数据集手动下载、离线安装、本地加载、快速读取
- 快速切题 sgu 111.Very simple problem 大数 开平方 难度:0 非java:1
- 快速切题 poj 3026 Borg Maze 最小生成树+bfs prim算法 难度:0
- 快速切题 sgu104. Little shop of flowers DP 难度:0
- (私人收藏)[开发必备]HTML5最全快速查找离线手册(可查询可学习,带实例)
- 在Ubuntu上使用离线方式快速安装K8S v1.11.1
- 快速切题 sgu133.Border 离线