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

#include <stdio.h>

#include <iostream>
#include <vector>
#include <array>

constexpr uint64_t MOD = 1'000'000'007;

int main() {
	int n;

	scanf_s("%d", &n);

	std::cout << n;

	std::array<int64_t, 62> bits{};
	for (int64_t i = 0; i < n; i++) {
		int64_t d;
		scanf_s("%lld", &d);
		for (int64_t b = 0; b < 62; b++) {
			bits[b] += !!(d & (1i64 << b));
		}
	}

	uint64_t ans = 0;

	for (int64_t b = 0; b < 62; b++) {
		ans += (bits[b]*(n-bits[b])) * ((1i64 << b) % MOD);
		ans %= MOD;
	}

	std::cout << ans;
  return 0;
}


Compiler output:
a.cc:7:11: error: 'uint64_t' does not name a type
    7 | constexpr uint64_t MOD = 1'000'000'007;
      |           ^~~~~~~~
a.cc:6:1: note: 'uint64_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
    5 | #include <array>
  +++ |+#include <cstdint>
    6 | 
a.cc: In function 'int main()':
a.cc:12:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   12 |         scanf_s("%d", &n);
      |         ^~~~~~~
      |         scanf
a.cc:21:44: error: unable to find numeric literal operator 'operator""i64'
   21 |                         bits[b] += !!(d & (1i64 << b));
      |                                            ^~~~
a.cc:25:9: error: 'uint64_t' was not declared in this scope
   25 |         uint64_t ans = 0;
      |         ^~~~~~~~
a.cc:25:9: note: 'uint64_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
a.cc:28:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   28 |                 ans += (bits[b]*(n-bits[b])) * ((1i64 << b) % MOD);
      |                 ^~~
      |                 abs
a.cc:28:50: error: unable to find numeric literal operator 'operator""i64'
   28 |                 ans += (bits[b]*(n-bits[b])) * ((1i64 << b) % MOD);
      |                                                  ^~~~
a.cc:28:63: error: 'MOD' was not declared in this scope
   28 |                 ans += (bits[b]*(n-bits[b])) * ((1i64 << b) % MOD);
      |                                                               ^~~
a.cc:32:22: error: 'ans' was not declared in this scope; did you mean 'abs'?
   32 |         std::cout << ans;
      |                      ^~~
      |                      abs
Language: C++

#include <stdio.h>

#include <iostream>
#include <vector>
#include <array>

constexpr uint64_t MOD = 1'000'000'007;

void XOR::run() {
	int n;

	scanf_s("%d", &n);

	std::cout << n;

	std::array<int64_t, 62> bits{};
	for (int64_t i = 0; i < n; i++) {
		int64_t d;
		scanf_s("%lld", &d);
		for (int64_t b = 0; b < 62; b++) {
			bits[b] += !!(d & (1i64 << b));
		}
	}

	uint64_t ans = 0;

	for (int64_t b = 0; b < 62; b++) {
		ans += (bits[b]*(n-bits[b])) * ((1i64 << b) % MOD);
		ans %= MOD;
	}

	std::cout << ans;
}


Compiler output:
a.cc:7:11: error: 'uint64_t' does not name a type
    7 | constexpr uint64_t MOD = 1'000'000'007;
      |           ^~~~~~~~
a.cc:6:1: note: 'uint64_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
    5 | #include <array>
  +++ |+#include <cstdint>
    6 | 
a.cc:9:6: error: 'XOR' has not been declared
    9 | void XOR::run() {
      |      ^~~
a.cc: In function 'void run()':
a.cc:12:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   12 |         scanf_s("%d", &n);
      |         ^~~~~~~
      |         scanf
a.cc:21:44: error: unable to find numeric literal operator 'operator""i64'
   21 |                         bits[b] += !!(d & (1i64 << b));
      |                                            ^~~~
a.cc:25:9: error: 'uint64_t' was not declared in this scope
   25 |         uint64_t ans = 0;
      |         ^~~~~~~~
a.cc:25:9: note: 'uint64_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
a.cc:28:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   28 |                 ans += (bits[b]*(n-bits[b])) * ((1i64 << b) % MOD);
      |                 ^~~
      |                 abs
a.cc:28:50: error: unable to find numeric literal operator 'operator""i64'
   28 |                 ans += (bits[b]*(n-bits[b])) * ((1i64 << b) % MOD);
      |                                                  ^~~~
a.cc:28:63: error: 'MOD' was not declared in this scope
   28 |                 ans += (bits[b]*(n-bits[b])) * ((1i64 << b) % MOD);
      |                                                               ^~~
a.cc:32:22: error: 'ans' was not declared in this scope; did you mean 'abs'?
   32 |         std::cout << ans;
      |                      ^~~
      |                      abs
Language: C++

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

const long long MOD = 1e9 + 7;
const int INF = 1e9;

int main(){
  long long n;
  const long long max_n = 3 * 1e5;
  long long a[max_n + 1];
  cin >> n;
  for(long long i = 0; i < n; i++) cin >> a[i];

  // long long num[62] = {};
  // for(long long i = 0; i <= 60; i++){
  //   for(long long j = 0; j < n; j++){
  //     if(a[j]&(1LL<<i)) num[i] += 1;
  //   }
  // }
  
  long long ans = 0;
  long long now = 1;
  for(long long i = 0; i <= 60; i++){
    // long long now = (1LL << i);
    // now %= MOD;
    long long x = 0;
    for(int j = 0; j < n; j++) if (a[j]>>i&1) x++;
    now = 1;
    now = x * (n-x) % MOD;
    for(int j = 0; j < i; j++) {
      now = now * 2 % MOD;
    }
    // ans += x * (n-x) * now;
    asn += now;
    ans %= MOD;
  }
  cout << ans << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:5: error: 'asn' was not declared in this scope; did you mean 'ans'?
   34 |     asn += now;
      |     ^~~
      |     ans
Language: C++

#include <bits/stdc++.h>
#include <limits>
#include <math.h>
#include <cmath>
#include <cctype>
#include <cstdio>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pll = pair<ll, ll> ;
using vs = vector<string>;
using vb = vector<bool>;
using vll = vector<long long>;
using vvll = vector<vector<long long >>;
#define PI  3.1415926535
#define rep(i, k, n) for(ll i = k; i < n; i++)

int main(){
  	ll MOD = 1000000007;
	ll n; cin >> n;
    vll a(n);
    rep(i, 0, n){cin >> a[i];}
    
    vll count1(100, 0);
    vll sum(100);
    
    rep(i, 0, n){
    	vll shinsu (0);
        while(a[i] > 1){
        	shinsu.emplace_back(a[i]%2);
            a[i] /= 2;
        }
      	shinsu.emplace_back(1);
      
      //for(auto x:shinsu){cout << x;}
      //cout << endl;
      	
      rep(j, 0, shinsu.size()){if(shinsu[j] == 1){count1[j]++;}}
    }
  //cout << count1[0] << count1[1] << count1[2] << count1[3] << endl;
  ll ans = 0;
  rep(i, 0, 100){
    sum[i] = count1[i] * (n - count1[i]);
    ans += ((sum[i] % MOD) * (pow(2, i) % MOD)) % MOD;
    ans %= MOD;
  }
  
  cout << ans << endl;
}
  
  
    
    

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

#include<bits/stdc++.h>

using namespace std;
using   ll=long long;

#define fast        	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)

#define endl        	"\n"
#define pb          	push_back
#define mp          	make_pair
#define F           	first
#define S           	second
#define int             long long int
#define pll				pair<int , int>

#define ALL(v)      	v.begin(),v.end()
#define ALLR(v)     	v.rbegin(),v.rend()
#define pii         	3.14159265358979323
#define inf     		LLONG_MAX
#define ones(x)     	__builtin_popcount(x)
#define fill(a,b)   	memset(a,b,sizeof(a))
#define mod 			1000000007
#define hell            998244353 

ll mod_pow(ll a,ll b,ll m) 
{
    ll res = 1;
    while(b)	
    {
        if(b&1) 	
        {
        	res=(res*a) % m;
        }
        a=(a*a) % m;
        b>>=1;
    }
    return res;
}

ll mod_inverse(ll a) 
{
	return mod_pow(a , mod-2 , mod);
}

void solve()
{
	int n;
	
	cin >> n;
	
	int bit[64] {};
	
	for(int i = 0; i < n; ++i) {
		int x;
		
		cin >> x;
		
		for(int i = 0; i < 60; ++i) {
			if(((1LL<<i)&x)) {
				bit[i]++;
			}
		}
	}
	
	int ans = 0;
	
	for(int i = 0; i < 60; ++i) {
		int tm = pow(2 , i) % mod;
		
		int mt = (bit[i]*(n-bit[i])) % mod;
		
		ans = (ans + (tm*mt) % mod) % mod;
	}
	
	cout << ans;
}

signed main() {
    fast;
    
    int t = 1;
    
	//cin >> t;
    
    while(t--) {
        solve();
    }
 
    return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:68:37: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%'
   68 |                 int tm = pow(2 , i) % mod;
      |                          ~~~~~~~~~~ ^
      |                             |
      |                             __gnu_cxx::__promote<double>::__type {aka double}
Language: C++

#include <iostream>
#include <cmath>
#include <stdint.h>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
#include <string.h>
#include <set>
using namespace std;
 
#define int long long
 
 
int gcd(int a, int b){
	
	if(b==0){
		return a;
	}
	
	return gcd(b,a%b);
	
}
 
 int lcm(int a, int b)  
 {  
    return (a*b)/gcd(a, b);  
 }  
 
 
int f(int x){
	
	
	int res = 0;
	
	while( x%2 == 0){
		
		x/=2;
		res++;
	}
	
	return res;
	
}
 
 #define MOD 1000000007;
 
 int arr[300001];
 
int32_t main() {
 	
 	int n;
 	
 	cin >> n;
 	
 	for(int i=0; i<n; i++){	
 	
 	 	cin >> arr[i];
 	 	
	}
 	
 	int one[64];
 	int zero[64];
 	
 	for(int i=0; i<n; i++){
 		
 		int  tmp = a[i];
 		int k =0;
 		while(tmp){
 			
 			if(tmp &1){
 				
 				one[k]++;
 				
			}
 			else{
 				zero[k]++;
			}
 			
 			tmp/=2;
 			k++;
 			
		}
 		
 		for(int j=k; j<=63; j++){
 			
 			zero[j]++;
 			
		}
 		
 		
	}
 	
 	int ans = 0;
 	 for(int i=0; i<64; i++){
 	 	
 		
 		ans = ans + one[i]%MOD * zero[i]%MOD * pow(2,i) %MOD;
	  	ans %= MOD;
 	 	
	}
 	
 	cout<<ans << endl;
 	  
}
 
 
 

Compiler output:
a.cc: In function 'int32_t main()':
a.cc:68:28: error: 'a' was not declared in this scope
   68 |                 int  tmp = a[i];
      |                            ^
a.cc:99:40: error: invalid type argument of unary '*' (have 'long long int')
   99 |                 ans = ans + one[i]%MOD * zero[i]%MOD * pow(2,i) %MOD;
      |                                        ^~~~~~~~~
a.cc:99:54: error: invalid type argument of unary '*' (have '__gnu_cxx::__promote<double>::__type' {aka 'double'})
   99 |                 ans = ans + one[i]%MOD * zero[i]%MOD * pow(2,i) %MOD;
      |                                                      ^~~~~~~~~~
Language: C++

#include<iostream>
#include <vector>
using namespace std;

typedef ll long long;
const ll MOD = 1e9+7;

int main(){
    ll n;
    cin >> n;
    vector<ll> b1(65, 0), b2(65, 0);

    long long ans = 0;

    for(int i = 0; i < n; i++) {
        long long x;
        cin >> x;
        for(int j = 0; j <= 60; j++){
            if((x & (1ll<<j))){
                b1[j]++;
            }
            else b2[j]++;
        }
    }

    for(int j = 0; j <= 60; j++){
        long long tmp = (b1[j] * b2[j])%MOD;
        tmp = (tmp * (1ll<<j)%MOD)%MOD;
        ans = (ans + tmp)%MOD;

    }
    cout << ans;

}


Compiler output:
a.cc:5:9: error: 'll' does not name a type
    5 | typedef ll long long;
      |         ^~
a.cc:6:7: error: 'll' does not name a type
    6 | const ll MOD = 1e9+7;
      |       ^~
a.cc: In function 'int main()':
a.cc:9:5: error: 'll' was not declared in this scope
    9 |     ll n;
      |     ^~
a.cc:10:12: error: 'n' was not declared in this scope
   10 |     cin >> n;
      |            ^
a.cc:11:14: error: template argument 2 is invalid
   11 |     vector<ll> b1(65, 0), b2(65, 0);
      |              ^
a.cc:11:24: error: expression list treated as compound expression in initializer [-fpermissive]
   11 |     vector<ll> b1(65, 0), b2(65, 0);
      |                        ^
a.cc:11:35: error: expression list treated as compound expression in initializer [-fpermissive]
   11 |     vector<ll> b1(65, 0), b2(65, 0);
      |                                   ^
a.cc:20:19: error: invalid types 'int[int]' for array subscript
   20 |                 b1[j]++;
      |                   ^
a.cc:22:20: error: invalid types 'int[int]' for array subscript
   22 |             else b2[j]++;
      |                    ^
a.cc:27:28: error: invalid types 'int[int]' for array subscript
   27 |         long long tmp = (b1[j] * b2[j])%MOD;
      |                            ^
a.cc:27:36: error: invalid types 'int[int]' for array subscript
   27 |         long long tmp = (b1[j] * b2[j])%MOD;
      |                                    ^
a.cc:27:41: error: 'MOD' was not declared in this scope
   27 |         long long tmp = (b1[j] * b2[j])%MOD;
      |                                         ^~~
Language: C++

#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = s; i < (int)(n); i++)
#define Clear(a) a = decltype(a)();
typedef long long ll;
typedef pair<int,int> p;
//const ll big=998244353;
const ll big=1000000007;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
ll max(ll x,ll y){
if(x>y)return x;
else return y;
}
ll min(ll x,ll y){
if(x<y)return x;
else return y;
}
ll expm(ll x,ll y){
    if(y==0)return 1;//0^0=1
    if(x==1||x==0)return x;
    if(y%2==1)return (expm(x,y-1)*x)%big;
    ll t=expm(x,y/2);
    return (t*t)%big;
}
ll exp(ll x,ll y){
    if(y==0)return 1;//0^0=1
    if(x==1||y==0)return x;
    if(y%2==1)return exp(x,y-1)*x;
    ll t=exp(x,y/2);
    return t*t;
}
ll inv(ll x){
    return expm(x,big-2);
}

ll f(vector<ll> &a){
    vector<ll> sums(61);
    ll len=a.size();
    rep(i,len){
        bitset<61> now(a[i]);
        rep(j,61){
            sums[j]+=now[j];
        }
    }
    
    ll ans=0;
    ll pows=1;
    rep(i,61){
        ans+=((((len-sums[i])%big)*sum[i])%big*pows)%big;
        ans%=big;
        pows*=2;
        pows%=big;
    }
    return ans;
}

int main(){
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    cout << fixed << setprecision(10);
    /*--------------------------------*/

    int n;cin >> n;
    vector<ll> a(n);
    rep(i,n)cin >> a[i];
    /*a xor b==a+b-2*(a&b)
    a&b+a&c+...
    */
   ll ans=0;
   rep(i,n)ans=(ans+a[i]*(n-1))%big;
   cout << f(a) << endl;
}


Compiler output:
a.cc: In function 'll f(std::vector<long long int>&)':
a.cc:52:36: error: 'sum' was not declared in this scope; did you mean 'sums'?
   52 |         ans+=((((len-sums[i])%big)*sum[i])%big*pows)%big;
      |                                    ^~~
      |                                    sums
Language: C++

#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = s; i < (int)(n); i++)
#define Clear(a) a = decltype(a)();
typedef long long ll;
typedef pair<int,int> p;
//const ll big=998244353;
const ll big=1000000007;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
ll max(ll x,ll y){
if(x>y)return x;
else return y;
}
ll min(ll x,ll y){
if(x<y)return x;
else return y;
}
ll expm(ll x,ll y){
    if(y==0)return 1;//0^0=1
    if(x==1||x==0)return x;
    if(y%2==1)return (expm(x,y-1)*x)%big;
    ll t=expm(x,y/2);
    return (t*t)%big;
}
ll exp(ll x,ll y){
    if(y==0)return 1;//0^0=1
    if(x==1||y==0)return x;
    if(y%2==1)return exp(x,y-1)*x;
    ll t=exp(x,y/2);
    return t*t;
}
ll inv(ll x){
    return expm(x,big-2);
}

ll f(vector<ll> &a){
    vector<ll> sums(61);
    ll len=a.size();
    rep(i,len){
        bitset<61> now(a[i]);
        rep(j,61){
            sums[j]+=now[j];
        }
    }
    
    ll ans=0;
    ll pows=1;
    rep(i,61){
        ans+=(((len-sums[i])%big)*sums[i])%big*pows)%big;
        ans%=big;
        pows*=2;
        pows%=big;
    }
    return ans;
}

int main(){
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    cout << fixed << setprecision(10);
    /*--------------------------------*/

    int n;cin >> n;
    vector<ll> a(n);
    rep(i,n)cin >> a[i];
    /*a xor b==a+b-2*(a&b)
    a&b+a&c+...
    */
   ll ans=0;
   rep(i,n)ans=(ans+a[i]*(n-1))%big;
   cout << f(a) << endl;
}


Compiler output:
a.cc: In function 'll f(std::vector<long long int>&)':
a.cc:52:52: error: expected ';' before ')' token
   52 |         ans+=(((len-sums[i])%big)*sums[i])%big*pows)%big;
      |                                                    ^
      |                                                    ;
Language: C++

#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = s; i < (int)(n); i++)
#define Clear(a) a = decltype(a)();
typedef long long ll;
typedef pair<int,int> p;
//const ll big=998244353;
const ll big=1000000007;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
ll max(ll x,ll y){
if(x>y)return x;
else return y;
}
ll min(ll x,ll y){
if(x<y)return x;
else return y;
}
ll expm(ll x,ll y){
    if(y==0)return 1;//0^0=1
    if(x==1||x==0)return x;
    if(y%2==1)return (expm(x,y-1)*x)%big;
    ll t=expm(x,y/2);
    return (t*t)%big;
}
ll exp(ll x,ll y){
    if(y==0)return 1;//0^0=1
    if(x==1||y==0)return x;
    if(y%2==1)return exp(x,y-1)*x;
    ll t=exp(x,y/2);
    return t*t;
}
ll inv(ll x){
    return expm(x,big-2);
}

ll f(vector<ll> &a){
    vector<ll> sums(61);
    ll len=a.size();
    rep(i,len){
        bitset<61> now(a[i]);
        rep(j,61){
            sums[j]+=now[j];
        }
    }
    
    ll ans=0;
    ll pows=1;
    rep(i,61){
        ans+=(((len-sums[i])%big)*sum[i])%big*pows)%big;
        ans%=big;
        pows*=2;
        pows%=big;
    }
    return ans;
}

int main(){
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    cout << fixed << setprecision(10);
    /*--------------------------------*/

    int n;cin >> n;
    vector<ll> a(n);
    rep(i,n)cin >> a[i];
    /*a xor b==a+b-2*(a&b)
    a&b+a&c+...
    */
   ll ans=0;
   rep(i,n)ans=(ans+a[i]*(n-1))%big;
   cout << f(a) << endl;
}


Compiler output:
a.cc: In function 'll f(std::vector<long long int>&)':
a.cc:52:35: error: 'sum' was not declared in this scope; did you mean 'sums'?
   52 |         ans+=(((len-sums[i])%big)*sum[i])%big*pows)%big;
      |                                   ^~~
      |                                   sums
Language: C++

#include <iostream>
#include <vector>
using namespace std;
long long MOD = 1e9 + 7;
int main(){
    int N;
    cin >> N;
    vector<long long> A(N);
    for(int i = 0; i < N; i++) cin >> A[i];
    vector<long long> cnt(60, 0);
    for(int i = 0; i < N; i++){
        int cn = 0;
        long long t = A[i];
        while(t > 0){
            if(t % 2 == 1) cnt[cn]++;
            cn++;
            t >>= 1;
        }
    }
    long long ans = 0;
    for(int i = 0; i < 60; i++){
        ans += (1LL << i) % MOD * cnt[j] % MOD * (N - cnt[j]) % MOD;
        ans %= MOD;
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:39: error: 'j' was not declared in this scope
   22 |         ans += (1LL << i) % MOD * cnt[j] % MOD * (N - cnt[j]) % MOD;
      |                                       ^
Language: C++


#include <stdio.h>
#include <string.h>
#include <limits.h>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <stack>
#include <queue>

typedef unsigned long long ULLONG;
typedef long long LLONG;
static const LLONG MOD_NUM = 1000000007;

template<class _T> static void getint(_T& a) {
	std::cin >> a;
}
template<class _T> static void getint(_T& a, _T& b) {
	std::cin >> a >> b;
}
template<class _T> static void getint(_T& a, _T& b, _T& c) {
	std::cin >> a >> b >> c;
}

static void ABC147D();

int main()
{
	ABC147D();
	fflush(stdout);
	return 0;
}

static void ABC147D()
{
	int N;
	getint(N);

	std::vector<LLONG> ai(N);
	std::vector<std::vector<int>> bits(N, std::vector<int>(60, 0));
	for (int i = 0; i < N; i++) {
		if (i) bits[i] = bits[i - 1];

		getint(ai[i]);

		int bit = 0;
		LLONG tmp = ai[i];
		while (tmp) {
			if (tmp & 0x1) bits[i][bit]++;
			tmp >>= 1;
			bit++;
		}
	}

	std::vector<int> sum(60, 0);
	for (int i = 0; i < N - 1; i++) {
		for (int bit = 0; bit < 60; bit++) {
			int on = bits[N - 1][bit] - bits[i][bit];
			if ((ai[i] >> bit) & 0x1) {
				sum[bit] += (N - i - 1) - on;
			}
			else {
				sum[bit] += on;
			}
		}
	}

	LLONG ans = 0;
	for (int bit = 0; bit < 60; bit++) {
		ans += sum[bit] * tp_modpow<LLONG>(2, bit, MOD_NUM);
		ans %= MOD_NUM;
	}
	printf("%lld\n", ans);
}


Compiler output:
a.cc: In function 'void ABC147D()':
a.cc:73:35: error: 'tp_modpow' was not declared in this scope
   73 |                 ans += sum[bit] * tp_modpow<LLONG>(2, bit, MOD_NUM);
      |                                   ^~~~~~~~~
a.cc:73:50: error: expected primary-expression before '>' token
   73 |                 ans += sum[bit] * tp_modpow<LLONG>(2, bit, MOD_NUM);
      |                                                  ^
Language: C++

#include<bits/stdc++.h>
#define LL long long
using namespace std;
int main () {
  int N;
  cin >> N;
  LL bi[300002][63];
  vector<LL>sum(63, 0ll);
  LL ans[63];
  for (int i = 0; i < N; i ++) {
    LL a;
    cin >> a;
    for (int j = 0; j < 61; j ++) {
      bi[i][j] = a % 2ll;
      sum[j] += bi[i][j];
      a /= 2ll;
    }
  }
  LL m = 1e9 + 7;
  for (int i = 0; i < 63; i ++) ans[i] = 0;
  for (int i = 0; i < N; i ++) {
    for (int j = 0; j < 63; j ++) {
      if (bi[i][j]) {
        ans[j] += (N - sum[j]);
      }
      else ans[j] += sum[j];
    }
  }
  LL kj = 1;
  LL ret = 0;
  for (int i = 0; i < 63; i ++) {
    ret += ans[j] * kj;
    ret %= m;
    kj *= 2;
    kj %= m;
  }
  kj *= 500000004ll;
  kj %= m;
  cout << kj << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:16: error: 'j' was not declared in this scope
   32 |     ret += ans[j] * kj;
      |                ^
Language: C++

#include<bits/stdc++.h>
#include<string>
#include<vector>
using namespace std;
typedef pair<int, int>P;
typedef long long ll;
#define rep(i,n)for(ll i=0;i<n;++i)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll MOD = 1000000007;
const ll INF = 1e16;
const ll MAX_N = 5000100;
//max=({});
//条件式が真ならwhileの中身を回し続ける
//printf("%d\n", ans);

//pairの入力
//vector<pair<ll, ll>>work(n);
//rep(i, n) {
//	ll a, b;
//	cin >> a >> b;
//	work[i] = make_pair(a, b);
//for(auto p:mp)(mapの探索)
//printf("%.10f\n",なんちゃら)
//最大公約数
ll gcd(ll x, ll y) {
	return y ? gcd(y, x % y) : x;
}

ll lcm(ll x, ll y) {
	if (x == 0 || y == 0)return 0;
	return (x / gcd(x, y) * y);
}

//組み合わせの余りを求める
ll fac[MAX_N], finv[MAX_N], inv[MAX_N];
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX_N; i++) {
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}

// 二項係数計算
long long COM(ll n, ll k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

ll dx[8] = { 0,0,-1,1 };
ll dy[8] = { -1,1,0,0 };
ll dp[101010];

//union-find木について
ll par[101010];
ll rank2[101010];

void init(ll n) {
	rep(i, n) {
		par[i] = i;
		rank2[i] = 0;
	}
}

ll find(ll x) {
	if (par[x] == x) {
		return x;
	}
	else {
		return par[x] = find(par[x]);
	}
}

void unite(ll x, ll y) {
	x = find(x);
	y = find(y);
	if (x == y)return;
	if (rank2[x] < rank2[y]) {
		par[x] = y;
	}
	else {
		par[y] = x;
		if (rank2[x] == rank2[y]) {
			rank2[x]++;
		}
	}
}

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;
}

bool graph[101][101];
vector<ll> to[101010];
vector<ll>ball(101010, 1);
char c[10][10];
bool visited[10][10];
char math[1010][1010];
ll res2[101010][101];

//long longしか使わない
//素数は1より大きい
int main() {
	ll n;
	cin >> n;
	vector<ll>a(n);
	rep(i, n) {
		cin >> a[i];
	}
	ll ans = 0;
	rep(i, 60) {
		ll x = 0;
		rep(j, n) {
			if (a[j] >> i & 1)x++;
		}
		ll now = x * (n - x) % MOD;
		rep(j, i) {
			now=now*2%MOD
		}
		ans += now;
		ans %= MOD;
	}
	cout << ans << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:136:38: error: expected ';' before '}' token
  136 |                         now=now*2%MOD
      |                                      ^
      |                                      ;
  137 |                 }
      |                 ~
Language: C++

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

#define REP(i,n) for(ll i=0; i<(ll)(n); i++)
#define FOR(i,n,m) for (ll i=n; i<(ll)(m); i++)
#define pb push_back
#define INF 1000000007LL
#define all(a) (a).begin(),(a).end()
#define chmin(a,b) a=min(a,b)
#define chmax(a,b) a=max(a,b)

typedef long long ll;
typedef pair<int,int> p;



class DXorSum4 {
public:
    int dy[4]={-1,1,0,0};
    int dx[4]={0,0,1,-1};

	void solve(std::istream& in, std::ostream& out) {
	    int N;
	    in >> N;
	    vector<ll> A(N);
	    vector<ll> digit_zero(60, 0);
	    vector<ll> digit_one(60, 0);
	    REP(i, N) {
	        in >> A[i];
	    }
	    REP(i,N) {
            REP(j, 60) {
                if (A[i] >> j & 1) {
                    digit_one[j]++;
                } else {
                    digit_zero[j]++;
                }
            }
	    }
	    ll ans = 0;
	    REP(i, N) {
	        REP(j,  60) {
                if (A[i] >> j & 1) {
                    ans += ((1L << j) % ll(1e9+7)) * digit_zero[j];
                    digit_one[j]--;
                    ans %= ll(1e9+7);
                } else {
                    ans +=  ((1L << j) % ll(1e9+7)) * digit_one[j];
                    digit_zero[j]--;
                    ans %= ll(1e9+7);
                }
	        }
	    }
	    out << ans << endl;
	}
};


Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include<bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
#define pb push_back
#define f first
#define s second
#define MOD 1000000007
 
using namespace std;

unsigned uint64_t A[100001];

ll modexp(int i, ll p){
	if(p == 0) return 1;
	ll ans = modexp(i,p/2);
	ans = (ans*ans)%MOD;
	if(p%2) ans =  (i*ans)%MOD;
	return ans;
}

void solve(){
	int n; cin>>n;
	for(int i=0; i<n; i++){
		cin>>A[i];
	}
	ll ans=0;
	for(int bit=0; bit<60; bit++){
		ll x=0;
		for(int i=0; i<n; i++){
			if((A[i] & (1ULL<<bit))){
				x++;
			}
		}
		//cout<<bit<<" : "<<x<<" sex\n";
		x = (x*(n-x))%MOD;
		ans += (modexp(2,bit)*x)%MOD;
		ans = ans%MOD;
	}
	cout<<ans;

}


int main()
{ 
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout<<fixed<<setprecision(12);
	int t =1; //cin>>t;
	for(int i=1; i<=t; i++){
		solve();
		cout<<"\n";
	}
	return 0;

}

Compiler output:
a.cc:11:19: error: expected initializer before 'A'
   11 | unsigned uint64_t A[100001];
      |                   ^
a.cc: In function 'void solve()':
a.cc:24:22: error: 'A' was not declared in this scope
   24 |                 cin>>A[i];
      |                      ^
a.cc:30:29: error: 'A' was not declared in this scope
   30 |                         if((A[i] & (1ULL<<bit))){
      |                             ^
Language: C++

#include <bits/stdc++.h>

using namespace std;
#define all(a)a.begin(),a.end()
using ll=long long;
const int INF = 1<<30;
const ll INFll =1LL<<62;
const int mod =(1e9)+7;
using P = pair<ll,ll>;

int main(){
    ll n;cin >>n;
    vector<ll>a(n);
    for (int i = 0; i < n; ++i) {
        cin >>a[i];
    }
    vector<ll>memo(60,0);
    for (int i = 0; i < 60; ++i) {
        for (int j = 0; j < n; ++j) {
            if(a[j]>>i&1))memo[i]++;
        }
    }
//    for (int i = 0; i < 5; ++i) {
//        cout <<i<<" "<<memo[i]<<" "<<(1LL<<i)<<endl;
//   }
    ll ans=0;
    for (int i = 0; i < 60; ++i) {
        ll x=memo[i]*(n-memo[i])%mod;
        for (int j = 0; j < i; ++j) {
            x*=2%mod;
        }
        ans+=x;
        ans%=mod;
//        cout <<i<<" "<<ans<<endl;
    }
    cout <<ans<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:26: error: expected primary-expression before ')' token
   20 |             if(a[j]>>i&1))memo[i]++;
      |                          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ll N;
  cin >> N;
  ll A[N];
  ll mod = 1000000007;
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  for (int bit = 0; bit < 60; bit++) {
    ll one = 0;
    for (int i = 0;i < N; i++) {
      if (A[i] & (1 << bit)) {
        one++;
      }
    }
    ll now = one * (N - one) % mod;
    for (int i = 0; i < bit; i++) {
      now = (now * 2) % mod;
    }
    ans += now;
    ans += mod;
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   23 |     ans += now;
      |     ^~~
      |     abs
a.cc:26:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   26 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
const long long mod = 1000000007LL;

int main(void) 
{
 
    int N;
    cin >> N;

    vector<int> A(N);
 
    for (int i=0; i<N; ++i)
    {
        cin >> A[i];
    }

    for (int i=0; i<60; ++i) 
    {
        int a0 = 0;
        int a1 = 0;
        for(int j=0; j<N; ++j)
        {
            if (A[j]&(1LL<<i))
                a1++;
            else
                a0++;
        }
        int tmp = a1 * a0 % mod;
        for (int j=0; j<i; ++j)
        {
            tmp = 2 * tmp % mod;
        }
        ans += tmp % mod;
    }
 
    ans = ans % mod;
    cout << ans << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   35 |         ans += tmp % mod;
      |         ^~~
      |         abs
a.cc:38:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   38 |     ans = ans % mod;
      |     ^~~
      |     abs
Language: C++

#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
typedef long long ll;
//
ll mod_pow(ll,ll,ll);
int main(){
    vector<ll> bits(60);
    int n;
    cin >> n;
    for(int i = 0; i < n; i++){
        ll in;
        cin >> in;
        for(int j = 0; j < 60; j++){
            bits[j] += (in >> j & 1);
        }
    }
    vector<ll> div(60);
    for(int i = 0; i < 60; i++){
        div[i] = mod_pow(2, i, MOD);
    }
    ll ans = 0;
    for(int i = 0; i < 60; i++){
        ans = (ans + div[i] * bits[i] * (n - bits[i])) % MOD;
    }
    cout << ans;
}

Compiler output:
/usr/bin/ld: /tmp/ccgWAIVw.o: in function `main':
a.cc:(.text+0x109): undefined reference to `mod_pow(long long, long long, long long)'
collect2: error: ld returned 1 exit status
Language: C++

mod = 1000000007

N = int(input())
A = list(map(int, input().split()))
s = 0
for i in range(1, N):
	for j in range(i+1, N+1):
		s = (s+(A[i-1] ^ A[j-1]))%mod

print(s)

Compiler output:
a.cc:1:1: error: 'mod' does not name a type
    1 | mod = 1000000007
      | ^~~
Language: C++

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

int main(){
  int n;
  cin >> n;
  int a[60];
  int b[60];
  for(int i=0; i<n; i++){
    int x;
    cin >> x;
    bitset<60> y(x);
    for(int j=0; j<60; j++){
      if(y[j]) a[j]++;
      else b[j]++;
    }
  }
  int ans=0;
  for(int i=0; i<n; i++){
    ans += a[i]*b[i]
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:21: error: expected ';' before '}' token
   20 |     ans += a[i]*b[i]
      |                     ^
      |                     ;
   21 |   }
      |   ~
Language: C++

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

int main(){
  int n;
  cin >> n;
  int a[60];
  int b[60]
  for(int i=0; i<n; i++){
    int x;
    cin >> x;
    bitset<60> y(x);
    for(int j=0; j<60; j++){
      if(y[j]) a[j]++;
      else b[j]++;
    }
  }
  int ans=0;
  for(int i=0; i<n; i++){
    ans += a[i]*b[i]
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: expected initializer before 'for'
    9 |   for(int i=0; i<n; i++){
      |   ^~~
a.cc:9:16: error: 'i' was not declared in this scope
    9 |   for(int i=0; i<n; i++){
      |                ^
a.cc:20:17: error: 'b' was not declared in this scope
   20 |     ans += a[i]*b[i]
      |                 ^
Language: C++

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

int main(){
  int n;
  cin >> n;
  int a[60];
  int b[60]
  for(int i=0; i<n; i++){
    int x;
    cin >> x;
    bitset<60> y(x)
    for(int j=0; j<60; j++){
      if(y[j]) a[j]++;
      else b[j]++;
    }
  }
  int ans=0;
  for(int i=0; i<n; i++){
    ans += a[i]*b[i]
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: expected initializer before 'for'
    9 |   for(int i=0; i<n; i++){
      |   ^~~
a.cc:9:16: error: 'i' was not declared in this scope
    9 |   for(int i=0; i<n; i++){
      |                ^
a.cc:20:17: error: 'b' was not declared in this scope
   20 |     ans += a[i]*b[i]
      |                 ^
Language: C++

#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#include <bits/stdc++.h>
#define SIZE 300005
#define MOD 1000000007LL
#define EPS 1e-10
#define INF 2147483647
#define LLINF 9223372036854775807LL
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define DOWN(i,b,a) for(int i=b;i>=a;i--)
#define SET(a,c) memset(a,c,sizeof a)
#define BIT(i,j) ((i)>>(j))&1
#define ALL(o) (o).begin(), (o).end()
#define ERASE(o) (o).erase(unique((o).begin(),(o).end()), (o).end())
#define SQ(x) ((x)*(x))
#define CEIL(A,B) ((A)+(B)-1)/(B)
using namespace std;
typedef int_fast64_t ll;
typedef pair<ll,ll> Pll;
typedef pair<int, int> Pii;
typedef pair<double, double> Pdd;
typedef complex<double> dcomplex;
template<typename T> inline void priv(vector<T>a){REP(i,a.size()){cerr<<a[i]<<((i==a.size()-1)?"\n":" ");}}
inline void fastio(){cin.tie(nullptr); cout.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15);}
ll gcd(ll a,ll b){ll c=max(a,b);ll d=min(a,b);return c==0||d==0?c:gcd(c%d,d);}
ll lcm(ll a,ll b){return a==0||b==0?0:a*b/gcd(a,b);}
ll modfact(ll a){ll b=1;FOR(i,2,a)b=b*i%MOD;return b;}
ll modpow(ll a, ll n){ll b=1;while (n>0){if(n&1)b=b*a%MOD;a=a*a%MOD;n>>=1;}return b;}
ll modcomb(ll n, ll k){ll b=1;k=min(n-k,k);DOWN(i,n,n-k+1)b=b*i%MOD;return b*modpow(modfact(k),MOD-2)%MOD;}

ll N;
vector<ll> A;

int main() {
    fastio();
    cin >> N; A.resize(N);
    REP(i, N) cin >> A[i];
    ll ans = 0;
    for(int x = 0; x <= 61 x++) {
        ll cnt = 0;
        REP(i, N) if((A[i] >> x) & 1LL) cnt++;
        ll tmp = (1LL << x) % MOD;
        // cerr << tmp << " " << cnt << endl;
        ans = (ans + tmp * (cnt * (N - cnt)) % MOD) % MOD;
    }
    cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:27: error: expected ';' before 'x'
   40 |     for(int x = 0; x <= 61 x++) {
      |                           ^~
      |                           ;
Language: C++

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

int main() {
  int n;
  cin>>n;
  vector<long long>a(n);
  for(int i=0;i<n;i++) cin>>a[i];
  long long ans=0;
  long long ab=1;
  for(int i=0;i<61;i++){
    long long zero=0;
    long long one=0;
    for(int i=0;i<n){
      if(a[i]%2==0) zero++;
      else one++;
      a[i]/=2;
    }
    long long x=zero*one;
    x%=1000000007;
    long long y=ab%1000000007;
    x*=y;
    x%=1000000007;
    ans+=x;
    ans%=1000000007;
    ab*=2;
  }
  cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:20: error: expected ';' before ')' token
   14 |     for(int i=0;i<n){
      |                    ^
      |                    ;
Language: C++

v#include <bits/stdc++.h>

#define F first 
#define S second

using namespace std;

typedef long long LL;
typedef pair<int, int> PII;

const int N = 300010, M = 62, mod = 1e9 + 7;

int n;
LL a[N];

int main()
{
	scanf("%d", &n);
	for (int i = 0; i < n; i ++ ) scanf("%lld", &a[i]);
	
	int res = 0;
	for (int i = 0; i < M; i ++ )
	{
		int one = 0, zero = 0;
		for (int j = 0; j < n; j ++ )
			if (a[j] & 1LL << i) one ++ ;
			else zero ++ ;
		res = ((LL)res + (1LL << i) % mod * (LL)one % mod * zero) % mod;
	}
	
	printf("%d\n", res);
    return 0;
}


Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | v#include <bits/stdc++.h>
      |  ^
a.cc:1:1: error: 'v' does not name a type
    1 | v#include <bits/stdc++.h>
      | ^
a.cc:9:9: error: 'pair' does not name a type
    9 | typedef pair<int, int> PII;
      |         ^~~~
a.cc: In function 'int main()':
a.cc:18:9: error: 'scanf' was not declared in this scope
   18 |         scanf("%d", &n);
      |         ^~~~~
a.cc:31:9: error: 'printf' was not declared in this scope
   31 |         printf("%d\n", res);
      |         ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | v#include <bits/stdc++.h>
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long  ll;
const ll mod =1000000007;
int main(){
    ll n;
    cin>>n;
    vector<ll> a(n),ze(64,0), ei(64,0), ans(64,0);
    for(ll i=0; i<n; i++){
        cin>>a[i];
        bitset<64> ta =a[i];
        for(int j=0; j<64; j++){
            if(ta.test(j)) ei[j]++;
            else ze[j]++;
        }
    }
    for(ll i=0; i<n; i++){
        bitset<64> ta =a[i];
        for(int j=0; j<64 ; j++){
            if(ta.test(j)){
                ei[j] -=1;
                ans[j] =(ans[j] + ze[j] )%mod;
            }
            else{
                ze[j] -=1;
                ans[j] =(ans[j] + ei[j] ) %mod;
            }
        }
    }
    ll an=0;
    ll tmp=1;
    for(int i=0; i<64; i++){
        an += (ans[i] *tmp)%mod;
        an %= mod;
        tmp *=2;
        tmp %=mod
    }
    cout<<an<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:18: error: expected ';' before '}' token
   36 |         tmp %=mod
      |                  ^
      |                  ;
   37 |     }
      |     ~
Language: C++

#include<iostream>
#include<cmath>
#include<map>
#include<deque>
#include<string>
#include<algorithm>
#include<bitset>
typedef long long ll;

#define all(x) (x).begin(),(x).end()
#define puts(x) cout<< x << endl;
#define rep(i,m,n) for(ll i=m;i<n;i++)
#define fore(i,a) for(auto i:a)
const ll MOD= 1000000007;
using namespace std;
ll n;
ll a[300005];
int main(){
    cin>>n;
    rep(i,0,n){
        cin>>a[i];
    }
    ll ans=0;
    rep(t,0,61){//すべてのけたについて考える
        ll zero=0,one=0;
        rep(i,0,n){
            if(a[i]>>t&1){
                one+=1;
            }else{
                zero+=1;
            }
            
        }
        ll c=(one*zero)%MOD;
        ans+=((ll(pow(2,t))%MOD)*c)%MOD;
        ans=ans%MOD;
    }
    puts(ans);
}
#include<iostream>
#include<cmath>
#include<map>
#include<deque>
#include<string>
#include<algorithm>
#include<bitset>
typedef long long ll;

#define all(x) (x).begin(),(x).end()
#define puts(x) cout<< x << endl;
#define rep(i,m,n) for(ll i=m;i<n;i++)
#define fore(i,a) for(auto i:a)
const ll MOD= 1000000007;
using namespace std;
ll n;
ll a[300005];
int main(){
    cin>>n;
    rep(i,0,n){
        cin>>a[i];
    }
    ll ans=0;
    rep(t,0,61){//すべてのけたについて考える
        ll zero=0,one=0;
        rep(i,0,n){
            if(a[i]>>t&1){
                one+=1;
            }else{
                zero+=1;
            }
            
        }
        ll c=(one*zero)%MOD;
        ans+=((ll(pow(2,t))%MOD)*c)%MOD;
        ans=ans%MOD;
    }
    puts(ans);
}


Compiler output:
a.cc:53:10: error: redefinition of 'const ll MOD'
   53 | const ll MOD= 1000000007;
      |          ^~~
a.cc:14:10: note: 'const ll MOD' previously defined here
   14 | const ll MOD= 1000000007;
      |          ^~~
a.cc:55:4: error: redefinition of 'll n'
   55 | ll n;
      |    ^
a.cc:16:4: note: 'll n' previously declared here
   16 | ll n;
      |    ^
a.cc:56:4: error: redefinition of 'll a [300005]'
   56 | ll a[300005];
      |    ^
a.cc:17:4: note: 'll a [300005]' previously declared here
   17 | ll a[300005];
      |    ^
a.cc:57:5: error: redefinition of 'int main()'
   57 | int main(){
      |     ^~~~
a.cc:18:5: note: 'int main()' previously defined here
   18 | int main(){
      |     ^~~~
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<ctype.h>
#include<string.h>
#include<assert.h>

typedef long long ll;
typedef unsigned long long ll;

int main()
{
    int n;
    ll* a;
    ll sum = 0;
    scanf("%d", &n);
    a = calloc(n, sizeof(ll));
    for (size_t i = 0; i < n; i++)
    {
        scanf("%lld", a + i);
    }

    for (size_t i = 0; i < n - 1; i++)
    {
        for (size_t j = i + 1; j < n; j++)
        {
            sum += (a[i] ^ a[j]);
            sum %= 1000000007LL;
        }
    }

    printf("%lld", sum);

    return 0;
}



Compiler output:
main.c:8:28: error: conflicting types for 'll'; have 'long long unsigned int'
    8 | typedef unsigned long long ll;
      |                            ^~
main.c:7:19: note: previous declaration of 'll' with type 'll' {aka 'long long int'}
    7 | typedef long long ll;
      |                   ^~
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <deque>
#include <cstdio>
#include <set>
#include <map>
#include <bitset>
#include <stack>
#include <cctype>
using namespace std;
long long b[100] = { 0 }, b1[100] = { 0 };
int main() {
	int n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		long long a;
		cin >> a;
		for (int j = 0; j < 60; j++) {
			if (a & (long long(1) << j)) {
				b1[j]++;
			}
			else{
				b[j]++;
			}
		}
	}
	long long ans = 0, two = 1;
	for (int k = 0; k < 60; k++) {
		for (int l = 0; l < k; l++) {
			two = two * 2 % 1000000007;
		}
		ans += b[k] * b1[k] * two % 1000000007;
		two = 1;
		ans = ans % 1000000007;
	}
	cout << ans % 1000000007 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:34: error: expected primary-expression before 'long'
   25 |                         if (a & (long long(1) << j)) {
      |                                  ^~~~
a.cc:25:34: error: expected ')' before 'long'
   25 |                         if (a & (long long(1) << j)) {
      |                                 ~^~~~
      |                                  )
a.cc:27:26: error: expected ')' before 'else'
   27 |                         }
      |                          ^
      |                          )
   28 |                         else{
      |                         ~~~~
a.cc:25:28: note: to match this '('
   25 |                         if (a & (long long(1) << j)) {
      |                            ^
a.cc:31:17: error: expected primary-expression before '}' token
   31 |                 }
      |                 ^
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <numeric>
#include <array>

#include <boost/multiprecision/cpp_int.hpp>
#include <cmath>
#include <memory>
using namespace std;
#define DEB(variable) cout << #variable << '=' << variable << endl

#define FOR(LoopVariable,numberOFbegin,numberOFend) for (long long int LoopVariable = (numberOFbegin); (LoopVariable) < (numberOFend); (LoopVariable)++)
#define DEFOR(LoopVariable,numberOFbegin,numberOFend) for (long long int LoopVariable = (numberOFbegin)-1; (LoopVariable) >= (numberOFend); (LoopVariable)--)
#define REP(LoopVariable,numberOFend) for(long long int LoopVariable = 0;(LoopVariable)<(numberOFend);LoopVariable++)

using llint = long long int;

namespace mp = boost::multiprecision;
constexpr long long int linf = numeric_limits<long long int>::max()-5;
constexpr long long int inf= numeric_limits<int>::max()-5;
constexpr long long int mod = 1000000007;

int main(){

    mp::cpp_int n;
    cin>>n;
    vector<mp::cpp_int> v(n);
    REP(i,n){
        cin>>v[i];
    }
    mp::cpp_int h, l, result = 0;

    for (mp::cpp_int i = 1; i < (1ll << 62ll);(i<<=1)){
        h = 0;
        l = 0;
        REP(j,n){
            if(i&v[j]){
                h++;
            }else{
                l++;
            }
        }
        result += (i) * (h) * (l);
        result %= mod;
    }
    result += mod;
    result %= mod;
    cout << result << endl;
    return 0;
}


Compiler output:
a.cc:9:10: fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory
    9 | #include <boost/multiprecision/cpp_int.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
int main()
{
    ll N; cin>>N;
    ll arr[N];
    for(int i=0;i<N;i++)
        cin>>arr[i];
    ll ans = 0;
    int odd=0,even=0;
    for(int i=0;i<60;i++)
    {
        odd = 0;
        even = 0;
        ll sum = 0;
        for(int j=0;j<N;j++)
        {
            if(arr[j]%2==0)
                odd++;
            else 
                even++;
            .arr[j] = arr[j]/2;
        }
        ans = (ans+(1ll<<i)%mod*(odd%mod)*(even%mod))%mod;
    }
    cout<<ans<<"\n";

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:13: error: expected primary-expression before '.' token
   24 |             .arr[j] = arr[j]/2;
      |             ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
signed main(){
    long long n , a[3000005] , 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 = 0 , 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<<1);
    }
 
    cout<<ans<<endl;
    

Compiler output:
a.cc: In function 'int main()':
a.cc:24:21: error: expected '}' at end of input
   24 |     cout<<ans<<endl;
      |                     ^
a.cc:3:14: note: to match this '{'
    3 | signed main(){
      |              ^
Language: C++

using namespace std;
signed main(){
    long long n , a[3000005] , 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 = 0 , 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<<1);
    }
 
    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;