0
已解决
曹博扬
初级天翼
初级天翼
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<string>
using namespace std;
int t,n;
int main(){
cin>>t;
while(t--){
cin>>n;
long long s=0;
s+=0.5*(1+n)*n;
for(long long i=1;i<=n;i*=2){
s-=2*i;
//cout<<i<<endl;
}
//cout<<s<<" ";
cout<<s<<endl;
}
return 0;
}
20分