Language: C++

#include<iostream>
#include<iomanip>
#include<cstdio>
#include<cstdlib>
#include<cassert>

#include<cmath>
#include<functional>
#include<algorithm>

#include<vector>
#include<string>
#include<queue>
#include<stack>
#include<set>
#include<unordered_set>
#include<map>
#include<unordered_map>
#include<bitset>
#include<tuple>

#define TEST {IS_TEST=true;}

using namespace std;
using ll = int_fast64_t;
using v_bool = vector <bool>;
using v_ll = vector <ll>;
using v_std = vector <string>;
using p_ll = pair <ll,ll>;
using vv_ll = vector <vector <ll> >;
using vp_ll = vector < p_ll >;

using ld = long double;
using v_ld = vector <ld>;
using vv_ld = vector<v_ld>;

bool IS_TEST=false;
ll ll_min=1LL<<63;
ll ll_max=~ll_min;
ll int_min=1LL<<31;
ll int_max=~ll_max;
ll MOD = 1000000007;

template<class T>
void show(const T &x){
  if (!IS_TEST) return;
  cout << x << endl;
}
template<class T1,class T2>
void show(const pair<T1,T2> &x){
  if (!IS_TEST) return;
  cout << "{" << x.first << "," << x.second << "}" << endl;
}

template<class T>
void show_sub(const T &x){if (!IS_TEST) return; cout << x;}
void show_sub(const string &x){if (!IS_TEST) return; cout << x << endl;}
template<class T1,class T2>
void show_sub(const pair<T1,T2> &x){
  if (!IS_TEST) return;
  cout << "{" << show_sub(x.first) << "," << show_sub(x.second) << "}";
}
template<class T>
void v_show(const T &v){
  if (!IS_TEST) return;
  auto itr=v.begin();
  while(itr!=v.end()){ show_sub(*itr); itr++;}
  cout << endl;
}

template<class T>
void vv_show(const T &v){
  if (!IS_TEST) return;
  cout << "--------------------------------\n";
  auto itr=v.begin();
  while(itr!=v.end()){ v_show(*itr); itr++;}
  cout << "--------------------------------" << endl;
}



ll max(ll x,ll y){return x>y?x:y;}
ll max(ll x,ll y, ll z){return max(max(x,y),z);}
ll max(v_ll::iterator b,v_ll::iterator e){
    ll ans=*b;
    while (b<e) {ans=max(ans,*b);b++;}
    return ans;
}
ll min(ll x,ll y){return x<y?x:y;}
ll min(ll x,ll y, ll z){return min(min(x,y),z);}
ll min(v_ll::iterator b,v_ll::iterator e){
    ll ans=*b;
    while (b<e) {ans=min(ans,*b);b++;}
    return ans;
}
ll mid(ll x,ll y,ll z){
    if (y>=x && x>=z) return x;
    if (z>=x && x>=y) return x;
    if (x>=y && y>=z) return y;
    if (z>=y && y>=x) return y;
    if (x>=z && z>=y) return z;
    if (y>=z && z>=x) return z;
    return x;
}
ll gcd(ll x,ll y){
    if(x<0)x=-x; if(y<0)y=-y;
    while(y>0){ x%=y; swap(x,y); }
    return x;
}
ll gcd(ll x,ll y, ll z){return gcd(gcd(x,y),z);}
ll gcd(v_ll::iterator b,v_ll::iterator e){
    ll ans=0;
    while (b<e) ans=gcd(ans,*b);
    return ans;
}
ll lcm(ll x,ll y){
    ll z=x*y; if(x<0)x=-x; if(y<0)y=-y;
    while(y>0){ x%=y; swap(x,y); }
    return z/x;
}
ll lcm(ll x,ll y, ll z){return lcm(lcm(x,y),z);}
ll lcm(v_ll::iterator b,v_ll::iterator e){
    ll ans=1;
    while (b<e) ans=lcm(ans,*b);
    return ans;
}

v_ll arange(ll n){
    v_ll v(n+1,0);
    for(ll i=0;i<=n;i++)v[i]=i;
    return v;
}

ll vec_sum(const v_ll& v,ll b,ll e){
    ll ans=0;
    for(ll i=b;i<e;i++)ans+=v[i];
    return ans;
}
ll v_sum(v_ll::iterator b,v_ll::iterator e){
    ll ans=*b;
    while (b<e) { ans+=*b; b++;}
    return ans;
}
ll v_xor(v_ll::iterator b,v_ll::iterator e){
    ll ans=*b;
    while (b<e) { ans^=*b; b++;}
    return ans;
}
ll v_eq(v_ll::iterator b,v_ll::iterator e){
    ll ans=*b;
    while (b<e) { ans^=~*b; b++;}
    return ans;
}


template<class T> void refl_max(T& x,const T& y){ if (x>=y) return; x=y; }
template<class T> void refl_min(T& x,const T& y){ if (x<=y) return; x=y; }

