Submission #9565

#TimeUsernameProblemLanguageResultExecution timeMemory
9565YoonN-orthotope (kriii2_N)C++98
0 / 4
0 ms1088 KiB
#include <stdio.h>
typedef struct n_orthotope
{
	int s[15],e[15];
}N_orthotope;
N_orthotope A,B;
int N,Cnt;
void check(int s1,int e1,int s2,int e2)
{
	if(s1==e2 || s2==e1)Cnt=Cnt;
	else if(s1<=s2 && e1<=e2)Cnt++;
	else if(s1<=s2 && e2<=e1)Cnt++;
	else if(s2<=s1 && e2<=e1)Cnt++;
	else if(s2<=s1 && e1<=e2)Cnt++;
	else Cnt=-1;
	
}
int main()
{
	int i;
	scanf("%d",&N);
	for(i=1;i<=N;i++)scanf("%d %d",&A.s[i],&A.e[i]);
	for(i=1;i<=N;i++)scanf("%d %d",&B.s[i],&B.e[i]);
	for(i=1;i<=N;i++){
		check(A.s[i],A.e[i],B.s[i],B.e[i]);
		if(Cnt==-1)break;
	}
	printf("%d\n",Cnt);
	return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...