Pagini recente » Cod sursa (job #756116) | Cod sursa (job #1909391) | Cod sursa (job #1757533) | Cod sursa (job #2857245) | Cod sursa (job #1561599)
#include <stdio.h>
#include <bitset>
#define lmax 276997
#define mod1 666013
#define mod2 123451
#define mod3 756891
#define mod4 564131
#define mod5 458913
using namespace std;
typedef long long int ll;
int n,nr;
ll x;
bitset <mod1+10> uhash;
int main()
{
freopen("dtcsu.in","r",stdin);
freopen("dtcsu.out","w",stdout);
for (int i=1;i<=lmax;i++) {
scanf("%lld",&x);
uhash[x%mod1]=1; uhash[x%mod2]=1; uhash[x%mod3]=1;
uhash[x%mod4]=1; uhash[x%mod5]=1;
}
scanf("%d",&n);
for (int i=1;i<=n;i++) {
scanf("%lld",&x);
if (uhash[x%mod1]==1 && uhash[x%mod2]==1 && uhash[x%mod3]==1
&& uhash[x%mod4]==1 && uhash[x%mod5]==1) nr++;
}
printf("%d",nr);
return 0;
}