#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;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
1088 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Halted |
0 ms |
0 KB |
- |