#include <stdio.h>
#include <set>
#include <vector>
using namespace std;
int main(void){
int N;
scanf("%d", &N);
int tmpa, tmpb;
vector<pair<int, int> > pair_vec;
for(int i=0; i<N; i++){
scanf("%d%d", &tmpa, &tmpb);
pair_vec.push_back(make_pair(tmpa, tmpb));
}
int on_line_count=0;
for(int i=0; i<N; i++){
scanf("%d%d", &tmpa, &tmpb);
if(tmpa > pair_vec[i].first){
if(tmpb < pair_vec[i].first){
printf("-1\n");
return 0;
}
else if(tmpb == pair_vec[i].first){
on_line_count += 1;
}
else{
continue;
}
}
else{
if(tmpa > pair_vec[i].second){
printf("-1\n");
return 0;
}
else if(tmpa == pair_vec[i].second){
on_line_count += 1;
}
else{
continue;
}
}
}
printf("%d\n", N-on_line_count);
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
1204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Halted |
0 ms |
0 KB |
- |