题解 | 小q的数列
小q的数列
https://www.nowcoder.com/practice/8ea1e0d996f64e15961ae42e658a04a7
#include <iostream>
using namespace std;
long long fx(long long x)
{
if(x==0) return 0;
if(x==1) return 1;
return fx(x/2)+fx(x%2);
}
int main() {
int t;
cin>>t;
while(t--)
{
long long x;
cin>>x;
long long c=fx(x);
cout<<c<<" "<<(1LL<<c)-1<<endl;;
}
return 0;
}
// 64 位输出请用 printf("%lld")