Pagini recente » Cod sursa (job #67103) | Cod sursa (job #524389) | Cod sursa (job #1080298) | Cod sursa (job #1911855) | Cod sursa (job #1644054)
#include <fstream>
#include <vector>
using namespace std;
ifstream f("dtcsu.in");
ofstream g("dtcsu.out");
int sol;
long long x;
vector<long long> V[9013];
void citire()
{
int i;
for(i=1;i<=276997;i++)
{
f>>x;
if(x&1) V[x%9013].push_back(x);
}
}
int gasit()
{
int a=x%9013;
for(size_t i=0;i<V[a].size();i++)
if(V[a][i]==x) return 1;
return 0;
}
void bloom()
{
int n,i;
f>>n;
for(i=1;i<=n;i++)
{
f>>x;
if(x)
{
while(!(x&1))
x=x>>1;
sol+=gasit();
}
}
}
int main()
{
citire();
bloom();
g<<sol;
return 0;
}