Create 3566_zp___waj.cpp

This commit is contained in:
Kirigaya Kazuto 2016-10-12 21:12:42 +08:00 committed by GitHub
parent 8c657fe81d
commit 6efd43b096

16
SDUTOJ/3566_zp___waj.cpp Normal file
View File

@ -0,0 +1,16 @@
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
int n,loop,cnt=1;
scanf("%d",&loop);
while(loop--){
scanf("%d",&n);
if(n<6||n&1)puts("0");
else {
int ans=__builtin_popcount(n);
printf("%lld\n",((ll)pow(3.0,ans)-3)/6);
}
}
return 0;
}