Pagini recente » Cod sursa (job #2839503) | Cod sursa (job #298071) | Cod sursa (job #3167568) | Cod sursa (job #668090) | Cod sursa (job #2026814)
#include <fstream>
#include <bitset>
#define lg 276997
using namespace std;
ifstream fi ("dtcsu.in");
ofstream fo ("dtcsu.out");
bitset<200004> hsh[6];
int i,x,q,h,sol;
int main()
{
for (i=1;i<=lg;i++)
{
fi>>x;
for (h=0;h<=5;h++)
hsh[h][x%(100000+(35*h*h+74*h+108)%100001)]=1;
}
fi>>q;
for (i=1;i<=q;i++)
{
fi>>x;
bool ok=true;
for (h=0;h<=5;h++)
if (hsh[h][x%(100000+(35*h*h+74*h+108)%100001)]) ok=false;
if (ok) sol++;
}
fo<<sol;
return 0;
}