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 |
哪位大虾帮忙看看为什么通不过啊?老是提示wrong anserw!谢谢拉!#include<iostream.h> void main() { struct point { int x; int y; }point[50000]; int i,j,n,k,a,num; while(n!=0) { cin>>n; num=0; for(k=0;k<n;k++)//输入数据 { cin>>i; cin>>j; point[k].x=i; point[k].y=j; } for(int m=0;m<n;m++)//比较得出结果 { a=0; for(k=0;k<n;k++) if(point[m].x<=point[k].x && point[m].y<=point[k].y && m!=k) a++;//若是没有别的坐标比其大,则a不变 if(a==0) num++; } if(n!=0) cout<<num<<endl; } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator