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

这个题目都能tle。。。。。高手帮我看下。。。复杂度是100*500啊

Posted by huxinjie800 at 2009-08-13 17:41:00 on Problem 2864
#include <iostream>
using namespace std;
bool flag[105][505];
int main ()
{
	int n,d,i,j,ff;
	scanf("%d%d",&n,&d);
	while(n!=0&&d!=0)
	{
		for(i=1;i<=d;i++)
			for(j=1;j<=n;j++)
				scanf("%d",&flag[i][j]);
		for(i=1;i<=n;i++)
		{
			ff=0;
			for(j=1;j<=d;j++)
			{
				if(flag[j][i]==0){ff=1;break;}
			}
			if(ff==0)break;
		}
		if(ff==0)printf("yes\n");
		else printf("no\n");
		scanf("%d%d",&n,&d);
	}
	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