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 beizhongyue at 2009-07-26 14:12:28 on Problem 2443
#include<iostream>
using namespace std;
unsigned int a[10001],b[10001];
int main()
{
	int i,j,n,q,m,t;
	unsigned int ii,jj;
	while(scanf("%d",&n)!=EOF)
	{
		memset(a,0,sizeof(a));
		memset(b,0,sizeof(b));
		for(i=0;i<n;i++)
		{
			scanf("%d",&m);
			ii=1<<(i/32);
			jj=1<<(i%32);
			for(j=0;j<m;j++)
			{
				scanf("%d",&t);
				a[t]=a[t]|ii;
				b[t]=b[t]|jj;
			}
		}
		scanf("%d",&q);
		for(n=0;n<q;n++)
		{
			cin>>i>>j;
			if((a[i]&a[j])&&(b[i]&b[j])) printf("Yes\n");
			else printf("No\n");
		}
	}
	return 1;
}

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