This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <stdio.h>
#define N_MAX 11
int N, M, S1[N_MAX+1], E1[N_MAX+1], S2[N_MAX+1], E2[N_MAX+1];
int main(void) {
int i;
scanf("%d",&N);
M=N;
for(i=1 ; i<=N ; i++) scanf("%d %d",&S1[i],&E1[i]);
for(i=1 ; i<=N ; i++) scanf("%d %d",&S2[i],&E2[i]);
for(i=1 ; i<=N ; i++) {
if(E1[i]<S2[i] || E2[i]<S1[i]) {
printf("-1");
return 0;
}
if(E1[i]==S2[i] || E2[i]==S1[i]) M--;
}
printf("%d",M);
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |