#include<iostream>
#include<cstdio>
#include<set>
using namespace std;
struct Point {
int x,y;
Point(int _x,int _y):x(_x),y(_y){}
bool operator <( const Point &rhs) const {
if(x==rhs.x) return y<rhs.y;
return x<rhs.x;
}
};
int n;
int ans[5];
set<Point> pts;
bool find(int x,int y){
if(pts.find(Point(x,y))!=pts.end()) return true;
return false;
}
int main(){
int x,y;
cin>>n;
for(int i=0;i<n;i++){
cin>>x>>y;
pts.insert(Point(x,y));
}
set<Point>::iterator it;
for(it=pts.begin();it!=pts.end();it++){
x=(*it).x;
y=(*it).y;
if(find(x, y+1) && find(x, y-1) && find(x+1, y) && find(x-1, y)){
int cnt=0;
if(find(x-1, y+1)) cnt++;
if(find(x+1, y+1)) cnt++;
if(find(x-1, y-1)) cnt++;
if(find(x+1, y-1)) cnt++;
ans[cnt]++;
}
}
for(int i=0;i<5;i++){
cout<<ans[i]<<endl;
}
return 0;
}
201912-2 回收站选址
最新推荐文章于 2024-01-07 17:19:35 发布

1700

被折叠的 条评论
为什么被折叠?



