Lucas定理:
2的p次方,p为n-1二进制中1的个数
#include<cstdio>
#include<iostream>
#include<cstring>
#include<algorithm>
using namespace std;
#define ll long long
int main()
{
ll n;
int t;
scanf("%d",&t);
while (t--)
{
scanf("%lld",&n);
ll cnt=0;
n--;
while (n)
{
if(n&1)
cnt++;
n>>=1;
}
ll ans=1ll<<cnt;
printf("%lld\n",ans);
}
return 0;
}