Cod sursa(job #3256316)
| Utilizator | Data | 14 noiembrie 2024 09:18:38 | |
|---|---|---|---|
| Problema | Dtcsu | Scor | 20 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.64 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fcin("dtcsu.in");
ofstream fcout("dtcsu.out");
const int P = 8887;
std::vector<long long> h[P];
int n, m, rasp;
int cautare(long long x)
{
int r = x % P;
for (long long e : h[r])
if (e == x)
return 1;
return 0;
}
int main()
{
long long x;
for (int i = 1; i <= 276997; i++)
{
fcin >> x;
x = x / (x & -x);
h[x % P].push_back(x);
}
int q;
fcin >> q;
while (q--)
{
fcin >> x;
x = x / (x & -x);
rasp += cautare(x);
}
fcout << rasp;
return 0;
}
