Pagini recente » Cod sursa (job #2061295) | Cod sursa (job #1810152) | Cod sursa (job #2307790) | Cod sursa (job #3218521) | Cod sursa (job #1561626)
#include <stdio.h>
#include <bitset>
#define lmax 276997
#define mod1 3666013
#define mod2 2712343
#define mod3 1756891
#define mod4 2564131
#define mod5 3458913
using namespace std;
typedef long long int ll;
int n,nr;
ll x;
bitset <4000010> 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;
}