Pagini recente » Cod sursa (job #2452025) | Cod sursa (job #1105175) | Cod sursa (job #2018410) | Clasament simulare_003 | Cod sursa (job #1854115)
Utilizator |
Popescu Ioan gioto |
Data |
22 ianuarie 2017 13:43:00 |
Problema |
Dtcsu |
Scor |
0 |
Compilator |
cpp |
Status |
done |
Runda |
antr5 |
Marime |
0.87 kb |
#include <cstdio>
#include <vector>
#define MOD 12290
using namespace std;
std :: vector <long long> Hash[12292];
int m;
long long x;
inline void add_to_Hash(int x){
int L = x % MOD;
Hash[L].push_back(x);
}
inline bool check_Hash(int x){
int L = x % MOD;
vector<long long>:: iterator it;
for(it = Hash[L].begin(); it != Hash[L].end() ; ++it)
if(*it == x) return 1;
return 0;
}
int main()
{
freopen("dtcsu.in", "r", stdin);
freopen("dtcsu.out", "w", stdout);
for(int i = 1; i <= 276997 ; ++i){
scanf("%lld", &x);
if(x % 2 == 1)
add_to_Hash(x);
}
scanf("%d", &m);
int Sol = 0;
for(int i = 1; i <= m ; ++i){
scanf("%lld", &x);
if(!x) continue ;
x = x / (x & (-x));
Sol = Sol + check_Hash(x);
}
printf("%d", Sol);
return 0;
}