Cod sursa(job #3327380)
| Utilizator | Data | 3 decembrie 2025 17:23:32 | |
|---|---|---|---|
| Problema | Dtcsu | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.66 kb |
#include <bits/stdc++.h>
#define P 8887
using namespace std;
ifstream fin("dtcsu.in");
ofstream fout("dtcsu.out");
vector <long long> h[P];
int q;
int main()
{
int i, cnt, gasit;
long long x;
for(i = 1; i <= 276997; i++)
{
fin >> x;
x /= (x & -x);
h[x % P].push_back(x);
}
cnt = 0;
fin >> q;
for(i = 1; i <= q; i++)
{
fin >> x;
if(x > 0)
{
x /= (x & -x);
gasit = 0;
for(long long y : h[x % P])
if(y == x) gasit = 1;
cnt += gasit;
}
}
fout << cnt << '\n';
return 0;
}
