|
|
back to boardwhy wa4? Posted by LGH 23 Jul 2009 13:04 I use binary array. Where is wrong? long n,m,i,k; long p[65539]; int Ok=0; cin>>n; for(i=0;i<65539;i++){p[i]=0;} for(i=0;i<n;i++){cin>>k; p[k+32768]=1;} cin>>m; for(i=0;i<m&&!Ok;i++){cin>>k; if (p[42768-k]){Ok=1;}} if (Ok) {cout<<"YES";} else {cout<<"NO";} |
|
|