-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathp5.cpp
More file actions
33 lines (30 loc) · 667 Bytes
/
Copy pathp5.cpp
File metadata and controls
33 lines (30 loc) · 667 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
#include<iostream>
#include<set>
#include<array>
using namespace std;
using int2=array<int,2>;
int dx[]{-1,1,0,0,-1,-1,1,1},dy[]{0,0,-1,1,-1,1,-1,1};
int main(){
int n; cin>>n;
set<int2>s;
for(int i=0;i<n;i++){
int x,y; cin>>x>>y;
s.insert({x,y});
}
int res[5]{0};
for(auto [x,y]:s){
bool ok=1;
for(int i=0;i<4;i++)
if(s.count({x+dx[i],y+dy[i]})==0)
ok=0;
if(!ok) continue;
int cnt=0;
for(int i=4;i<8;i++)
if(s.count({x+dx[i],y+dy[i]}))
++cnt;
++res[cnt];
}
for(auto x:res)
cout<<x<<endl;
return 0;
}