-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path165A.cpp
More file actions
39 lines (37 loc) · 780 Bytes
/
Copy path165A.cpp
File metadata and controls
39 lines (37 loc) · 780 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include<bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int arr[n][2];
int i, j, x, y, left, right, up, below, count = 0;
for(i = 0; i < n; i++) {
for(j = 0; j < 2; j++) {
cin >> arr[i][j];
}
}
for(i = 0; i < n; i++) {
x = arr[i][0];
y = arr[i][1];
left = 0, right = 0, up = 0, below = 0;
for(j = 0; j < n; j++) {
if(x<arr[j][0] && y==arr[j][1]){
right++;
}
else if(x>arr[j][0] && y==arr[j][1]){
left++;
}
else if(x==arr[j][0] && y<arr[j][1]){
up++;
}
else if(x==arr[j][0] && y>arr[j][1]){
below++;
}
if(left > 0 && right > 0 && up > 0 && below > 0) {
count++;
break;
}
}
}
cout << count;
}