Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

哪位大虾帮忙看看为什么通不过啊?老是提示wrong anserw!谢谢拉!

Posted by bj051052 at 2007-05-11 11:23:52 on Problem 1828
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator