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

为什么会超时?

Posted by wangke at 2007-05-05 20:44:24 on Problem 2726
#include<iostream.h>
int main()
{
	int n;
	while(cin>>n&&n!=0)
	{
		int (*a)[2]=new int[n][2];
		for(int i=0;i<n;i++)
		{
			cin>>a[i][0]>>a[i][1];
		}
		int s=0;
		for(i=0;i<n;i++)
		{
			for(int j=i+1;j<n;j++)
			{
				if(a[i][0]<a[j][0]&&a[i][1]<a[j][1])
				{
					s++;
					break;
				}
			}
		}
		cout<<s<<endl;
	}
	return 0;
}

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