#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int n, i;
cin >> n;
int b[n],e[n];
for (i = 0; i < n; i++)
cin >> b[i] >> e[i];
sort(b,b+n);
sort(e,e+n);
int f[n];
for(int i=1;i<=n;i++){
f[i]=1;
}
int j=0,ans =0;
for (i = 0; i < n; i++)
if (b[i] < e[j])
ans++;
else
j++;
cout << ans << endl;
return 0;
}
09-02
1298
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
08-31
1914
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)