Cod sursa(job #1782702)

Utilizator nedelcu11Nedelcu Mihai Vlad nedelcu11 Data 18 octombrie 2016 15:23:24
Problema Dtcsu Scor 0
Compilator cpp Status done
Runda hash_excelenta Marime 0.59 kb
#include <fstream>
#include <vector>
#define MOD 9013
using namespace std;
ifstream f("dtcsu.in");
ofstream g("dtcsu.out");
int n,nr;
long long x;
vector <long long> H[MOD+2];
int main()
{   for(int i=1;i<=276997;i++)
    {   f>>x;
        if(x%2==1) H[x%MOD].pushback(x);
    }
    f>>q;
    for(int i=1;i<=q;i++)
    {   f>>x;
        if(x)
        {   while(x%2==0) x/=2;
            vector <long long > :: iterator it=L[x%MOD].begin, sf=L[x%MOD].end;
            for(;it!=sf;it++)
            {   if((*it)==x) nr++;
            }
        }
    }
    g<<nr;
    return 0;
}