Pagini recente » Cod sursa (job #1024312) | Cod sursa (job #1138270) | Cod sursa (job #3180433) | Cod sursa (job #609612) | Cod sursa (job #2026812)
#include <fstream>
#include <bitset>
#define lg 276997
using namespace std;
ifstream fi ("dtcsu.in");
ofstream fo ("dtcsu.out");
bitset<100000> hsh[3];
int i,x,q,h,sol;
int main()
{
for (i=1;i<=lg;i++)
{
fi>>x;
hsh[0][x%99073]=1;
hsh[1][x%99607]=1;
hsh[2][x%90601]=1;
}
fi>>q;
for (i=1;i<=q;i++)
{
fi>>x;
bool ok=true;
if (hsh[0][x%99073]==0) ok=false;
if (hsh[1][x%99607]==0) ok=false;
if (hsh[2][x%90601]==0) ok=false;
if (ok) sol++;
}
fo<<sol;
return 0;
}