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>
int n, s1[12], e1[12], s2[12], e2[12];
int main() {
scanf("%d", &n);
for (int i=0; i<n; ++i)
scanf("%d%d", s1+i, e1+i);
for (int i=0; i<n; ++i)
scanf("%d%d", s2+i, e2+i);
int ans = n;
for (int i=0; i<n; ++i) {
if (s1[i] > e2[i] || s2[i] > e1[i]) {
ans = -1;
break;
}
if (s1[i] == e2[i] || s2[i] == e1[i])
--ans;
}
printf("%d\n", ans);
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |