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 <cstdio>
using namespace std;
int n, s[100], e[100];
int main() {
scanf("%d", &n);
for(int i = 0; i < n; i++) scanf("%d%d", s+i, e+i);
int res = 0;
for(int i = 0; i < n; i++) {
int x, y; scanf("%d%d", &x, &y);
if(s[i] < y && x < e[i]) ++res;
else if(s[i] != y && x != e[i]) return 0 & puts("-1");
}
printf("%d\n", res);
// your code goes here
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |