Cod sursa(job #2100815)
Utilizator | Data | 6 ianuarie 2018 13:34:27 | |
---|---|---|---|
Problema | Dtcsu | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.4 kb |
#include <fstream>
#include <unordered_set>
using namespace std;
ifstream f ("dtcsu.in");
ofstream g ("dtcsu.out");
unordered_set <long long> usu;
long long sol,t,x;
int main()
{
for(int i=276997;i>=1;--i)
{
f>>x;
if(x&1LL) usu.insert(x);
}
f>>t;
while(t--)
{
f>>x;
if(x&&usu.find(x/(x&(-x)))!=usu.end()) ++sol;
}
g<<sol;
}