template<class T,class S> void refl_max(T& x,S& xx,const T& y,const S& yy){
  if (x>=y) return; x=y; xx=yy;
}
template<class T,class S> void refl_min(T& x,S& xx,const T& y,const S& yy){
  if (x<=y) return; x=y; xx=yy;
}

template<class T> void quit(T x){cout << x << endl; exit(0);}

/*O(logN)*/
ll sqrt_ll(ll n){
  assert(n>=0);
  ll ok = 0,ng = n+1;
  while(ok-ng>1||ng-ok>1){ ll m=(ok+ng)/2; if (m*m<=n) ok=m; else ng=m;}
  return ok;
}

ll N;
v_ll A;
int main(){
  cin >> N;
  A.assign(N+10,0);
  for (ll i=0;i<N;i++){
    cin >> A[i];3 
  }
  ll ans=0;
  for (ll d=0;d<60;d++){
    ll n0=0,n1=0;
    for (ll i=0;i<N;i++){
      if (A[i]>>d &1) n1++;
      else n0++;
    }
    ll x=(n0*n1)%1000000007LL;
    x=x*((1LL<<d)%1000000007LL)%1000000007LL;
    ans+=x;
    ans%=1000000007LL;
  }
  cout << ans << endl;
}




Compiler output:
a.cc:25:12: error: 'int_fast64_t' does not name a type
   25 | using ll = int_fast64_t;
      |            ^~~~~~~~~~~~
a.cc:27:22: error: 'll' was not declared in this scope
   27 | using v_ll = vector <ll>;
      |                      ^~
a.cc:27:24: error: template argument 1 is invalid
   27 | using v_ll = vector <ll>;
      |                        ^
a.cc:27:24: error: template argument 2 is invalid
a.cc:29:20: error: 'll' was not declared in this scope
   29 | using p_ll = pair <ll,ll>;
      |                    ^~
a.cc:29:23: error: 'll' was not declared in this scope
   29 | using p_ll = pair <ll,ll>;
      |                       ^~
a.cc:29:25: error: template argument 1 is invalid
   29 | using p_ll = pair <ll,ll>;
      |                         ^
a.cc:29:25: error: template argument 2 is invalid
a.cc:30:31: error: 'll' was not declared in this scope
   30 | using vv_ll = vector <vector <ll> >;
      |                               ^~
a.cc:30:33: error: template argument 1 is invalid
   30 | using vv_ll = vector <vector <ll> >;
      |                                 ^
a.cc:30:33: error: template argument 2 is invalid
a.cc:30:35: error: template argument 1 is invalid
   30 | using vv_ll = vector <vector <ll> >;
      |                                   ^
a.cc:30:35: error: template argument 2 is invalid
a.cc:31:24: error: 'p_ll' was not declared in this scope
   31 | using vp_ll = vector < p_ll >;
      |                        ^~~~
a.cc:31:29: error: template argument 1 is invalid
   31 | using vp_ll = vector < p_ll >;
      |                             ^
a.cc:31:29: error: template argument 2 is invalid
a.cc:38:1: error: 'll' does not name a type; did you mean 'ld'?
   38 | ll ll_min=1LL<<63;
      | ^~
      | ld
a.cc:39:1: error: 'll' does not name a type; did you mean 'ld'?
   39 | ll ll_max=~ll_min;
      | ^~
      | ld
a.cc:40:1: error: 'll' does not name a type; did you mean 'ld'?
   40 | ll int_min=1LL<<31;
      | ^~
      | ld
a.cc:41:1: error: 'll' does not name a type; did you mean 'ld'?
   41 | ll int_max=~ll_max;
      | ^~
      | ld
a.cc:42:1: error: 'll' does not name a type; did you mean 'ld'?
   42 | ll MOD = 1000000007;
      | ^~
      | ld
a.cc:82:1: error: 'll' does not name a type; did you mean 'ld'?
   82 | ll max(ll x,ll y){return x>y?x:y;}
      | ^~
      | ld
a.cc:83:1: error: 'll' does not name a type; did you mean 'ld'?
   83 | ll max(ll x,ll y, ll z){return max(max(x,y),z);}
      | ^~
      | ld
a.cc:84:1: error: 'll' does not name a type; did you mean 'ld'?
   84 | ll max(v_ll::iterator b,v_ll::iterator e){
      | ^~
      | ld
a.cc:89:1: error: 'll' does not name a type; did you mean 'ld'?
   89 | ll min(ll x,ll y){return x<y?x:y;}
      | ^~
      | ld
a.cc:90:1: error: 'll' does not name a type; did you mean 'ld'?
   90 | ll min(ll x,ll y, ll z){return min(min(x,y),z);}
      | ^~
      | ld
a.cc:91:1: error: 'll' does not name a type; did you mean 'ld'?
   91 | ll min(v_ll::iterator b,v_ll::iterator e){
      | ^~
      | ld
a.cc:96:1: error: 'll' does not name a type; did you mean 'ld'?
   96 | ll mid(ll x,ll y,ll z){
      | ^~
      | ld
a.cc:105:1: error: 'll' does not name a type; did you mean 'ld'?
  105 | ll gcd(ll x,ll y){
      | ^~
      | ld
a.cc:110:1: error: 'll' does not name a type; did you mean 'ld'?
  110 | ll gcd(ll x,ll y, ll z){return gcd(gcd(x,y),z);}
      | ^~
      | ld
a.cc:111:1: error: 'll' does not name a type; did you mean 'ld'?
  111 | ll gcd(v_ll::iterator b,v_ll::iterator e){
      | ^~
      | ld
a.cc:116:1: error: 'll' does not name a type; did you mean 'ld'?
  116 | ll lcm(ll x,ll y){
      | ^~
      | ld
a.cc:121:1: error: 'll' does not name a type; did you mean 'ld'?
  121 | ll lcm(ll x,ll y, ll z){return lcm(lcm(x,y),z);}
      | ^~
      | ld
a.cc:122:1: error: 'll' does not name a type; did you mean 'ld'?
  122 | ll lcm(v_ll::iterator b,v_ll::iterator e){
      | ^~
      | ld
a.cc:128:1: error: 'v_ll' does not name a type; did you mean 'v_ld'?
  128 | v_ll arange(ll n){
      | ^~~~
      | v_ld
a.cc:134:1: error: 'll' does not name a type; did you mean 'ld'?
  134 | ll vec_sum(const v_ll& v,ll b,ll e){
      | ^~
      | ld
a.cc:139:1: error: 'll' does not name a type; did you mean 'ld'?
  139 | ll v_sum(v_ll::iterator b,v_ll::iterator e){
      | ^~
      | ld
a.cc:144:1: error: 'll' does not name a type; did you mean 'ld'?
  144 | ll v_xor(v_ll::iterator b,v_ll::iterator e){
      | ^~
      | ld
a.cc:149:1: error: 'll' does not name a type; did you mean 'ld'?
  149 | ll v_eq(v_ll::iterator b,v_ll::iterator e){
      | ^~
      | ld
a.cc:169:1: error: 'll' does not name a type; did you mean 'ld'?
  169 | ll sqrt_ll(ll n){
      | ^~
      | ld
a.cc:176:1: error: 'll' does not name a type; did you mean 'ld'?
  176 | ll N;
      | ^~
      | ld
a.cc:177:1: error: 'v_ll' does not name a type; did you mean 'v_ld'?
  177 | v_ll A;
      | ^~~~
      | v_ld
a.cc: In function 'int main()':
a.cc:179:10: error: 'N' was not declared in this scope
  179 |   cin >> N;
      |          ^
a.cc:180:3: error: 'A' was not declared in this scope
  180 |   A.assign(N+10,0);
      |   ^
a.cc:181:8: error: 'll' was not declared in this scope; did you mean 'ld'?
  181 |   for (ll i=0;i<N;i++){
      |        ^~
      |        ld
a.cc:181:15: error: 'i' was not declared in this scope
  181 |   for (ll i=0;i<N;i++){
      |               ^
a.cc:182:18: error: expected ';' before '}' token
  182 |     cin >> A[i];3
      |                  ^
      |                  ;
  183 |   }
      |   ~               
a.cc:184:3: error: 'll' was not declared in this scope; did you mean 'ld'?
  184 |   ll ans=0;
      |   ^~
      |   ld
a.cc:185:10: error: expected ';' before 'd'
  185 |   for (ll d=0;d<60;d++){
      |          ^~
      |          ;
a.cc:185:15: error: 'd' was not declared in this scope; did you mean 'ld'?
  185 |   for (ll d=0;d<60;d++){
      |               ^
      |               ld
a.cc:186:7: error: expected ';' before 'n0'
  186 |     ll n0=0,n1=0;
      |       ^~~
      |       ;
a.cc:187:12: error: expected ';' before 'i'
  187 |     for (ll i=0;i<N;i++){
      |            ^~
      |            ;
a.cc:187:17: error: 'i' was not declared in this scope
  187 |     for (ll i=0;i<N;i++){
      |                 ^
a.cc:188:23: error: 'n1' was not declared in this scope; did you mean 'y1'?
  188 |       if (A[i]>>d &1) n1++;
      |                       ^~
      |                       y1
a.cc:189:12: error: 'n0' was not declared in this scope; did you mean 'y0'?
  189 |       else n0++;
      |            ^~
      |            y0
a.cc:191:7: error: expected ';' before 'x'
  191 |     ll x=(n0*n1)%1000000007LL;
      |       ^~
      |       ;
a.cc:192:5: error: 'x' was not declared in this scope
  192 |     x=x*((1LL<<d)%1000000007LL)%1000000007LL;
      |     ^
a.cc:193:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
  193 |     ans+=x;
      |     ^~~
      |     abs
a.cc:196:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
  196 |   cout << ans << endl;
      |           ^~~
      |           abs