记录一下
#include <iostream>
#include <vector>
#include <utility>
#include <string.h>
#include <algorithm>
using namespace std;
vector<pair<int,int>> point;
bool isStation(vector<pair<int,int>>::iterator it){
vector<pair<int,int>> pv;
pv.push_back(make_pair((*it).first-1,(*it).second));
pv.push_back(make_pair((*it).first+1,(*it).second));
pv.push_back(make_pair((*it).first,(*it).second-1));
pv.push_back(make_pair((*it).first,(*it).second+1));
for(pair<int,int> a:pv)
if(find(point.begin(),point.end(),a)==point.end())
return false;
return true;
}
int grade(vector<pair<int,int>>::iterator it){
vector<pair<int,int>> pv;
pv.push_back(make_pair((*it).first-1,(*it).second-1));
pv.push_back(make_pair((*it).first-1,(*it).second+1));
pv.push_back(make_pair((*it).first+1,(*it).second-1));
pv.push_back(make_pair((*it).first+1,(*it).second+1));
int sum=0;
for(pair<int,int> a:pv)
if(find(point.begin(),point.end(),a)!=point.end())
sum++;
return sum;
}
int main()
{
int n;
cin>>n;
for(int i=0;i<n;i++){
int x,y;
cin>>x>>y;
pair<int,int> a(x,y);
point.push_back(a);
}
int sum[5];
memset(sum,0,sizeof(sum));
for(vector<pair<int,int>>::iterator it=point.begin();it!=point.end();it++)
if(isStation(it)) sum[grade(it)]++;
for(int i=0;i<5;i++){
cout<<sum[i];
if(i!=4) cout<<endl;
}
return 0;
}