Pagini recente » Cod sursa (job #1513274) | Cod sursa (job #2724670) | Cod sursa (job #2351000) | Cod sursa (job #139790) | Cod sursa (job #1854118)
| Utilizator |
Popescu Ioan gioto |
Data |
22 ianuarie 2017 13:46:31 |
| Problema |
Dtcsu |
Scor |
100 |
| Compilator |
cpp |
Status |
done |
| Runda |
antr5 |
Marime |
0.73 kb |
#include <cstdio>
#include <vector>
#define MOD 12289
using namespace std;
vector <long long> Hash[12290];
vector <long long> :: iterator it;
int m;
long long x;
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)
Hash[x % MOD].push_back(x);
}
m = 3;
scanf("%d", &m);
int Sol = 0;
for(int i = 1; i <= m ; ++i){
scanf("%lld", &x);
if(!x) continue ;
x = x / (x & (-x));
for(it = Hash[x % MOD].begin(); it != Hash[x % MOD].end() ; ++it)
if(*it == x){++Sol; break;}
}
printf("%d", Sol);
return 0;
}