이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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 |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |