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