Created
February 28, 2015 14:11
-
-
Save ik11235/c619de5d236aaf73a92e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
int main(int argc, char *argv[]) | |
{ | |
int n; | |
set<int> hash; | |
int ans=0; | |
cin>>n; | |
for(int i=0;i<n;i++) | |
{ | |
int tmp; | |
cin>>tmp; | |
bool flag=true; | |
if(hash.count(tmp)!=0) | |
flag=false; | |
hash.insert(tmp); | |
while(tmp%2==0 && flag) | |
{ | |
tmp/=2; | |
if(hash.count(tmp)!=0) | |
{ | |
flag=false; | |
break; | |
} | |
hash.insert(tmp); | |
} | |
if(flag) | |
ans++; | |
} | |
cout<<ans<<endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment