Submission #9565

# Submission time Handle Problem Language Result Execution time Memory
9565 2014-09-28T07:19:16 Z Yoon N-orthotope (kriii2_N) C++
0 / 4
0 ms 1088 KB
#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 time Memory Grader output
1 Incorrect 0 ms 1088 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Halted 0 ms 0 KB -