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 |
这道题怎么总是wa?#include <stdio.h> #include <math.h> int main() { int N,i,j,c[10001][32],tmp,a,b; scanf("%d",&N); for(i=1; i<=10000; i++) for(j=0; j<32; j++) c[i][j] = 0; for(i=1; i<=N; i++) { scanf("%d",&j); while(j--) { scanf("%d",&tmp); a = int(pow(2,i%32-1)); if((c[tmp][i/32]&a) == 0) c[tmp][i/32] += a; } } scanf("%d",&N); while(N--) { scanf("%d %d",&a,&b); tmp = 0; for(i=0; i<32&&tmp==0; i++) tmp = c[a][i] & c[b][i]; if(tmp!=0) printf("Yes\n"); else printf("No\n"); } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator