Cod sursa(job #3283279)

Utilizator Mihai_OctMihai Octavian Mihai_Oct Data 8 martie 2025 20:04:06
Problema Dtcsu Scor 100
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.41 kb
#include <bits/stdc++.h>

using namespace std;

ifstream fin("dtcsu.in");
ofstream fout("dtcsu.out");
long long t, n, rasp;
int f = 276997;
unordered_set<long long> s;

int main() {
    while(f--) {
        fin >> t;
        if(t & 1LL) s.insert(t);
    }
    fin >> t;
    while(t--) {
        fin >> n;
        rasp += (n && s.count(n / (n & -n)));
    }
    fout << rasp;

    return 0;
}