Cod sursa(job #1106957)

Utilizator alexalghisiAlghisi Alessandro Paolo alexalghisi Data 13 februarie 2014 14:40:08
Problema Dtcsu Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.76 kb
#include <iostream>
#include <fstream>
#include <algorithm>
#include <bitset>
#include <cstdio>
#include <vector>
#include <cmath>
#include <queue>
#include <string>
#include <map>
#include <unordered_set>


#define DN 10
#define pb push_back
#define mp make_pair
#define per pair<int,int>
#define INF (1<<30)
#define LL long long
#define un unsigned
#define x first
#define y second
using namespace std;

unordered_set< LL > h;


int main()
{
    LL n,x,rez=0;
    ifstream f("dtcsu.in");
    ofstream g("dtcsu.out");
    for(int i=1;i<=276997;++i){
        f>>x;
        if(x%2)
            h.insert(x);
    }
    f>>n;
    for(;n--;)
    {
        f>>x;
        while(!x%2)
            x/=2;
        if(h.find(x)!=h.end())
            ++rez;
    }
    g<<rez;

    return 0;
}