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