#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 |
1 |
Correct |
0 ms |
1088 KB |
Output is correct |
2 |
Correct |
0 ms |
1088 KB |
Output is correct |
3 |
Correct |
0 ms |
1088 KB |
Output is correct |
4 |
Incorrect |
0 ms |
1088 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Halted |
0 ms |
0 KB |
- |