hdu 1152 Brownie Points I
//15MS 248K 601 B C++ //读不懂题意是硬伤啊... //以输入的中间那个点为中点分成四个象限,再统计 #include<stdio.h> struct node{ int x,y; }v[200005]; int main(void) { int x,y,n; while(scanf("%d",&n),n) { for(int i=0;i<n;i++) scanf("%d%d",&v[i].x,&v[i].y); x=v[n/2].x; y=v[n/2].y; int cntx=0; int cnty=0; for(int i=0;i<n;i++){ v[i].x-=x; v[i].y-=y; if(v[i].x==0 || v[i].y==0) continue; if(v[i].x>0&&v[i].y>0 || v[i].x<0&&v[i].y<0) cntx++; else cnty++; } printf("%d %d\n",cntx,cnty); } return 0; }