Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
怎么讨论得那么复杂?? 这题很简单吧?? 我的代码#include<stdio.h> int x[200001]; int y[200001]; int main() { int n; while(scanf("%d",&n),n){ for(int i=0;i<n;i++)scanf("%d %d",&x[i],&y[i]); int a=0; int b=0; int xi=x[n/2]; int yi=y[n/2]; for(int i=0;i<n;i++){ if(x[i]>xi && y[i]>yi || x[i]<xi && y[i]<yi){ a++; } else if(x[i]>xi && y[i]<yi || x[i]<xi && y[i]>yi){ b++; } } printf("%d %d\n",a,b); } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator