-
Notifications
You must be signed in to change notification settings - Fork 0
/
A.cpp
35 lines (35 loc) · 769 Bytes
/
A.cpp
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
#include<stdio.h>
int main()
{
int n,x[202],y[202],l,r,u,d,i,j,count=0;
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d%d",&x[i],&y[i]);
for(i=0;i<n;i++)
{
l=0;
r=0;
u=0;
d=0;
for(j=0;j<n;j++)
{
if(j==i)
continue;
else
{
if(x[j]<x[i] && y[j]==y[i])
l++;
else if(x[j]>x[i] && y[j]==y[i])
r++;
else if(x[j]==x[i] && y[j]<y[i])
d++;
else if(x[j]==x[i] && y[j]>y[i])
u++;
}
}
if(l>=1 && r>=1 && u>=1 && d>=1)
count++;
}
printf("%d\n",count);
return 0;
}