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 s[15][2], e[15][2];
int over[15];
int main()
{
int N;
int M;
scanf("%d", &N);
M = N;
for(int i = 1; i <= N; i++)
scanf("%d %d", &s[i][0],&s[i][1]);
for(int i = 1; i <= N; i++)
scanf("%d %d", &e[i][0],&e[i][1]);
for(int i = 1; i <= N; i++)
{
if(e[i][1] < s[i][0] || s[i][1] < e[i][0]) {
printf("-1");
return 0;
}
else if(e[i][1] <= s[i][0] || s[i][1] <= e[i][0]) {
M--;
}
}
printf("%d", M);
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |