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>
#include <string.h>
int main(){
int i,n,ps[2][16][2];
int sum=0;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d %d",&ps[0][i][0],&ps[0][i][1]);
}
for(i=0;i<n;i++){
scanf("%d %d",&ps[1][i][0],&ps[1][i][1]);
}
for(i=0;i<n;i++){
if( ps[0][i][1] == ps[1][i][0] ||
ps[0][i][0] == ps[1][i][1])
sum += 0;
else if(ps[0][i][0] <= ps[1][i][0]){
if(ps[0][i][1] > ps[1][i][0]) sum+=1;
else{
sum = -1;
break;
}
}
else{
if(ps[1][i][1] > ps[0][i][0]) sum+=1;
else{
sum=-1;
break;
}
}
}
printf("%d\n",sum);
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |