Cod sursa(job #1106958)

Utilizator alexalghisiAlghisi Alessandro Paolo alexalghisi Data 13 februarie 2014 14:41:25
Problema Dtcsu Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.79 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()
{
    int n,rez=0;
    ifstream f("dtcsu.in");
    ofstream g("dtcsu.out");
    for(int i=1;i<=276997;++i){
        LLL x;
        f>>x;
        if(x%2)
            h.insert(x);
    }
    f>>n;
    for(;n--;)
    {
        LL x;
        f>>x;
        while!x%2==0)
            x/=2;
        if(h.find(x)!=h.end())
            ++rez;
    }
    g<<rez;

    return 0;
}