Cod sursa(job #1505974)
Utilizator | Data | 19 octombrie 2015 21:57:51 | |
---|---|---|---|
Problema | Dtcsu | Scor | 20 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.42 kb |
#include <fstream>
#include <unordered_set>
using namespace std;
ifstream fin("dtcsu.in");
ofstream fout("dtcsu.out");
unordered_set <long long> h;
int main()
{
int t=276997;
long long sol=0, n;
while(t--)
{
fin>>n;
if(n&1LL) h.insert(n);
}
fin>>t;
while(t--)
{
fin>>n;
if(n&&h.find(n/(n&(-n)))!=h.end()) sol++;
}
fout<<sol;
}