Pagini recente » Cod sursa (job #258136) | Cod sursa (job #3159547) | Cod sursa (job #955607) | Cod sursa (job #1812495) | Cod sursa (job #1067126)
#include<stdio.h>
#include<unordered_set>
#define nr 276997
#define mod 1000007
using namespace std;
unordered_set <long long> h;
int prim[5] = { 2, 3, 5, 7, 11 };
int main()
{
FILE*f = fopen("dtcsu.in", "r");
long long x;
for (int i = 1; i <= nr; ++i)
{
fscanf(f, "%lld", &x);
if (x & 1)
h.insert(x);
}
int q, sol = 0;
fscanf(f, "%d", &q);
for (int o = 1; o <= q; ++o)
{
fscanf(f, "%lld", &x);
if (!x)
continue;
x /= x&(-x);
if (h.find(x) != h.end())
{
++sol;
}
}
fclose(f);
FILE*g = fopen("dtcsu.out", "w");
fprintf(g, "%d", sol);
fclose(g);
return 0;
}