mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
34806a93cd
2500-2599
21 lines
315 B
C++
21 lines
315 B
C++
#include <iostream>
|
|
#include <cstdio>
|
|
#include <algorithm>
|
|
#include <cmath>
|
|
using namespace std;
|
|
int main()
|
|
{
|
|
int n;
|
|
scanf("%d",&n);
|
|
while(n--)
|
|
{
|
|
int a;
|
|
scanf("%d",&a);
|
|
int sum=0;
|
|
for(int i=pow(2.0,a-1);i<pow(2.0,a);i++)
|
|
sum+=__builtin_popcount(i);
|
|
printf("%d\n",sum);
|
|
}
|
|
return 0;
|
|
}
|