int count_one(unsigned x){
int count=0;
while(x){
count++;
x=x&(x-1);
}
return count;
}
int count_one2(unsigned x){
int count=0;
int i=0;
while(i<32){
if((x>>i)&0x1)
count++;
i++;
}
return count;
}
int count_one3(unsigned x){
static const int hex[]={0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4};
int count=0;
int i=0;
while(i<8){
count+=hex[(x>>(i*4))&0xf];
i++;
}
return count;
}