Create a gist now

Instantly share code, notes, and snippets.

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define INF -99999999
typedef pair<int,int> P;
int num[1000000]={};
bool flg[1000000]={};
signed main() {
int N; cin>>N;
int ans=0;
for(int i=0;i<N;i++){
cin>>num[i];
for(;;){
if(num[i]%2)break;
num[i]/=2;
}
}
sort(num,num+N);
ans=1;
for(int i=0;i<N-1;i++){
if(num[i]!=num[i+1]) ans++;
}
cout<<ans<<endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment