criyle/codenet-compile-errors huggingface dataset:
Language: C++

using namespace std;
signed main(){
    long long n , a[300005] , inf=1000000007 , k=1 , z , o , ans=0;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
 
    for(long long i=0;i<=60;i++){
        z = o = 0;
        for(int j=0;j<n;j++){
            if(a[j]%2 == 1){
                o++;
            } else {
                z++;
            }
            a[j]/=2;
        }
        ans+=(z*o)*(k%inf);
        ans = ans%inf , k=(k*2);
    }
 
    cout<<ans<<endl;
    return(0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:5: error: 'cin' was not declared in this scope
    4 |     cin>>n;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:23:5: error: 'cout' was not declared in this scope
   23 |     cout<<ans<<endl;
      |     ^~~~
a.cc:23:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:23:16: error: 'endl' was not declared in this scope
   23 |     cout<<ans<<endl;
      |                ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: C++

M=10**9+7
N=int(input())
la=list(map(int,input().split()))
ans=0
for i in range(60):
    n0=0
    n1=0
    for j in range(N):
        if la[j]&1:
            n1+=1
        else:
            n0+=1
        la[j]>>=1
    ans=(ans+n0*n1%M*(2**i%M))%M
print(ans)


Compiler output:
a.cc:1:1: error: 'M' does not name a type
    1 | M=10**9+7
      | ^
Language: C++

#include <iostream>
#include <iomanip>
#include <bits/stdc++.h>
#include <vector>
#include <iterator>
#include <string>
#define pan(i,n) for(int i=0;i<n;i++)
#define ll long long int
#define vi vector<int>
#define pb push_back
#define INF 1000000007
using namespace std;



int main(){
    int n;
    cin>>n;
    ll ele=0;
    ll zero[61]{0},one[61]{0};
    pan(j,n){
        cin>>ele;
        pan(i,61){
            if(ele % 2 ==1) one[i]++;
            else zero[i]++;
            ele/=2;
        }
    }
    ll sum=0;
    pan(i,60){
        sum+=((bit0[i]*bit1[i])%INF*(pow(2,i))%INF)%INF;
        // cout<<bit1[i]<<"--"<<bit0[i]<<endl;
    }
    cout<<sum;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:16: error: 'bit0' was not declared in this scope
   31 |         sum+=((bit0[i]*bit1[i])%INF*(pow(2,i))%INF)%INF;
      |                ^~~~
a.cc:31:24: error: 'bit1' was not declared in this scope
   31 |         sum+=((bit0[i]*bit1[i])%INF*(pow(2,i))%INF)%INF;
      |                        ^~~~
Language: C

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
/*
*/

ll gcd(ll a,ll b){
  if(b == 0) return a;
  return gcd(b, a % b);
}

using Graph = vector<vector<int>>;

ll calc(ll a, ll b, ll p){//aのb乗をpで割った余り
  if(b == 0) return 1;

  else if(b%2 == 0){
    ll d = calc(a,b/2,p);
    return (d*d)%p;
  }
  else if(b%2 == 1){
    return (a * calc(a,b-1,p))%p;
  }
}

typedef pair<int,int> P;

bool is_prime(int n){//nが素数であるかどうか判定 iで割り切れると素数でない
    if(n == 1) return false;//1は例外
    for(int i = 2;i*i <= n;i++){
        if(n%i == 0) return false;
    }
    
    return true;
}

int main(){
  int N;
  cin >> N;
  vector<ll> A(N);
  rep(i,N){
    cin >> A[i];
  }
  ll p = 1000000000 + 7;
  vector<int> memo(61);//memo[k]は、数列Aにおける2のk乗桁が1であるものの個数
  rep(i,N){
    ll a = A[i];

    int k = 0;
    while(a){
      if(a%2) memo[k]++;
      a /= 2;
      k++;
    }
  }
  ll ans = 0;
  rep(i,N){
    ll a = A[i];
    //vector<int> bitv;
    int k = 0;
    while(true){//k桁目の値の確認とbit化を同時にやる
      //v.push_back(a%2);//A[i]のk桁目
      if(a%2){//A[i]の2k桁は1
        int c = N - memo[k];//2k桁が0であるものの数
        ans += c * calc(2,k,p);
        ans %= p;
      }
      else{//A[i]の2k桁は0
        int c = memo[k];//2k桁が1であるものの数
        ans += c * calc(2,k,p);
        ans %= p;
      }
      a /= 2;
      k++;
      if(k >= 60) break;//59桁目まで見る
    }
  }
  cout << ans/2 << endl;
 }

Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
#include<unordered_set>
#include<unordered_map>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
using vc = vector<char>;
using vvc = vector<vc>;
ll dx[4]={0,1,0,-1};
ll dy[4]={1,0,-1,0};
long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
int main(){
  ll n;
  cin>>n;
  vll a(n);
  vll b1(60);
  vll c(60);
  rep(i,n){
    cin>>a[i];
    ll h=a[i];
    bitset<60> g(a[i]);
    rep(j,60){
      if(h==0) break;
      if(g.test(j)){
        b1[j]++;
      }
      else{
        c[j]++;x
      }
      h/=2;
    }
  }
  sort(rall(a));
  ll ans=0;
  rep(i,n-1){
    ll h=a[i];
    bitset<60> g(a[i]);
    ll cu=59;
    while(1){
      if(g.test(cu)) break;
      cu--;
    }
    ll s=modpow(2,cu,INF);
    for(int j=cu;j>=0;j--){
      if(g.test(j)){
        ans+=s*(n-i-b1[j]);
        s/=2;
        b1[j]--;
        ans%=MOD;
      }
      else{
        ans+=s*(b1[j]);
        s/=2;
        ans%=MOD;
      }
    }
  }
  COUT(ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:67:16: error: 'x' was not declared in this scope
   67 |         c[j]++;x
      |                ^
Language: C++


#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int (i)=0;i<(n);i++)
#define REP(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define INF LLONG_MAX - 100
#define MOD 1000000007
#define fcout cout << fixed << setprecision(15)
#define int long long
#define yorn(f) puts((f)?"Yes":"No")
#define YORN(f) puts((f)?"YES":"NO")
#define sec second
#define fir first
typedef long long ll;
typedef pair<int, int> P;
typedef priority_queue<int> pque;
typedef vector<int> Vec;
int gcd(int a,int b){return b?gcd(b,a%b):a;};
int lcm(int a,int b){return a/gcd(a,b)*b;};
int mod(int a,int b){return (a+b-1)/b;};
template<typename A, size_t N, typename T>
void Fill(A(&array)[N],const T &val){std::fill((T*)array,(T*)(array+N),val);}
template<class T>inline bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;};
template<class T>inline bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;};



signed main() {
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);

    int n;
    cin >> n;
    Vec a(n);
    rep(i, n) cin >> a[i];

    int res = 0;
    rep(i, 60) {
        int count = 0;
        rep(j, n) {
            if(a[j] & (1LL << i)) count++;
        }
        int now = (1LL << i), now %= MOD;
        now *= count, now %= MOD;
        now *= n - count, now %= MOD;
        res += now, res %= MOD;
    }
    cout << res << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:35: error: expected initializer before '%=' token
   46 |         int now = (1LL << i), now %= MOD;
      |                                   ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;

const int N = 1e6 + 5;
const int mod = 1e9 + 7;

int n;
long long cnt[61];
long long a[N], ans;

int main(){



    cin >> n;
    for (int i = 1; i <= n; ++i) cin >> a[i];
    for (int i = 1; i <= n; ++i){
        for (int j = 0; j <= 60; ++j){
            if ((a[i] & (1ll << j)) == 0) continue;
            else ++cnt[j];
        }
    }
    for (int i = 1; i <= n; ++i){
        for (int j = 0; j <= 60; ++j){
            if ((a[i] & (1ll << j)) == 0) ans = (ans + ((1ll << j) % mod) * cnt[j]) % mod) % mod;
           // else ++cnt[j];
        }
    }
    //for (int j = 0; j < 60; ++j) cout << j << ' ' << cnt[j] << '\n';
    cout << ans;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:90: error: expected ';' before ')' token
   25 |             if ((a[i] & (1ll << j)) == 0) ans = (ans + ((1ll << j) % mod) * cnt[j]) % mod) % mod;
      |                                                                                          ^
      |                                                                                          ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef  long long unsigned ull;
constexpr long long mod = 1000000007;
ull n, a[300000],d[60][2];r[60], p[60], s;

int main(){
cin>>n;
for (ull i=0; i<n; i++){
  cin>>a[i];
  for (ull j=0; j<60; j++){
    //d[j][(a[i] & ((ull) 1 << j)) ? 1 : 0]++;
    d[j][(a[i]&((ull) 1<<j)) ?1:0]++;


  }
}
for (ull i = 0; i < 60; i++) r[i] = (d[i][0] * d[i][1]) % mod;
p[0] = 1;
for (ull i = 1; i < 60; i++) p[i] = (p[i - 1] * 2) % mod;
for (ull i = 0; i < 60; i++) s = (s + r[i] * p[i]) % mod;
cout << s << endl;
}




Compiler output:
a.cc:5:27: error: 'r' does not name a type
    5 | ull n, a[300000],d[60][2];r[60], p[60], s;
      |                           ^
a.cc: In function 'int main()':
a.cc:18:30: error: 'r' was not declared in this scope
   18 | for (ull i = 0; i < 60; i++) r[i] = (d[i][0] * d[i][1]) % mod;
      |                              ^
a.cc:19:1: error: 'p' was not declared in this scope
   19 | p[0] = 1;
      | ^
a.cc:21:30: error: 's' was not declared in this scope
   21 | for (ull i = 0; i < 60; i++) s = (s + r[i] * p[i]) % mod;
      |                              ^
a.cc:21:39: error: 'r' was not declared in this scope
   21 | for (ull i = 0; i < 60; i++) s = (s + r[i] * p[i]) % mod;
      |                                       ^
a.cc:22:9: error: 's' was not declared in this scope
   22 | cout << s << endl;
      |         ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef  long long unsigned ull;
constexpr long long mod = 1000000007;
ull n, a[300000],d[60][2];

int main(){
cin>>n;
for (ull i=0; i<n; i++){
  cin>>a[i];
  for (ull j=0; j<60; j++){
    //d[j][(a[i] & ((ull) 1 << j)) ? 1 : 0]++;
    d[j][(a[i]&((ull) 1<<j)) ?1:0]++;


  }
}
for (ull i = 0; i < 60; i++) r[i] = (d[i][0] * d[i][1]) % mod;
p[0] = 1;
for (ull i = 1; i < 60; i++) p[i] = (p[i - 1] * 2) % mod;
for (ull i = 0; i < 60; i++) s = (s + r[i] * p[i]) % mod;
cout << s << endl;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:18:30: error: 'r' was not declared in this scope
   18 | for (ull i = 0; i < 60; i++) r[i] = (d[i][0] * d[i][1]) % mod;
      |                              ^
a.cc:19:1: error: 'p' was not declared in this scope
   19 | p[0] = 1;
      | ^
a.cc:21:30: error: 's' was not declared in this scope
   21 | for (ull i = 0; i < 60; i++) s = (s + r[i] * p[i]) % mod;
      |                              ^
a.cc:21:39: error: 'r' was not declared in this scope
   21 | for (ull i = 0; i < 60; i++) s = (s + r[i] * p[i]) % mod;
      |                                       ^
a.cc:22:9: error: 's' was not declared in this scope
   22 | cout << s << endl;
      |         ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef  long long unsigned ull;
constexpr long long mod = 1000000007;
ull n, a[300000],d[60][2];

int main(){
cin>>n;
for (ull i=0; i<n; i++){
  cin>>a[i];
  for (ull j=0; j<60; j++){
    //d[j][(a[i] & ((ull) 1 << j)) ? 1 : 0]++;
    d[j][(a[i]&((ull) 1<<j)) ?1:0]++;


  }
}
for (ull i = 0; i < 60; i++) r[i] = (d[i][0] * d[i][1]) % mod;
p[0] = 1;
for (ull i = 1; i < 60; i++) p[i] = (p[i - 1] * 2) % mod;
for (ull i = 0; i < 60; i++) s = (s + r[i] * p[i]) % mod;
cout << s << endl;
}

cout<<ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:30: error: 'r' was not declared in this scope
   18 | for (ull i = 0; i < 60; i++) r[i] = (d[i][0] * d[i][1]) % mod;
      |                              ^
a.cc:19:1: error: 'p' was not declared in this scope
   19 | p[0] = 1;
      | ^
a.cc:21:30: error: 's' was not declared in this scope
   21 | for (ull i = 0; i < 60; i++) s = (s + r[i] * p[i]) % mod;
      |                              ^
a.cc:21:39: error: 'r' was not declared in this scope
   21 | for (ull i = 0; i < 60; i++) s = (s + r[i] * p[i]) % mod;
      |                                       ^
a.cc:22:9: error: 's' was not declared in this scope
   22 | cout << s << endl;
      |         ^
a.cc: At global scope:
a.cc:25:1: error: 'cout' does not name a type
   25 | cout<<ans;
      | ^~~~
a.cc:26:1: error: expected declaration before '}' token
   26 | }
      | ^
Language: C++

#include <iostream>
#include <vector>
using namespace std;
#define rep(i,n) for (int i=0;i<n;i++)
#define print(x) cout << x << endl;
typedef long long ll;

int main() {
	int n; cin >> n;
	const int INF = pow(10, 9) + 7;
	vector<ll> x(n);
	rep(i, n) cin >> x[i];
	ll ans = 0;
	rep(i, n-1) {
		rep(j, n) {
			if (j > i) {
				ans += (x[i] ^ x[j]);
				ans %= INF;
			}
		}
	}
	cout << ans << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:25: error: 'pow' was not declared in this scope
   10 |         const int INF = pow(10, 9) + 7;
      |                         ^~~
Language: C++

#include <bits/stdc++.h> 
using namespace std;

typedef long long ll;
#define pa pair<int, int> 
#define pal pair<long long, long long>
#define pad pair<double, double>
#define pb push_back
#define mp make_pair
#define VIN(v) for(int64_t i=0;i<(v).size();i++){cin >> (v).at(i);}

typedef vector<bool> bvec;
typedef vector<int> ivec;
typedef vector<long long> lvec;
typedef vector<double> dvec;
typedef vector<pa> pvec;

typedef vector< vector<bool> > bmat;
typedef vector< vector<int> > imat;
typedef vector<string> svec;
typedef vector< vector<string> > smat;
const ll infll = (1LL << 60) - 1;
const int inf = (1 << 30) - 1;

ll gcd(ll x, ll y){
    ll r = x%y;
    if(r == 0) return y;
    else return gcd(y, r);
} 

ll lcm(ll x, ll y){
    return x*y/gcd(x,y);
}

ll getnum(ivec &x){
    int y=0;
    for (size_t i = 0; i < 60; i++)
    {
        y+=(1ll << i)*x[i];
    }
    return y;

}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, dm=60;
    cin >> n;
    lvec a(n);
    lmat s(dm);
    //ivec ss(60, 0);
    ivec ss;
    for (int i = 0; i < n; i++) cin >> a[i];
    for (int i = 0; i < dm; i++){
        s[i].push_back((a[0] >> i) % 2);
        for (int j=1; j<n; j++){
            int d = (a[j] >> i) % 2;
            s[i].push_back(s[i][j-1] + d);
        }
    }
    for (auto &x : s){
        ss.push_back((n - x[n-1])*x[n-1]);
    }

    /*
    for (int i = 0; i < n-1; i++){
        for (int j=0; j<dm; j++){
            if((a[i] >> j)%2) ss[j] += (n-1-i) - (s[j][n-1] - s[j][i]);
            else ss[j] += (s[j][n-1] - s[j][i]);
        }
    }
    */

    ll d = 1e9 + 7;
    ll ans=0;
    for (int i = 0; i < dm; i++)
    {   
        ans += ((1ll << i)%d * ss[i]%d)%d;
    }
    
    cout << ans%d <<endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:51:5: error: 'lmat' was not declared in this scope; did you mean 'smat'?
   51 |     lmat s(dm);
      |     ^~~~
      |     smat
a.cc:56:9: error: 's' was not declared in this scope
   56 |         s[i].push_back((a[0] >> i) % 2);
      |         ^
a.cc:62:20: error: 's' was not declared in this scope
   62 |     for (auto &x : s){
      |                    ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
  int n;
  cin >> n;
  int arr[n];
  for(int i = 0; i < n; i++){
    int t;
    cin >> t;
    arr[i] = t;
  }
  for(int i = 1; i < n; i++){
    long t1 = arr[i]^arr[i-1];
    sum = sum + t1;
  }
  cout << sum % 1000000007;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:5: error: 'sum' was not declared in this scope
   15 |     sum = sum + t1;
      |     ^~~
a.cc:17:11: error: 'sum' was not declared in this scope
   17 |   cout << sum % 1000000007;
      |           ^~~
Language: C++

 #include <bits/stdc++.h>
 #define ll long long
 #define int long long
 #define MOD  1000000007
 #define MAX 500005
 #include<iomanip>
 #define Need_for_speed(activated) ios_base :: sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
 #define satisfy ll t; cin>> t; while(t--)
 #define inp(n) int n;cin >> n
 #define mp make_pair
 #define pb push_back
 #define fore(i,a,b) for(ll i=a;i<b;i++)
 #define x first
 #define y second
using namespace std;
int gcd(int a, int b);
  
int power(int x, unsigned int y, unsigned int m)
{
    if (y == 0)
        return 1;
    int p = power(x, y/2, m) % m;
    p = (p * p) % m;
  
    return (y%2 == 0)? p : (x * p) % m;
}
ll modInverse(int a, int m)
{
    int g = gcd(a, m);
   
    {
        // If a and m are relatively prime, then modulo inverse
        // is a^(m-2) mode m
      
             return power(a, m-2, m);
    }
}
int gcd(int a, int b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}
//void spf(ll num)
//{
//    fore(i,0,num+1)arr[i]=i;
//    for(ll i=2;i<=num;i+=2)
//    {
//        arr[i]=2;
//    }
//    for(ll i=3;i<=num;i+=2)
//    {
//        if(arr[i]==i)
//        for(ll j=i;j<=num;j+=i)
//        {
//           if(arr[j]==j) arr[j]=i;
//        }
//    }
//}
 
 int32_t main()
{
    Need_for_speed(activated);
//    satisfy
//    {}
    ll arr[300006][100]={0};
    ll n;cin>>n;
     fore(i,0,n)
    {
        ll x;cin>>x;
        ll b=0;
        while(x)
        {
            arr[i][b]=x%2;
            x/=2;
            b++;
        }
    }
    ll ans[300005]={0};
    ll carry=0;
    fore(i,0,100)
    {
        ll one=0,zero=0;
        for(ll j=0;j<n;j++)
        {
            if(arr[j][i]==0)zero++;
            else one++;
        }
        ll prod=zero*one;
        ans[i]=prod;
    }
    ll dd=0;ll k=1;
    for(ll i=0;i<100;i++)
    {
        dd+=(k*ans[i])%MOD;
        k=(k*2)%MOD;
        dd%=MOD;
    }
    d%=MOD;
    cout<<dd<<endl;
    return 0;
    }


Compiler output:
a.cc: In function 'int32_t main()':
a.cc:100:5: error: 'd' was not declared in this scope
  100 |     d%=MOD;
      |     ^
Language: C++

#include<bits/stdc++.h>

using namespace std;

#define int long long
#define ll long long
#define rep(i,a,b) for(ll i=a; i<b; i++)
void add(int& a, int b) {a+=b;if(a>=mod){a-=mod;}}

ll power(ll x,ll n){ll result=1;while(n>0){if(n%2==1)result=(result*x)%mod; x=((x%mod)*(x%mod))%mod;n=n/2;}return result;}

const int Z=3e5+5;
int n;
int a[Z];
int ans;

int32_t main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    cin >> n;
    rep(i,1,n+1) cin >> a[i];
    for(int i=0; i<62; i++){
        int p=0,q=0;
        for(ll j=1; j<=n; j++){
            if(a[j]&(1LL<<i)) p++;
            else q++;
        }
        int z=(p*q)%mod;
        z*=power(2,i);
        z%=mod;
        add(ans,z);
    }
    cout << ans;
    return 0;
}

Compiler output:
a.cc: In function 'void add(long long int&, long long int)':
a.cc:8:37: error: 'mod' was not declared in this scope; did you mean 'modf'?
    8 | void add(int& a, int b) {a+=b;if(a>=mod){a-=mod;}}
      |                                     ^~~
      |                                     modf
a.cc: In function 'long long int power(long long int, long long int)':
a.cc:10:72: error: 'mod' was not declared in this scope; did you mean 'modf'?
   10 | ll power(ll x,ll n){ll result=1;while(n>0){if(n%2==1)result=(result*x)%mod; x=((x%mod)*(x%mod))%mod;n=n/2;}return result;}
      |                                                                        ^~~
      |                                                                        modf
a.cc:10:83: error: 'mod' was not declared in this scope; did you mean 'modf'?
   10 | ll power(ll x,ll n){ll result=1;while(n>0){if(n%2==1)result=(result*x)%mod; x=((x%mod)*(x%mod))%mod;n=n/2;}return result;}
      |                                                                                   ^~~
      |                                                                                   modf
a.cc: In function 'int32_t main()':
a.cc:30:21: error: 'mod' was not declared in this scope; did you mean 'modf'?
   30 |         int z=(p*q)%mod;
      |                     ^~~
      |                     modf
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll

#define FOR(i,m,n) for(int i=(m);i<(n);++i)
typedef vector<int> vi;
inline int in() { int x; cin >> x; return x; }
int MOD = 1000000007;
struct mint {
  int x;
  mint (int x = 0) : x(x % MOD){}
  mint& operator+=(const mint a) { (x+=a.x) %= MOD; return *this; }
  mint& operator*=(const mint a) { (x*=a.x) %= MOD; return *this; }
};

void solve() {
  int n = in();
  mint m = 0;
  vi v(n); for (auto &i : v) i = in();
  FOR(i,0,60) {
    int odd = 0, even = 0;
    for (auto j : v) (((j>>i)&1) ? odd : even)++;
    mint k = (int)1 << i;
    k *= odd * even;
    m += k;
  }
  cout << (int)m << endl;
}

#undef int
int main() {
  solve();
  return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:28:11: error: invalid cast from type 'mint' to type 'll' {aka 'long long int'}
   28 |   cout << (int)m << endl;
      |           ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll

#define FOR(i,m,n) for(int i=(m);i<(n);++i)
typedef vector<int> vi;
inline int in() { int x; cin >> x; return x; }
int MOD = 1000000007;
struct mint {
  int x;
  mint (int x = 0) : x(x % MOD){}
  mint& operator+=(const mint a) { (x+=a.x) %= MOD; return *this; }
  mint& operator*=(const mint a) { (x*=a.x) %= MOD; return *this; }
};

void solve() {
  int n = in()
  mint m = 0;
  vi v(n); for (auto &i : v) i = in();
  FOR(i,0,60) {
    int odd = 0, even = 0;
    for (auto j : v) (((j>>i)&1) ? odd : even)++;
    mint k = (int)1 << i;
    k *= odd * even;
    m += k;
  }
  cout << m << endl;
}

#undef int
int main() {
  solve();
  return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:19:3: error: expected ',' or ';' before 'mint'
   19 |   mint m = 0;
      |   ^~~~
a.cc:26:5: error: 'm' was not declared in this scope
   26 |     m += k;
      |     ^
a.cc:28:11: error: 'm' was not declared in this scope
   28 |   cout << m << endl;
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll

#define FOR(i,m,n) for(int i=(m);i<(n);++i)
typedef vector<int> vi;
inline int in() { int x; cin >> x; return x; }
int MOD = 1000000007;
struct mint {
  int x;
  mint (int x = 0) : x(x % MOD){}
  mint& operator+=(const mint a) { (x+=a.x) %= MOD; return *this; }
  mint& operator*=(const mint a) { (x*=a.x) %= MOD; return *this; }
}

void solve() {
  int n = in()
  mint m = 0;
  vi v(n); for (auto &i : v) i = in();
  FOR(i,0,60) {
    int odd = 0, even = 0;
    for (auto j : v) (((j>>i)&1) ? odd : even)++;
    mint k = (int)1 << i;
    k *= odd * even;
    m += k;
  }
  cout << m << endl;
}

#undef int
int main() {
  solve();
  return 0;
}


Compiler output:
a.cc:15:2: error: expected ';' after struct definition
   15 | }
      |  ^
      |  ;
a.cc: In function 'void solve()':
a.cc:19:3: error: expected ',' or ';' before 'mint'
   19 |   mint m = 0;
      |   ^~~~
a.cc:26:5: error: 'm' was not declared in this scope
   26 |     m += k;
      |     ^
a.cc:28:11: error: 'm' was not declared in this scope
   28 |   cout << m << endl;
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll

#define FOR(i,m,n) for(ll i=(m);i<(n);++i)
typedef vector<int> vi;
inline int in() { int x; cin >> x; return x; }
const int MOD = 1000000007;

void solve() {
	int n = in();
	vi v(n); for (auto &i : v) i = in();
	FOR(i,0,60) {
		int odd = 0, even = 0;
		for (auto j : v) (((j >> i) & 1) ? odd : even)++;
		k = (int)1 << i;
		k %= MOD;
		k *= (odd * even) % MOD;
		m += k;
		m %= MOD;
	}
	cout << m << endl;
}

#undef int
int main() {
  solve();
  return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:17:17: error: 'k' was not declared in this scope
   17 |                 k = (int)1 << i;
      |                 ^
a.cc:20:17: error: 'm' was not declared in this scope
   20 |                 m += k;
      |                 ^
a.cc:23:17: error: 'm' was not declared in this scope
   23 |         cout << m << endl;
      |                 ^
Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define SORT(c) sort((c).begin(),(c).end())
#define REVETSE(c) reverse((c).begin(),(c).end())
#define SUM(c) accumulate((c).begin(),(c).end(),0)
#define ALL(a)  (a).begin(),(a).end()
// int gcd(int a,int b){return b?gcd(b,a%b):a;}
long long gcd(long long a,long long b){return b?gcd(b,a%b):a;}

using namespace std;

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
template<class T> T maxt(T x,T y) {
    if (x>y) return x;
    else return y;
}
template<class T> T mint(T x,T y) {
    if (x>y) return y;
    else return x;
}
//sort(v.rbegin(), v.rend(), [](auto& x, auto& y){return x[1] < y[1];});
//cout << fixed << setprecision(10) << ans << defaultfloat << endl;
typedef long long ll;
typedef vector<int> Vi;
typedef vector<ll> Vl;
typedef vector<double> Vd;
typedef vector<string> Vs;

long long m = 1e9+7, mod = 1e9+7;
//逆元　a/b の modをとるとき -> a*modinv(b)%mod
long long modinv(long long a, long long m = 1e9+7) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m; 
    if (u < 0) u += m;
    return u;
}

//約数列挙
vector< int64_t > divisor(int64_t n) {
  vector< int64_t > ret;
  for(int64_t i = 1; i * i <= n; i++) {
    if(n % i == 0) {
      ret.push_back(i);
      if(i * i != n) ret.push_back(n / i);
    }
  }
  sort(begin(ret), end(ret));
  return (ret);
}


int main() {
  int N;
  ll ans=0;
  cin >> N;
  Vl vl(N,0),av(61,0),v(61,0);
  REP(i,N) {
    cin >> vl[i];
  }
  v.reverse();
  REP(i,N) {
    REP(j,61){
      if (i>=1) {
      if ((vl[i] >> j) & 1){
        av[j] += i - v[j];}
      else {
        av[j] += v[j];}
    }
      if ((vl[i] >> j) & 1){
        v[j]++;
      }
    }
  }
  ll p = 1;
  REP(i,61){
    if (i>=1) {p = p*2%mod;}
    ans = (ans + (v[i]*(N-v[i]))%mod*p%mod)%mod;
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:67:5: error: 'Vl' {aka 'class std::vector<long long int>'} has no member named 'reverse'; did you mean 'reserve'?
   67 |   v.reverse();
      |     ^~~~~~~
      |     reserve
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main(){
  const ll mod = 1e9+7;
  ll n;
  cin >> n;
  vector<ll> a(n);
  for(ll i=0; i<n; i++) cin >> a[i];
  
  vector<ll> b(60, 0);
  for(ll i=0; i<n; i++){
  	for(ll j=0; j<60; j++){
      if(a[i] & ((ll)1<<j)) b[j]++;
    }
  }
  
  ll ans = 0;
  ll coeff = 1;
  for(ll i=0; i<60; i++){
  	ans += (b[i]*(n-b[i])*coeff)%mod;
    coeff *= 2;
    coeff %= mod
    ans = ans%mod;
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:17: error: expected ';' before 'ans'
   24 |     coeff %= mod
      |                 ^
      |                 ;
   25 |     ans = ans%mod;
      |     ~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

// def
#define debug(x) cout << #x << ": " << x << endl
#define out(x) cout << x << endl
#define repeat(i, a, b) for (int i = (a); i < (b); i++)
#define revrepeat(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define revrep(i, n) for (int i = (n)-1; i >= 0; i--)
#define all(x) (x).begin(), (x).end()
typedef long long ll;
typedef long double ld;
typedef pair<int, int> P;
typedef complex<ld> Point;
typedef vector<vector<int>> Graph;
const int MOD = 1e9 + 7;
const int INF = 1e9;
const int MAX_V = 1e5 + 5;
const int MAX_N = 1e5 + 5;
const double PI = acos(-1);

struct mint {
    // Preparation: MOD is already defined.
    ll value;

    mint(ll value = 0) : value((value % MOD + MOD) % MOD) {}

    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t >> 1);
        a *= a;
        if (t & 1) a *= *this;
        return a;
    }

    mint pow(mint m) const {
        return pow(m.value);
    }

    mint inv() const {
        ll a = value, b = MOD, u = 1, v = 0;
        while (b) {
            ll t = a / b;
            a -= t * b;
            swap(a, b);
            u -= t * v;
            swap(u, v);
        }
        u %= MOD;
        return u;
    }

    mint &operator+=(const mint a) {
        if ((value += a.value) >= MOD) value -= MOD;
        return *this;
    }
    mint &operator-=(const mint a) {
        if ((value += MOD - a.value) >= MOD) value -= MOD;
        return *this;
    }
    mint &operator*=(const mint a) {
        (value *= a.value) %= MOD;
        return *this;
    }
    mint &operator/=(const mint a) {
        return (*this) *= a.inv();
    }

    mint operator+(const mint a) const {
        mint res(*this);
        return res += a;
    }
    mint operator-(const mint a) const {
        mint res(*this);
        return res -= a;
    }
    mint operator*(const mint a) const {
        mint res(*this);
        return res *= a;
    }
    mint operator/(const mint a) const {
        mint res(*this);
        return res /= a;
    }
};

long modpow(long m, long p) {
    if (p == 0) return 1;
    if (p % 2)
        return m * modpow(m, p - 1) % MOD;
    else {
        long res = modpow(m, p / 2);
        return res * res % MOD;
    }
}

int main() {
    int n;
    cin >> n;
    vector<ll> a(n);
    mint ans = 0;
    rep(i, n) cin >> a[i];
    rep(i, 60) {
        ll cnt_zero = 0;
        ll cnt_one = 0;
        rep(j, n) {
            if ((a[j] >> i) & 1)
                cnt_one++;
            else
                cnt_zero++;
        }
        ll temp = (cnt_one * cnt_zero) % MOD;
        temp = temp * (modpow(2, i) % MOD);
        ans += temp;
        ans %= MOD;
        // ans += (cnt_one * cnt_zero) * modpow(2, i);
    }
    out(ans.value);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:116:13: error: no match for 'operator%=' (operand types are 'mint' and 'const int')
  116 |         ans %= MOD;
      |         ~~~~^~~~~~
Language: C++

n = int(input())
a = list(map(int, input().split()))
ans = 0
mod = 1e9 + 7
digit = 1
for i in range(60):
  one = 0
  for aa in a:
    if (aa >> i) & 1:
      one += 1
  ans += (one * (n - one) * digit) % mod
  ans %= mod
  digit *= 2

print(int(ans))


Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n = int(input())
      | ^
Language: Java

import java.util.*;
import java.util.function.*;
public class Main {
  public static void main(String[] args) {
    long mod = 10*9 + 7;
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    long[] A = new long[N];
    for (int i = 0; i < N; i++) {
      A[i] = sc.nextLong();
    }
    long ans = 0;
    for (int i = 0; i < 60; i++) {
        long c = 0;
        for (int j = 0; j < N; j++){
            if (((A[j] >>> i) & 1) == 1){
                c++; // 1の物をカウント
            }
        }
        long a = (c * (N - c)) % m; //0の数*1の数=合計カウント数
        for (int j = 0; j < i; j++){
            a = (a << 1) % m; //桁を繰り上げて元に戻す
        }
        ans += a;
        ans %= m;
    }
    System.out.println(ans);
  }
}

Compiler output:
Main.java:20: error: cannot find symbol
        long a = (c * (N - c)) % m; //0??*1??=???????
                                 ^
  symbol:   variable m
  location: class Main
Main.java:22: error: cannot find symbol
            a = (a << 1) % m; //???????????
                           ^
  symbol:   variable m
  location: class Main
Main.java:25: error: cannot find symbol
        ans %= m;
               ^
  symbol:   variable m
  location: class Main
3 errors
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define IOS ios_base::sync_with_stdio(false) ; cin.tie(NULL) ; cout.tie(NULL);
#define int long long
#define pi pair<int,int>
#define ff first
#define ss second
#define pb push_back

int32_t main(){
IOS;
int n;
cin>>n;
int a[n];
for(int i=0;i<n;i++)
cin>>a[i];
int ans = 0;
for(int i=60;i>=0;i--)
{
    int o=0,z=0;
    for(int j=0;j<n;j++)
    {
        if((a[j] >> i) & 1)
        o++;
        else
        {
            z++;
        }
    }
    ans += ((o*z)1000000007)*((pow(2 , i))%1000000007);
    ans %= (1000000007);
}
cout<<ans<<endl;
return 0;
}

Compiler output:
a.cc: In function 'int32_t main()':
a.cc:30:18: error: expected ')' before numeric constant
   30 |     ans += ((o*z)1000000007)*((pow(2 , i))%1000000007);
      |            ~     ^~~~~~~~~~
      |                  )
Language: C++

#include<iostream>
#include<algorithm>
#include<cmath>
typedef long long ll;
using namespace std;

ll power(ll num){
    power2 = 1;
    for(int i=0; i<num; i++) power2 *= 2;
    return power2;
}

int main(){
    int N; cin >> N;
    ll A[N], ans = 0;
    int one[60] = {}, count = 0, amari;
    for(int i=0; i<N; i++) cin >> A[i];

    // A[i] = 2進数で2^i桁目が1になる数字の数
    for(int i=0; i<60; i++){
        for(int j=0; j<N; j++){
            one[i] += A[j]%2;
            A[j] = A[j]/2;
        }
    }
    for(int i=0; i<60; i++){
        if(one[i] == 0) continue;
        ans += one[i]*(N-one[i])*power(2, i);
        ans = ans%1000000007;
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'll power(ll)':
a.cc:8:5: error: 'power2' was not declared in this scope; did you mean 'power'?
    8 |     power2 = 1;
      |     ^~~~~~
      |     power
a.cc: In function 'int main()':
a.cc:28:39: error: too many arguments to function 'll power(ll)'
   28 |         ans += one[i]*(N-one[i])*power(2, i);
      |                                  ~~~~~^~~~~~
a.cc:7:4: note: declared here
    7 | ll power(ll num){
      |    ^~~~~
Language: C++

#include <iostream>
#include <vector>
using namespace std;
using ll = long long;
#define REP(i, n) for(ll i = 0; i < n; i++)
#define MOD (1e9 + 7)
int main(){
  ll n;
  cin >> n;
  vector<ll> a(n);
  REP(i, n){
    cin >> a[i];
  }
  vector<vector<ll>> c(63, vector<ll>(2));
  ll ans = 0;
  REP(i, n){
    REP(j, 63){
      ll f = (a[i] >> j) & 1LL;
      ans += c[j][f ^ 1] * (1LL << j);
      c[j][f]++;
      ans %= MOD;
     }
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:11: error: invalid operands of types 'll' {aka 'long long int'} and 'double' to binary 'operator%'
   21 |       ans %= MOD;
      |           ^
a.cc:21:11: note:   in evaluation of 'operator%=(using ll = long long int {aka long long int}, double)'
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
    long long N, A[400000], cnt, ans = 0, mod = 1000000007;
    cin >> N;
    for (long long i = 0; i < N; ++i) {
        cin >> A[i];
    }

    for (long long i = 0; i < 60; ++i) {
        cnt = 0;
        for (int j = 0; j < N; ++j) {
            if (A[j] & 1) {
                ++cnt;
            }
            A[j] = A[j] >> 1;
        }
        ans += ((cnt * (N - cnt)) % mod * (pow(2, i) % mod)) % mod;
    }

    cout << ans % mod << endl;
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:54: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'long long int' to binary 'operator%'
   19 |         ans += ((cnt * (N - cnt)) % mod * (pow(2, i) % mod)) % mod;
      |                                            ~~~~~~~~~ ^ ~~~
      |                                               |        |
      |                                               |        long long int
      |                                               __gnu_cxx::__promote<double>::__type {aka double}
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
const ll mod = 1000000007;
ll myXOR(ll x, ll y) 
{ 
   return (x | y) & (~x | ~y); 
} 
int main()
{
	ll z,n,sum=0;
	cin>>n;
	vector<ll> v(n);
	for(ll i=0;i<n;i++)
	  {cin>>v[i];}
	for(ll i= 0 ; i<n;i++)
	{
		for(ll j=i+1;j<n+1;j++)
			z = myXOR (v[i] , v[j])
		sum=(((sum%mod)+(z%mod))%mod);
	}
	cout<<sum<<endl;
	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:48: error: expected ';' before 'sum'
   19 |                         z = myXOR (v[i] , v[j])
      |                                                ^
      |                                                ;
   20 |                 sum=(((sum%mod)+(z%mod))%mod);
      |                 ~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
const ll mod = 1000000007;
ll myXOR(ll x, ll y) 
{ 
   return (x | y) & (~x | ~y); 
} 
int main()
{
	ll n,sum=0;
	cin>>n;
	vector<ll> v(n);
	for(ll i=0;i<n;i++)
	  {cin>>v[i];}
	for(ll i= 0 ; i<n;i++)
	{
		for(ll j=i+1;j<n+1;j++)
			z = myXOR (v[i] , v[j])
		sum=(((sum%mod)+(z%mod))%mod);
	}
	cout<<sum<<endl;
	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:25: error: 'z' was not declared in this scope
   19 |                         z = myXOR (v[i] , v[j])
      |                         ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define loop(i,n) for(i=0;i<n;i++)
typedef long long ll;
ll const m =1000000007;
 


int main()
{
 ll n,i,j=0,k,count=0,temp=0,temp0=0,temp1=0;
  cin>>n;
  ll arr[n];
  
for(i=0;i<n;i++) cin>>arr[i];

sort(arr,arr+n);

while(arr[n-1]>0)
{
  temp0=0,temp1=0;
for(i=0;i<n;i++)
{
  if(arr[i]%2==0)temp0++;
  else temp1++;

  arr[i]/=2;
}
    temp=(ll)(pow(2,j)%m)*temp0*temp1;
    count=(count+temp)%m;
    j++;
}

cout<<count<<"\n";


return 0;
}
     


    

    


Compiler output:
a.cc: In function 'int main()':
a.cc:31:23: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'const ll' {aka 'const long long int'} to binary 'operator%'
   31 |     temp=(ll)(pow(2,j)%m)*temp0*temp1;
      |               ~~~~~~~~^~
      |                  |     |
      |                  |     const ll {aka const long long int}
      |                  __gnu_cxx::__promote<double>::__type {aka double}
Language: Java

import java.util.*;
import java.util.function.*;
public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    long[] A = new long[N];
    for (int i = 0; i < N; i++) {
      A[i] = sc.nextLong();
    }
    sc.close();
    
    long ans = 0;
    for (int i = 0; i < 60; i++) {
      int c = 0;
      for (int j = 0; j < N; j++) {
        if ((A[j] >>> i) % 2 == 0) c++;
      }
      long a = (c * (N - c) * Math.pow(2, i)) % 1000000007;
      ans += a;
      /*
      long a = ((c * (N - c)) << i);
      ans += a;
      //((c * (N - c)) << i);
      ans += (c * (N - c)) * (long) Math.pow(2, i);
      */
    }
//    ans %= 1000000007;
    System.out.println(ans);
  }
}


Compiler output:
Main.java:19: error: incompatible types: possible lossy conversion from double to long
      long a = (c * (N - c) * Math.pow(2, i)) % 1000000007;
                                              ^
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(i=0;i<n;i++)
typedef long long ll;
const ll mod = 1000000007;
int main(){
    ll n,i,j,x,ans=0LL,divider=1;
    cin >> n;
    vector<ll> a(n);
    rep(i,n)cin >> a.at(i);
    rep(i,60){
        x=0LL;
        rep(j,n){
            if(((a.at(j)%(2*divider)/divider)==1)x++;
        }
        divider*=2LL;
        x*=(n-x);
        rep(j,i)x=(x*2)%mod;
        ans+=x;
        ans%=mod;
    }
    cout << (ans%mod) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:50: error: expected ';' before 'x'
   14 |             if(((a.at(j)%(2*divider)/divider)==1)x++;
      |                                                  ^
      |                                                  ;
a.cc:15:9: error: expected primary-expression before '}' token
   15 |         }
      |         ^
a.cc:14:54: error: expected ')' before '}' token
   14 |             if(((a.at(j)%(2*divider)/divider)==1)x++;
      |               ~                                      ^
      |                                                      )
   15 |         }
      |         ~                                             
a.cc:15:9: error: expected primary-expression before '}' token
   15 |         }
      |         ^
Language: C++

n=int(input())
su=0
a=[]
for i in range(n):
    c=int(input())
    a.append(c)
for i in range (n-1):
    for j in range(i+1,n):
        su+=a[i]^a[j]
print(su%(1000000000+7))

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n=int(input())
      | ^
Language: C++

#include "Header.h"
//#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < n; i++)
const ll mod = 1000000007;

int main() {
	int n;
	cin >> n;
	vector<ll> v(n);
	rep(i, n) {
		cin >> v.at(i);
	}
	ll ans = 0;
	for (int j = 0; j < 60; j++) {
		ll n0 = 0;
		ll n1 = 0;
		rep(i, n) {
			if (v.at(i) & (1LL << j)) n1++;
			else n0++;
		}
		ans += ((n1 * n0)%mod) *((1LL << j)%mod);
	}
	ans %= mod;
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc:1:10: fatal error: Header.h: No such file or directory
    1 | #include "Header.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <utility>
#include <vector>
#include <tuple>

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define co(x) cout << (x) << "\n"
#define pb push_back
#define Never
#define To

#define BIG_NUM (100'000'007)

using namespace std;

long long B[100];

int main(){

	cin.tie(0);
	ios::sync_with_stdio(false);

	long long N;
	vector<long long> A;

	cin >> N;

	for(int i = 0; i < N; i++){
		long long x;
		cin >> x;
		A.pb(x);
	}

	for(int i = 0; i < A.size(); i++){
		int x = A[i];
		int j = 0;
		while(x > 0){
			B[j++] += x & 1;
			x >>= 1;
		}
	}

	long long ans = 0;
	for(int i = 0; i < 100; i++){
		ans += ((long long)((N - B[i])*B[i] * (pow(2, i) % BIG_NUM))) % BIG_NUM;
		ans %= BIG_NUM;
	}
	cout << ans << endl;

	Never To return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:61:66: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%'
   61 |                 ans += ((long long)((N - B[i])*B[i] * (pow(2, i) % BIG_NUM))) % BIG_NUM;
      |                                                        ~~~~~~~~~ ^
      |                                                           |
      |                                                           __gnu_cxx::__promote<double>::__type {aka double}
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int mod=1e9+7;
int main()
{
    int n;
    cin>>n;
    long long double a[n],ans=0;
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
    }
    int k=0;
    for(int i=0;i<60;i++)
    {
        k=0;
        for(int j=0;j<n;j++)
        {
            if(a[j]&(1LL<<i))
                k++;
        }
        ans=(ans+((1<<i)*((k*(n-k))%MOD))%MOD)%MOD;

    }
    cout<<ans;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:10: error: 'long long' specified with 'double'
    8 |     long long double a[n],ans=0;
      |          ^~~~
a.cc:8:10: error: 'long long' specified with 'double'
a.cc:19:20: error: invalid operands of types 'double' and 'long long int' to binary 'operator&'
   19 |             if(a[j]&(1LL<<i))
      |                ~~~~^~~~~~~~~
      |                   |     |
      |                   |     long long int
      |                   double
a.cc:22:37: error: 'MOD' was not declared in this scope
   22 |         ans=(ans+((1<<i)*((k*(n-k))%MOD))%MOD)%MOD;
      |                                     ^~~
Language: C++

#include<iostream>
using namespace std;

int main()
{
  int x;
  cin >> x;
  int arr[x], sum=0;
  for(int i=0; i<n; i++)
  {
    cin >> arr[i];
    sum += arr[i];
  }
  int f_sum=0;
  for(int i=0; i<n; i++)
  {
    f_sum += (sum-arr[i]);
  }
  cout << f_sum;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:18: error: 'n' was not declared in this scope
    9 |   for(int i=0; i<n; i++)
      |                  ^
a.cc:15:18: error: 'n' was not declared in this scope
   15 |   for(int i=0; i<n; i++)
      |                  ^
Language: C++

#include "bits/stdc++.h"

#define pb push_back
#define pob pop_back
#define pf push_front
#define pof pop_front
#define eb emplace_back
#define rep(i, a, b) for (long i = (a); i <= (b); ++i)
#define per(i, a, b) for (long i = (a); i >= (b); --i)
#define mmst(v) memset(v, 0, sizeof(v))

template<typename T1,typename T2> inline void chmin(T1 & a, T2 b) { if (a > b) a = b; }
template<typename T1,typename T2> inline void chmax(T1 & a, T2 b) { if (a < b) a = b; }

const long kMax2 = 109;
const long kMax3 = 1009;
const long kMax4 = 10009;
const long kMax5 = 100009;
const long kMax6 = 1000009;
const long kMax9 = 1000000010;
const long kInfI = 0x3F3F3F3F;
const float kInfF = 1e15;
const long long kMod = 1000000007;

const long long kMAX = 1000000000;

using namespace std;
using ll = long long;

inline int readInt() {
  char c = getchar();
  while(!isdigit(c) && c != '-') c = getchar();
  int sigma = 1;
  if (c == '-') {
    sigma = -1;
    c = getchar();
  }
  int x = 0;
  while (isdigit(c)) {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return x * sigma;
}

template <class T>
void PrintVector(const vector<T> & v) {
  for (const auto & e: v) {
    cout << e << endl;
  }
}

template <class T>
void PrintVector(const vector<T> & v, int n) {
  rep(i, 0, n - 1) {
    cout << v[i] << endl;
  }
}

double dist(double lhs, double rhs) {
  return sqrt(lhs * lhs + rhs * rhs);
}

// int binary(int bina){
//   int ans = 0;
//   for (int i = 0; bina>0 ; i++)
//   {
//     ans = ans+(bina%2)*pow(10,i);
//     bina = bina/2;
//   }
//   return ans;
// }

const long km = 62;

long n, m, k, t;
string binary(ll dec){
  string s;
  while (dec > 0) {
    s.pb((dec % 2) + '0');
    dec /= 2;
  }
  auto j = km - long(s.size());
  rep(i, 0, j - 1) { s.pb('0'); }
  // reverse(s.begin(), s.end());
  return s;
}

ll exp2k(long x) {
  ll ans = 1;
  rep(i, 1, x) {
    ans = (ans * x) % kMod;
  }
  return ans;
}

int main() {
  ll ans = 0;
  vector<string> ss;
  vector<ll> aa;
  vector<ll> cnt;
  cin >> n;
  rep(i, 0, n - 1) {
    ll a0;
    cin >> a0;
    aa.pb(a0);
    auto s0 = binary(a0);
    ss.pb(s0);
    // cout << s0 << endl;
  }

  per(i, km - 1, 0) {
    ll x = 0;
    ll y = 0;
    rep(j, 0, n - 1) {
      if (ss[j][i] == '0') { ++x; }
      else { ++y; }
    }
    ans = (ans + x * y % kmod * ll(exp2(i))) % kMod;
  }

  cout << ans << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:119:26: error: 'kmod' was not declared in this scope; did you mean 'kMod'?
  119 |     ans = (ans + x * y % kmod * ll(exp2(i))) % kMod;
      |                          ^~~~
      |                          kMod