-
Notifications
You must be signed in to change notification settings - Fork 0
/
supercentral-point.java
56 lines (43 loc) · 1.22 KB
/
supercentral-point.java
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import java.util.*;
public class ProgramJava {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int count = 0;
int [][] arr = new int[n][2];
int up, down, left, right;
int x,y;
for (int i = 0; i<n; i++){
for (int j = 0; j<2; j++){
arr[i][j] = sc.nextInt();
}
}
for (int i = 0; i<n; i++){
up = down = left = right = 0;
x = arr[i][0];
y = arr[i][1];
for (int j = 0; j<n; j++){
if (x == arr[j][0]){
if (arr[j][1] > y){
up++;
}
if (arr[j][1] < y){
down++;
}
}
if (y == arr[j][1]){
if (arr[j][0] > x){
right++;
}
if (arr[j][0] < x){
left++;
}
}
}
if (up>0 && down>0 && left>0 && right>0){
count++;
}
}
System.out.println(count);
}
}