0
已解决
曹博扬
初级天翼
初级天翼
#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
using namespace std;
int n,st=-1,c;
struct f{
int x,y;
}a[10100];
bool cmp(f a,f b){
if(a.y!=b.y)
return a.y<b.y;
return a.x<b.x;
}
int main(){
cin>>n;
for(int i=1;i<=n;i++)
cin>>a[i].x>>a[i].y;
sort(a+1,a+n+1,cmp);
for(int i=1;i<=n;i++){
if(a[i].x>st){
c++;
st=max(a[i].y,st);
}
}
cout<<c;
return 0;
}
0分???
拿错了??