#include <iostream>
#include <cstdio>
using namespace std;
struct node
{
int st,ed;
int dis;
}Node[200];
int cmp(node a,node b)
{
if(a.ed!=b.ed)
return a.ed<b.ed;
return a.st<b.st;
}
int main()
{
int n;
while (cin>>n)
{
if(n==0)
break;
int max=0;
int count;
for (int i=0;i<n;i++)
{
cin>>Node[i].st>>Node[i].ed;
Node[i].dis=Node[i].ed-Node[i].st;
}
sort(Node,Node+n,cmp);
int tem;
for (int i=0;i<n;i++)
{
tem=Node[i].ed;
count=1;
for (int j=i+1;j<n;j++)
{
if(tem<=Node[j].st)
{
count++;
tem=Node[j].ed;
}
}
if (count>max)
max=count;
}
cout<<max<<endl;
}
return 0;
}
2037 ——今年暑假不AC
最新推荐文章于 2020-02-02 18:17:07 发布