Pagini recente » Cod sursa (job #2794656) | Cod sursa (job #388832) | Cod sursa (job #1521175) | Cod sursa (job #1519614) | Cod sursa (job #1038831)
#include <iostream>
#include <fstream>
#include <string.h>
#include <unordered_set>
using namespace std;
int n=276997;
long long x, k;
char s[20];
ifstream f("dtcsu.in");
ofstream g("dtcsu.out");
unordered_set<long long> m;
void citire(){
//f>>n; f.get();
while(n--){
f.getline(s, 20); x=0;
long long len=strlen(s);
int u=s[len-1]-'0'; //cout<<u<<' ';
if(!u&1) continue;
for(int i=0; i<len; ++i)
x=10*x+(s[i]-'0');
if(x&1) m.insert(x);// cout<<x<<'\n';// cout<<x<<'\n';
}
}
void imp(){
long long exp=64;
long long q;
while((!(x&1))&&x&&exp){
q=1<<exp;
if(!(x&(q-1)))
x/=q;
exp>>=1;
}
}
int main()
{
// n=5;
citire();
f>>n;f.get();
while(n--){
f.getline(s, 20); x=0;
long long len=strlen(s);
for(int i=0; i<len; ++i)
x=10*x+(s[i]-'0');
// while(!(x&1)) x>>=1;
imp();
//cout<<x<<' ';
if(m.find(x)!=m.end()) ++k;//, cout<<"\nam gasit "<<x<<'\n';
}
g<<k;
//cout<<(126>>32);
return 0;
}