Start: Jul, 05, 2019 08:40:00
2019年度暑期短学期达标测试
End: Jul, 05, 2019 11:40:00
Time elapsed:
Time remaining:

Problem_ID: F
Result: Accepted
Time: 4ms
Memory: 1120kB
Author: CT12810161281
In contest: 1281


#include<stdio.h>
#include<math.h>
#include<string.h>
int main (){
int a[1002],d[1002];
int	b,c,e,k,i,l,n,m,g,j,f;
scanf("%d",&g);
scanf("%d %d",&a[0],&d[0]);
for(i=1,k=0,l=0;i<g;i++){
	scanf("%d %d",&a[i],&d[i]);
for(j=0,f=0;j<i;j++){
	if(a[j]==0)
		continue;
    if((a[j]>=a[i]&&d[j]>=d[i])||(a[j]>=d[i]&&d[j]>=a[i]))
	{a[j]=a[i],d[j]=d[i];
	      a[i]=0;d[i]=0;
		  f=1;break;}
     }}
for(i=0,e=0;i<g;i++)
	if(a[i]!=0)
		e++;
printf("%d\n",e);



return 0;}