| ||||||||||
| 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 | |||||||||
找不出哪里错#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator