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

#include<bits/stdc++.h>
#define pb push_back
#define p2(x) (x)*(x)
#define len(x) (int)(x).size()
using namespace std;
typedef long double ld;
typedef long long ll;
const int mod = 1e9 + 7;
void md(int &a){
    while(a >= mod)a-=mod;
}

signed main(){
    ios_base::sync_with_stdio(0) , cin.tie(0) , cout.tie(0);
    int n;
    cin >> n;
    vector < ll > a(n);
    for(auto &i : a)cin >> i;
    vector < LL > cnt(61);
    for(int j = 0  ; j < n; ++j){
        for(int bit = 0 ; bit <= 60; ++bit){
            if((1ll<<bit)&a[j])cnt[bit]++;
        }
    }
    int answer = 0 ;
    for(int j = 0 ; j  <= 60; ++j){
        answer += (1LL*(1ll*(1ll<<j)*(cnt[j]))%mod*(n-cnt[j]))%mod;
        md(answer);
    }
    cout << answer;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:14: error: 'LL' was not declared in this scope; did you mean 'll'?
   19 |     vector < LL > cnt(61);
      |              ^~
      |              ll
a.cc:19:17: error: template argument 1 is invalid
   19 |     vector < LL > cnt(61);
      |                 ^
a.cc:19:17: error: template argument 2 is invalid
a.cc:22:35: error: invalid types 'int[int]' for array subscript
   22 |             if((1ll<<bit)&a[j])cnt[bit]++;
      |                                   ^
a.cc:27:42: error: invalid types 'int[int]' for array subscript
   27 |         answer += (1LL*(1ll*(1ll<<j)*(cnt[j]))%mod*(n-cnt[j]))%mod;
      |                                          ^
a.cc:27:58: error: invalid types 'int[int]' for array subscript
   27 |         answer += (1LL*(1ll*(1ll<<j)*(cnt[j]))%mod*(n-cnt[j]))%mod;
      |                                                          ^
Language: C++

// AtCode.cpp : このファイルには 'main' 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//

#include <iostream>
#include <string>
#include <vector>
#include <math.h>
#include <algorithm>
#include <stdint.h>

using namespace std;

typedef struct datum_name {
	int x;
	int y;
	int whosay;
	bool operator==(const datum_name& data) const
	{
		return (x == data.x && y == data.y);
	}
} datum;


bool cmp_who(const datum& left, const datum& right) {
	return left.whosay < right.whosay;
}

typedef vector<vector<int>> Graph;
vector<bool> seen;
vector<int> depth;

void dfs(const Graph& G, int v, int depth_num) {
	seen[v] = true;
	depth[v] = depth_num;

	for (auto next_v : G[v]) {
		if (seen[next_v]) continue;
		dfs(G, next_v, depth_num+1); //再帰探索
	}
}

int main()
{
	int64_t N;
	cin >> N;
	vector<int64_t> array;
	for (int64_t i = 0; i < N; i++) {
		int64_t tmp;
		cin >> tmp;
		array.push_back(tmp);
	}
	vector<int64_t> one_num;
	one_num.resize(64);
	for (int64_t order = 0; order < 64; order++) {
		for (int64_t i = 0; i < N; i++) {
			if (array[i] & ((int64_t)(1) << order)) {
				one_num[order] += 1;
			}
		}
	}

	vector<int64_t> ans_one_num;
	ans_one_num.resize(64);

	for (int64_t order = 0; order < 64; order++) {
		for (int64_t j = 0; j < N; j++) {
			if (array[j] & ((int64_t)(1) << order)) { // case bit=1
				one_num[order] -= (int64_t)(1);
				ans_one_num[order] += (int64_t)( (N-j-1) - one_num[order]);
			}
			else { // case bit = 0;
				ans_one_num[order] += (int64_t)( one_num[order]);
			}
			ans_one_num = ans_one_num % (int64_t)(1000000000 + 7);
		}
	}

	int64_t ans = 0;
	for (int64_t order = 0; order < 64; order++) {
		int64_t order_value = ((int64_t)(1) << order) % (int64_t)(1000000000 + 7);
		ans += ans_one_num[order] * order_value;
		ans = ans % (int64_t)(1000000000 + 7);
	}
	cout << ans << endl;

	return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:74:51: error: no match for 'operator%' (operand types are 'std::vector<long int>' and 'int64_t' {aka 'long int'})
   74 |                         ans_one_num = ans_one_num % (int64_t)(1000000000 + 7);
      |                                       ~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                       |             |
      |                                       |             int64_t {aka long int}
      |                                       std::vector<long int>
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int maxn=3e5+5;
const int mod=1e9+7;
typedef long long ll;
ll a[maxn];
int main(){
	int n;
	cin>>n;
	ll sum=0;
	for(int i=0;i<n;i++)
	scanf("%lld",&a[i]);
	for(int i=0;i<=60;i++){
		int cnd=0;
		for(int j=0;j<n;j++){
			if((a[j]>>i)&1) cnd++;
		}
		sum=(sum+(1ll<<i)%mod*cnt%mod*(n-cnd))%mod;
	}
	cout<<sum%mod;
	return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:18:39: error: 'cnt' was not declared in this scope; did you mean 'cnd'?
   18 |                 sum=(sum+(1ll<<i)%mod*cnt%mod*(n-cnd))%mod;
      |                                       ^~~
      |                                       cnd
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long ll;
typedef pair<ll,ll> P;
const ll mod=1000000007;
const ll LINF=1LL<<60;
const int INF=1<<30;

int main(){
	ll n;
	cin >> n;
	vector<ll> a(n);
	for(int i = 0; i < n; i++) {
		cin >> a [i];
	}
	ll sum = 0;
	
	for(ll i = 0; i <= 61; i++) {
		ll one = 0;
		ll zero = 0;
		for(ll j = 0; j < n; j++) {
			if ((a[j] & (1LL<<i)){
				one += 1;
			}
			else{
				zero += 1;
			}
		}
		sum += (one * zero * ll(pow(2.0,float(i)))); 
		sum %= mod;
	}
	cout << sum % mod << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:46: error: expected ')' before '{' token
   29 |                         if ((a[j] & (1LL<<i)){
      |                            ~                 ^
      |                                              )
a.cc:35:17: error: expected primary-expression before '}' token
   35 |                 }
      |                 ^
Language: C++

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

int main(){
  int n; cin >> n;
  vector<vector<int>> a(n, vector<int>(60, 0));
  for(int i = 0; i < n; i++){
    long long A; cin >> A;
    for(int j = 0; j < 60; j++){
      if((A >> j) & 1) a.at(i).at(j) = 1;
    }      
  }
  vector<int> out(60);
  for(int i = 0; i < 60; i++){
    int sum = 0;
    for(int j = 0; j < n; j++){
      if(a.at(j).at(i) == 1) sum++;
    }
    out.at(i) = sum;
  }
  vector<long long> out2(60);
  for(int i = 0; i < 60; i++){
    out2.at(i) = out.at(i) * (n - out.at(i));
  }
  long long res = 0;
  long long two = 1;
  for(int i = 0; i < 60; i++){
    res += (out2.at(i) * (two % 1000000007)) % 1000000007;
    two *= 2;
    two = two % 1000000007
  }
  cout << res % 1000000007;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:27: error: expected ';' before '}' token
   30 |     two = two % 1000000007
      |                           ^
      |                           ;
   31 |   }
      |   ~
Language: Java

import java.io.*;
import java.util.*;
public class Main {
	class FS {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer("");
		String next() {
			while (!st.hasMoreTokens()) {
				try { st = new StringTokenizer(br.readLine()); }
				catch (Exception e) {}
			} return st.nextToken();
		}
		int nextInt() { return Integer.parseInt(next()); }
		long nextLong() { return Long.parseLong(next()); }
	}

	public static void main(String[] args) {
		FS in = new FS();
		int n = in.nextInt();
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = in.nextLong();

		long mod = (long)1e9 + 7;
		long[][] cs = new long[60][n + 1];
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < 60; j++) {
				cs[j][i] = (a[i] & (1L << j));
				cs[j][i] %= mod;
			}
		}
		for (int i = 0; i < 60; i++)
			for (int j = 1; j <= n; j++) {
				cs[i][j] += cs[i][j - 1];
				cs[i][j] %= mod;
			}

		long ans = 0;
		for (int i = 0; i < n - 1; i++)
			for (int j = 0; j < 60; j++) {
				long cnt = cs[j][n] - cs[j][i];
				if ((a[i] & (1L << j)) == 0) {
					ans += cnt;
					ans %= mod;
				}
				else {
					long sub = (1L << j) % mod;
					sub = (sub * (n - 1 - i)) % mod;
					cnt = sub - cnt;
					ans += cnt;
					ans %= mod;
				}
			}
		ans = ((ans % mod) + mod) % mod;
		System.out.println(ans);
	}
}


Compiler output:
Main.java:18: error: non-static variable this cannot be referenced from a static context
		FS in = new FS();
		        ^
1 error
Language: Java

import java.util.*;
public class Main {
	class FS {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer("");
		String next() {
			while (!st.hasMoreTokens()) {
				try { st = new StringTokenizer(br.readLine()); }
				catch (Exception e) {}
			} return st.nextToken();
		}
		int nextInt() { return Integer.parseInt(next()); }
		long nextLong() { return Long.parseLong(next()); }
	}

	public static void main(String[] args) {
		FS in = new FS();
		int n = in.nextInt();
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = in.nextLong();

		long mod = (long)1e9 + 7;
		long[][] cs = new long[60][n + 1];
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < 60; j++) {
				cs[j][i] = (a[i] & (1L << j));
				cs[j][i] %= mod;
			}
		}
		for (int i = 0; i < 60; i++)
			for (int j = 1; j <= n; j++) {
				cs[i][j] += cs[i][j - 1];
				cs[i][j] %= mod;
			}

		long ans = 0;
		for (int i = 0; i < n - 1; i++)
			for (int j = 0; j < 60; j++) {
				long cnt = cs[j][n] - cs[j][i];
				if ((a[i] & (1L << j)) == 0) {
					ans += cnt;
					ans %= mod;
				}
				else {
					long sub = (1L << j) % mod;
					sub = (sub * (n - 1 - i)) % mod;
					cnt = sub - cnt;
					ans += cnt;
					ans %= mod;
				}
			}
		ans = ((ans % mod) + mod) % mod;
		System.out.println(ans);
	}
}


Compiler output:
Main.java:4: error: cannot find symbol
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		^
  symbol:   class BufferedReader
  location: class Main.FS
Main.java:4: error: cannot find symbol
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		                        ^
  symbol:   class BufferedReader
  location: class Main.FS
Main.java:4: error: cannot find symbol
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		                                           ^
  symbol:   class InputStreamReader
  location: class Main.FS
Main.java:17: error: non-static variable this cannot be referenced from a static context
		FS in = new FS();
		        ^
4 errors
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const ll mod = 1e9 + 7;

int main() {
  		int N; cin >> N;
  		ll A[N];	
  		for (int i = 0; i < N; i++) cin >> A[i];
  		ll ans = 0;
  		for (int bit = 0; bit < 62; bit++) {
          		ll ones = 0, zeros = 0;
          		for (int j = 0; j < N; j++) {
                  		if (A[j] >> bit & 1) ones++;
                  		else zeros++;
                }
          		ll mult = (p * q) % mod;
          		for (int j = 0; j < bit; j++) {
                  	mult = (mult * 2)% mod;
                }
          		ans += mult;
          		ans %= mod;
        }
  		cout << ans << endl;
  		return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:36: error: 'p' was not declared in this scope
   18 |                         ll mult = (p * q) % mod;
      |                                    ^
a.cc:18:40: error: 'q' was not declared in this scope
   18 |                         ll mult = (p * q) % mod;
      |                                        ^
Language: C++

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

#define For(i,a,b) for(long long (i) = (a);(i) < (b);i++)
#define Rep(i,n) For((i),0,(n))
#define All(a) (a).begin(),(a).end()
#define sp " "
#define INF 1e18
#define INT_INF 1e9

typedef long long int ll;
const ll MOD = 1000000007ll;
const ll MOD_9 = 998244353;

ll N;
ll A[300000]
int main(){
    cin >> N;
    vector<ll> cnt(64,0ll);
    Rep(i,N){
        cin >> A[i];
        Rep(j,64){
            if(A[i] & (1ll << j)){
                cnt[j] += 1ll;
                //cout << i << sp << j;
            }
        }
    }
    ll ans = 0ll;
    ll pow_2 = 1ll;
    Rep(j,64){
        //cout << cnt[j] << endl;
        ll t = (N-cnt[j])*(cnt[j]);
        t %= MOD;
        ans += pow_2*t;
        ans %= MOD;
        pow_2 *= 2ll;
        pow_2 %= MOD;
    }
    cout << ans;
    //cin >> N;
}

Compiler output:
a.cc:17:1: error: expected initializer before 'int'
   17 | int main(){
      | ^~~
Language: Java

import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;

public class xorsum4 {
    static long MOD = (long)Math.pow(10, 9) + 7;
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int N = in.nextInt();
        long a[] = new long[60];
        long b[] = new long[60];
        for (int i=0; i<N; i++) {
            long val = in.nextLong();
            for(int j=0; j<60; j++) {
                if (val%2==0) {
                    a[j]++;
                } else {
                    b[j]++;
                }
                val /= 2;
            }
        }
        long ans = 0;
        for (int i=0; i<60; i++) {
            long t = (long)Math.pow(2,i) % MOD;
            t = (t * a[i]) % MOD;
            t = (t * b[i]) % MOD;
            ans = (ans + t)%MOD;
        }
        System.out.println(ans);
    }
}

Compiler output:
Main.java:7: error: class xorsum4 is public, should be declared in a file named xorsum4.java
public class xorsum4 {
       ^
1 error
Language: C++

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

#include <boost/multiprecision/cpp_int.hpp>
using boost::multiprecision::cpp_int;

const cpp_int MOD = 1000000007;

int main() {
  cpp_int n;
  cin >> n;
  vector<cpp_int> arr(n);
  for (cpp_int i = 0; i < n; ++i) {
    cin >> arr[i];
  }
  cpp_int res = 0;
  cpp_int power_of_two = 1;
  for (cpp_int i = 0; i < 60; ++i) {
    cpp_int one = 0;
    for (cpp_int &element : arr) {
      if (element % 2 == 1) {
        one++;
      }
      element /= 2;
    }
    res = (res + power_of_two * one * (n - one)) % MOD;
    power_of_two = (power_of_two * 2) % MOD;
  }
  cout << res << endl;
}


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

/*
Author-KUSHAGRA SINGH
Birla Institute of Technology Mesra
CS K18
*/

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 

using namespace __gnu_pbds;
using namespace std;

typedef long long int ll;
typedef long double ld;
typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> ordered_set; 

//#define mp make_pair
#define pb emplace_back
#define vll vector<ll>
#define vpll vector< pair <ll,ll> >
#define pll pair <ll,ll>
#define pq priority_queue< int >
#define khtm "\n"
#define F first
#define S second
#define fr(i,a,n) for(i=a;i<n;i++)
#define mem(arr,l) memset(arr,l,sizeof arr)
#define ALL(x) x.begin(), x.end()
#define frr(i,a,n) for(i=n-1;i>=a;i--)
#define mod 1000000007
#define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define testcase ll T; cin>>T; while(T--)
const int MAX = 1e6 +2;

/*
important builtin functions
__gcd(value1, value2)
__builtin_ffs(x)
  Number of leading zeroes: __builtin_clz(x)
  Number of trailing zeroes : __builtin_ctz(x)
  Number of set bits: __builtin_popcount(x)
*/

//ll i,j,k,l,r,n,m;

int i,j,n;

//ll a[MAX];

int a[MAX];

int add (int x, int y){
	x+=y;
	if(x>=mod)
		x-=mod;
	return x;
}

int mul(int x, int y){
	return 1LL * x * y % mod;
}


int main() {
   
  
  cin>>n;
for(register int i = 1; i <= n; i++)
	cin>>a[i];

 
 for(register int j = 0; j < 60; j++) {
	 int cnt = 0;
        for(register int i = 1; i <= n; i++)
		cnt += ((a[i]>>j)&1);
	//ll temp = 1LL<<j;
	//ans= (ans + ((temp % mod) * (cnt*(n-cnt)) ) % mod);
	ans = add (ans , mul((1LL << j) %mod , mul(cnt,n-cnt)));
}

cout<<ans;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:69:18: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   69 | for(register int i = 1; i <= n; i++)
      |                  ^
a.cc:73:19: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   73 |  for(register int j = 0; j < 60; j++) {
      |                   ^
a.cc:75:26: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   75 |         for(register int i = 1; i <= n; i++)
      |                          ^
a.cc:79:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   79 |         ans = add (ans , mul((1LL << j) %mod , mul(cnt,n-cnt)));
      |         ^~~
      |         abs
a.cc:82:7: error: 'ans' was not declared in this scope; did you mean 'abs'?
   82 | cout<<ans;
      |       ^~~
      |       abs
Language: C++

#include <bits/stdc++.h>
#define rep(i, a, b) for(register int i = a; i <= b; i++)
#define per(i, a, b) for(register int i = a; i >= b; i--)
using namespace std;

typedef unsigned long long ull;
typedef pair <int, int> pii;
typedef long long ll;

template <typename _T>
inline void read(_T &f) {
    f = 0; _T fu = 1; char c = getchar();
    while(c < '0' || c > '9') { if(c == '-') fu = -1; c = getchar(); }
    while(c >= '0' && c <= '9') { f = (f << 3) + (f << 1) + (c & 15); c = getchar(); }
    f *= fu;
}

template <typename T>
void print(T x) {
    if(x < 0) putchar('-'), x = -x;
    if(x < 10) putchar(x + 48);
    else print(x / 10), putchar(x % 10 + 48);
}

template <typename T>
void print(T x, char t) {
    print(x); putchar(t);
}

const int N = 3e5 + 5, md = 1e9 + 7;

inline int add(int x, int y) {
    x += y;
    if(x >= md) x -= md;
    return x;
}

inline int sub(int x, int y) {
    x -= y;
    if(x < 0) x += md;
    return x;
}

inline int mul(int x, int y) { return 1ll * x * y % md; }

inline int fpow(int x, int y) {
    int ans = 1;
    while(y) {
        if(y & 1) ans = mul(ans, x);
        y >>= 1; x = mul(x, x);
    }
    return ans;
}

ll a[N];
int n, ans;

int main() {
   
  
  cin>>n;
for(register int i = 1; i <= n; i++)
	cin>>a[i];

 
 for(register int j = 0; j < 60; j++) {
	 int cnt = 0;
        for(register int i = 1; i <= n; i++)
		cnt += ((a[i]>>j)&1);
	//ll temp = 1LL<<j;
	//ans= (ans + ((temp % mod) * (cnt*(n-cnt)) ) % mod);
	ans = add (ans , mul((1LL << j) , mul(cnt,n-cnt)));
}

cout<<ans%mod;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:62:18: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   62 | for(register int i = 1; i <= n; i++)
      |                  ^
a.cc:66:19: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   66 |  for(register int j = 0; j < 60; j++) {
      |                   ^
a.cc:68:26: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   68 |         for(register int i = 1; i <= n; i++)
      |                          ^
a.cc:75:11: error: 'mod' was not declared in this scope; did you mean 'modf'?
   75 | cout<<ans%mod;
      |           ^~~
      |           modf
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int64_t con = 1000000007LL;
  
  int N;
  cin >> N;
  vector<bitset<60>> A(N);
  for(int i = 0; i < N; i++){
    int64_t Ai;
    cin >> Ai;
    A.at(i) = bitset<60>(Ai);
  }
  
  int64_t sum = 0;
  for(int i = 0; i < 60; i++){
    int num0 = 0;
    int num1 = 0;
    for(int j = 0; j < N; j++){
      if(A.at(j).test(i)){
        num1++;
      }else{
        num0++;
      }
    }
    int64_t sum_temp = (num0 * num1) %= con;
    for(int j = 0; j < i; j++){
      sum_temp *= 2;
      sum_temp %= con;
    }
    sum += sum_temp;
    sum %= con;
  }
  cout << sum << endl; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:30: error: lvalue required as left operand of assignment
   27 |     int64_t sum_temp = (num0 * num1) %= con;
      |                        ~~~~~~^~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
long long mo = 1e9 + 7;
int main(){
    int N;
    cin >> N;
    long long cnt = 0, cntb = 0;
    vector<long long> A(N,0);
    rep(i,N){
        cin >> A[i];
    }
    long long sum = 0;
    rep(i,61){
        cnt = 0;
        cntb = 0;
        rep(j,N){
            ((A[j] >> i) & (long long)(1) == (long long)(1))? (cnt++):(cntb++);
        }
        sum += (cnt*(cntb*(long long((long long)(1) << i))%mo)%mo) % mo;
        sum = sum % mo;
    }
    //cout << mo << endl;
    cout << sum << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:28: error: expected primary-expression before 'long'
   20 |         sum += (cnt*(cntb*(long long((long long)(1) << i))%mo)%mo) % mo;
      |                            ^~~~
a.cc:20:28: error: expected ')' before 'long'
   20 |         sum += (cnt*(cntb*(long long((long long)(1) << i))%mo)%mo) % mo;
      |                           ~^~~~
      |                            )
a.cc:20:72: error: expected ')' before ';' token
   20 |         sum += (cnt*(cntb*(long long((long long)(1) << i))%mo)%mo) % mo;
      |                     ~                                                  ^
      |                                                                        )
a.cc:20:72: error: expected ')' before ';' token
   20 |         sum += (cnt*(cntb*(long long((long long)(1) << i))%mo)%mo) % mo;
      |                ~                                                       ^
      |                                                                        )
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>

#define REP(i, n) for(int i = 0; i < n; i++)
#define VREP(vec, vecs) for(auto& vec : vecs)
#define ALL(vec) vec.begin(), vec.end()
#define MAX(vec) *max_element(ALL(vec))

using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;

ll MOD = 1000000007;

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

	vector<ll>A(N);

	REP(i, N) cin >> A[i];

	ll K = ceil(log2(max((ll)1, MAX(A))));

	vector<P>nums(K);
	vector<P>ks(K);

	REP(i, K) {
		ks[i].first = i; 
		ks[i].second = pow(2, i);
	}

	REP(i, N) {
		ll a = A[i];

		VREP(p, ks) {
			bool n = (a & p.second) > 0;
			if (n == 0) nums[p.first].first += 1;
			else nums[p.first].second += 1;
		}
	}

	ll ans = 0;

	VREP(a, A) {
		VREP(p, ks) {
			bool n = (a & p.second) > 0;
			if (n == 0) {
				nums[p.first].first -= 1;
				ans += p.second * nums[p.first].second % MOD;
			}
			else {
				nums[p.first].second -= 1;
				ans += p.second * nums[p.first].first % MOD;
			}
		}
	}

	cout << ans % MOD << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:21: error: 'log2' was not declared in this scope
   25 |         ll K = ceil(log2(max((ll)1, MAX(A))));
      |                     ^~~~
a.cc:25:16: error: 'ceil' was not declared in this scope
   25 |         ll K = ceil(log2(max((ll)1, MAX(A))));
      |                ^~~~
a.cc:32:32: error: 'pow' was not declared in this scope
   32 |                 ks[i].second = pow(2, i);
      |                                ^~~
Language: C++

#include <iostream>
#include <vector>
#include <bitset>
#include <cmath>

using namespace std;
/**
2^60 = 1152921504606846976

 */
long long xor_sum4(int n, long long a[]) {
  long divider = 1000000007;
  vector<bitset<60>> ba;
  long long ans = 0;
  for(int i=0;i<n;i++) {
    bitset<60> b = a[i];
    ba.push_back(b);
    // cout << b << endl;
  }
  for(int i=0;i<60;i++) {
    long long count_zero = 0;
    long long count_one = 0;
    for(int j=0;j<ba.size();j++) {
      bitset<60> b =  ba[j];
      if (b[i] == 0)
	count_zero++;
      else
	count_one++;
    }
    // cout << i << " -> one: " << count_one << ", zero: " << count_zero << endl;
    long adder = (count_one * count_zero) * pow(2, i);
    adder = adder % divider;
    ans += adder;
    // cout << ans << endl;
    ans = ans % divider;
  }

  return ans;
}

int main() {
  int n;
  cin >> n;
  long a[n];
  for(int i =0;i<n;i++) {
    cin >> a[i];
  }
  auto ans = xor_sum4(n, a);
  cout << ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:48:26: error: invalid conversion from 'long int*' to 'long long int*' [-fpermissive]
   48 |   auto ans = xor_sum4(n, a);
      |                          ^
      |                          |
      |                          long int*
a.cc:11:37: note:   initializing argument 2 of 'long long int xor_sum4(int, long long int*)'
   11 | long long xor_sum4(int n, long long a[]) {
      |                           ~~~~~~~~~~^~~
Language: C++

#include <iostream>
#include <vector>
#include <bitset>
#include <cmath>

using namespace std;
/**
2^60 = 1152921504606846976

 */
long long xor_sum4(int n, long long a[]) {
  long divider = 1000000007;
  vector<bitset<60>> ba;
  long long ans = 0;
  for(int i=0;i<n;i++) {
    bitset<60> b = a[i];
    ba.push_back(b);
    // cout << b << endl;
  }
  for(int i=0;i<60;i++) {
    long long count_zero = 0;
    long long count_one = 0;
    for(int j=0;j<ba.size();j++) {
      bitset<60> b =  ba[j];
      if (b[i] == 0)
	count_zero++;
      else
	count_one++;
    }
    // cout << i << " -> one: " << count_one << ", zero: " << count_zero << endl;
    long adder = (count_one * count_zero) * pow(2, i);
    adder = adder % divider;
    ans += adder;
    // cout << ans << endl;
    ans = ans % divider;
  }

  return ans;
}

int main() {
  int n;
  cin >> n;
  long a[n];
  for(int i =0;i<n;i++) {
    cin >> a[i];
  }
  auto ans = xor_sum4(n, a);
  cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:48:26: error: invalid conversion from 'long int*' to 'long long int*' [-fpermissive]
   48 |   auto ans = xor_sum4(n, a);
      |                          ^
      |                          |
      |                          long int*
a.cc:11:37: note:   initializing argument 2 of 'long long int xor_sum4(int, long long int*)'
   11 | long long xor_sum4(int n, long long a[]) {
      |                           ~~~~~~~~~~^~~
Language: C++

#include<bits/stdc++.h>
#define int long long
using namespace std;
const int INF = 1e14;
const int ZERO = 0;
const int MOD = 1000000007;
const double PI = 3.1415926535897;
typedef pair<int,int> P;

signed main() {
    int N;
    cin >> N;
    vector<int> vec(N);
    for(int i = 0;i < N;i++) {
        cin >> vec.at(i);
    }
    vector<vector<int>> d(N,vector<int>(60));
    for(int i = 0;i < N;i++) {
        for(int j = 0;j < 70;j++) {
            if(vec.at(i) % 2 == 0) {
                d[i][j] = 0;
            }
            else {
                d[i][j] = 1;
            }
            vec.at(i) /= 2;
        }
    }
    vector<int> cnt(60);
    for(int i = 0;i < 60;i++) {
        int zero = 0;
        int one = 0;
        for(int j = 0;j < N;j++) {
            if(d[j][i] == 0) {
                zero++;
            }
            else {
                one++;
            }
        }
        cnt[i] = zero * one;
    }
    int ret = 0;
    for(int i = 0;i < 60;i++) {
        int a = cnt[i] * pow(2,i) % MOD;
        ret += a;
        ret = ret % MOD;
    }
    cout << ret << endl;
}


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

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

    long long res = 0;
    for(int d = 0; d < 60; ++d){
        long long n0 = 0, n1 = 0;
        for(int i = 0; i < N; ++i){
            if((A[i] >> d) & 1) ++n1;   // d 桁目が 1
            else    ++n0;               // d 桁目が 0
        }
        long long tmp = (1ll << d) % mod;   // 2^d
        long long n = n0 * n1 % mod;        // xor 演算を施した要素で d 桁目が 1 である個数
        tmp = tmp * n % mod;                // xor 演算を施した要素の d 桁目の総和
        res = (res + tmp) % mod;
    }
    cout << res << endl;
}

Compiler output:
a.cc:2:5: error: 'cin' does not name a type
    2 |     cin >> N;
      |     ^~~
a.cc:3:5: error: 'vector' does not name a type
    3 |     vector<long long> A(N);
      |     ^~~~~~
a.cc:4:5: error: expected unqualified-id before 'for'
    4 |     for(int i = 0; i < N; ++i){
      |     ^~~
a.cc:4:20: error: 'i' does not name a type
    4 |     for(int i = 0; i < N; ++i){
      |                    ^
a.cc:4:27: error: expected unqualified-id before '++' token
    4 |     for(int i = 0; i < N; ++i){
      |                           ^~
a.cc:9:5: error: expected unqualified-id before 'for'
    9 |     for(int d = 0; d < 60; ++d){
      |     ^~~
a.cc:9:20: error: 'd' does not name a type
    9 |     for(int d = 0; d < 60; ++d){
      |                    ^
a.cc:9:28: error: expected unqualified-id before '++' token
    9 |     for(int d = 0; d < 60; ++d){
      |                            ^~
a.cc:20:5: error: 'cout' does not name a type
   20 |     cout << res << endl;
      |     ^~~~
a.cc:21:1: error: expected declaration before '}' token
   21 | }
      | ^
Language: C++

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

ll modpow(ll a, ll n, ll mod)
{
  ll res = 1;
  while (n > 0)
  {
    if (n & 1)
      res = res * a % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return res % mod;
}

ll mod = pow(10, 9) + 7;
// a以降のb桁が立ってる数
ll S[300005][70];
ll keta = 1ll << j;

int main(int argc, char *argv[]) {
  ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);

  ll n;cin>>n;
  vector<ll> a(n);
  for(ll i=0;i<n;i++){
    cin>>a[i];
  }
  for (ll i = n - 1; i >=0 ; i--)
  {
    for (ll j = 0; j < 61; j++)
    {
      S[i][j] += S[i + 1][j];
      if (a[i] & keta)S[i][j]++;
    }
  }
  ll res = 0;
  for(ll i=0;i<n-1;i++){
    for(ll j=0;j<61;j++){
      ll mp = S[i + 1][j];
      if(a[i] & keta){
        mp = n - i -1 - S[i + 1][j];
      }
      res += (modpow(2, j, mod) * mp) % mod;
      res %= mod;
    }
  }
  cout<<res<<endl;

  return 0;
}

Compiler output:
a.cc:21:18: error: 'j' was not declared in this scope; did you mean 'jn'?
   21 | ll keta = 1ll << j;
      |                  ^
      |                  jn
Language: C++

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

int LEN = 60
int MOD = 1e9+7

int main(){
    int N;
    cin >> N;
    vector<long long> a();
    for (int i=0; i<N; i++){
        cin >> a[i];
    }
    vector<vector<int>> cnt(LEN,vector<int>(2));

    for (int i=0; i<N; i++){
        for (int j=i+1; j<LEN; j++){
            cnt[j][a[i]>>j&1]++;
        }
    }

    int ans=0;
    for (int i=0; i<LEN; i++){
        ans += (1LL << i) % mod * cnt[i][0] % MOD * cnt[i][1] % MOD;
        ans %= MOD;
    }

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


Compiler output:
a.cc:5:1: error: expected ',' or ';' before 'int'
    5 | int MOD = 1e9+7
      | ^~~
Language: Java

import java.util.Scanner;

class BinaryConversion {
	public static long[] decimalToBinary(long num) {
		long[] a=new long[60];
		int i=a.length-1;
		while(num!=0) {
			a[i]=num%2;
			num/=2;
			i--;
		}
		return a;
	}
	public static long binaryToDecimal(long[] a) {
		long num=0;
		for (int i = 0; i < a.length; i++) {
			num+=(a[i]*Math.pow(2, a.length-1-i));
		}
		return num;
	}
}

public class XOR {
	public static long[] xor(long num1,long num2) {
		long[] a=BinaryConversion.decimalToBinary(num1);
		long[] b=BinaryConversion.decimalToBinary(num2);
		for (int i = 0; i < a.length; i++) {
			a[i]=(a[i]+b[i])%2;
		}
		return a;
	}
}

class Main {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        long[] num=new long[n];
        for(int i=0;i<n;i++) {
        	num[i]=sc.nextLong();
        }
        long sum=0;
        for (int i = 0; i < num.length-1; i++) {
			for (int j = i+1; j < num.length; j++) {
				long[] temp=XOR.xor(num[i], num[j]);
				sum+=BinaryConversion.binaryToDecimal(temp);
			}
		}
        sum%=(Math.pow(10, 9)+7);
        System.out.println(sum);
	}
}

Compiler output:
Main.java:23: error: class XOR is public, should be declared in a file named XOR.java
public class XOR {
       ^
1 error
Language: Java

import java.util.Scanner;

public class BinaryConversion {
	public static long[] decimalToBinary(long num) {
		long[] a=new long[60];
		int i=a.length-1;
		while(num!=0) {
			a[i]=num%2;
			num/=2;
			i--;
		}
		return a;
	}
	public static long binaryToDecimal(long[] a) {
		long num=0;
		for (int i = 0; i < a.length; i++) {
			num+=(a[i]*Math.pow(2, a.length-1-i));
		}
		return num;
	}
}

public class XOR {
	public static long[] xor(long num1,long num2) {
		long[] a=BinaryConversion.decimalToBinary(num1);
		long[] b=BinaryConversion.decimalToBinary(num2);
		for (int i = 0; i < a.length; i++) {
			a[i]=(a[i]+b[i])%2;
		}
		return a;
	}
}

public class Main {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        long[] num=new long[n];
        for(int i=0;i<n;i++) {
        	num[i]=sc.nextLong();
        }
        long sum=0;
        for (int i = 0; i < num.length-1; i++) {
			for (int j = i+1; j < num.length; j++) {
				long[] temp=XOR.xor(num[i], num[j]);
				sum+=BinaryConversion.binaryToDecimal(temp);
			}
		}
        sum%=(Math.pow(10, 9)+7);
        System.out.println(sum);
	}
}

Compiler output:
Main.java:3: error: class BinaryConversion is public, should be declared in a file named BinaryConversion.java
public class BinaryConversion {
       ^
Main.java:23: error: class XOR is public, should be declared in a file named XOR.java
public class XOR {
       ^
2 errors
Language: Java


import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Scanner;
import java.util.AbstractMap.SimpleEntry;
import java.util.HashSet;
import java.util.Iterator;

class Main {

    static final int MOD = 1000000007;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long[] A = new long[N];
        for (int i = 0; i < N; i++) {
            long num = sc.nextLong();
            A[i] = num;
        }
        int MK = 62;
        int[] dp = new int[MK];
        for (int k = 0; k < MK; k++) {
            long mask = 1l << k;
            for (int i = 0; i < N; i++) {
                if ((A[i] & mask) == 0l) {
                    dp[k]++;
                }
            }
        }
        long ans = 0;
        for (int k = 0; k < MK; k++) {
            long tmp = 1l << k;
            tmp %= MOD;
            tmp *= (dp[k] * (N - dp[k])) % MOD;
            tmp %= MOD;
            ans += tmp;
            ans %= MOD;
        }
        System.out.println(ans % MOD);
    }
}

Compiler output:
Main.java:21: error: incompatible types: possible lossy conversion from long to int
        long[] A = new long[N];
                            ^
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
long long mi=1000000009;
int main()
{
  long long n,sum=0;
  cin>>n;
  int a[n];
  for(int i=0;i<n;i++)
    cin>>a[i];
  for(int i=0;i<n-1;i++)
    for(int j=i+1;j<n;j++)
    {sum =(sum%mi (a[i]|a[j])%mi)%mi;
      }
  cout<<sum<<endl;
  return 0;
}
  
      
  

Compiler output:
a.cc: In function 'int main()':
a.cc:13:19: error: 'mi' cannot be used as a function
   13 |     {sum =(sum%mi (a[i]|a[j])%mi)%mi;
      |                ~~~^~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
long long mi=1000000009;
int main()
{
  long long n,sum=0;
  cin>>n;
  int ar[n];
  for(int i=0;i<n;i++)
    cin>>a[i];
  for(int i=0;i<n-1;i++)
    for(int j=i+1;j<n;j++)
    {sum += (a[i]|a[j])%mi;
       sum %=mi;}
  cout<<sum<<endl;
  return 0;
}
  
      
  

Compiler output:
a.cc: In function 'int main()':
a.cc:10:10: error: 'a' was not declared in this scope
   10 |     cin>>a[i];
      |          ^
a.cc:13:14: error: 'a' was not declared in this scope
   13 |     {sum += (a[i]|a[j])%mi;
      |              ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
long long mi=1000000009;
int main()
{
  long long n,sum=0;
  cin>>n;
  int ar[n];
  for(int i=0;i<n;i++)
    cin>>a[i];
  for(int i=0;i<n-1;i++)
    for(int j=i+1;j<n;j++)
    {sum += (a[i]|a[j])%mi;
       sum %=mi;}
  cout<<sum<<endl;
  return 0;
  
      
  

Compiler output:
a.cc: In function 'int main()':
a.cc:10:10: error: 'a' was not declared in this scope
   10 |     cin>>a[i];
      |          ^
a.cc:13:14: error: 'a' was not declared in this scope
   13 |     {sum += (a[i]|a[j])%mi;
      |              ^
a.cc:16:12: error: expected '}' at end of input
   16 |   return 0;
      |            ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int N;
  vector<int> v(N);
  cin >> N;
  int S = 0;
  int j = 1;
  int mod = 1000000007;
  for (int i = 0; i < N; i++)
  {
    cin >> v.at(i);
  }
  vector<int> Z(N);
  while (v != Z)
  {
    int m = 0;
    int n = 0;
    for (int i = 0; i < N; i++)
    {
      if (v.at(i) % 2 == 1)
      {
        m += 1;
      }
      else
      {
        n += 1;
      }
      v.at(i) /= 2
    }
    S += (m * n) * j;
    j *= 2
  }
  S %= mod;
  cout << S << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:19: error: expected ';' before '}' token
   30 |       v.at(i) /= 2
      |                   ^
      |                   ;
   31 |     }
      |     ~              
a.cc:33:11: error: expected ';' before '}' token
   33 |     j *= 2
      |           ^
      |           ;
   34 |   }
      |   ~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int N;
  vector<int> v(N);
  cin >> N;
  int S = 0;
  int j = 1;
  int mod = 1000000007;
  for (int i = 0; i < N)
  {
    cin >> v.at(i);
  }
  vector<int> Z(N);
  while (v != Z)
  {
    int m = 0;
    int n = 0;
    for (int i = 0; i < N; i++)
    {
      if (v.at(i) % 2 == 1)
      {
        m += 1;
      }
      else
      {
        n += 1;
      }
      v.at(i) /= 2
    }
    S += (m * n) * j;
    j *= 2
  }
  S %= mod;
  cout << S << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:24: error: expected ';' before ')' token
   11 |   for (int i = 0; i < N)
      |                        ^
      |                        ;
a.cc:30:19: error: expected ';' before '}' token
   30 |       v.at(i) /= 2
      |                   ^
      |                   ;
   31 |     }
      |     ~              
a.cc:33:11: error: expected ';' before '}' token
   33 |     j *= 2
      |           ^
      |           ;
   34 |   }
      |   ~
Language: Java

 class BinaryConversion {
	public static long[] decimalToBinary(long num) {
		long[] a=new long[60];
		int i=a.length-1;
		while(num!=0) {
			a[i]=num%2;
			num/=2;
			i--;
		}
		return a;
	}
	public static long binaryToDecimal(long[] a) {
		long num=0;
		for (int i = 0; i < a.length; i++) {
			num+=(a[i]*Math.pow(2, a.length-1-i));
		}
		return num;
	}
}

 class XOR {
	public static long[] xor(long num1,long num2) {
		long[] a=BinaryConversion.decimalToBinary(num1);
		long[] b=BinaryConversion.decimalToBinary(num2);
		for (int i = 0; i < a.length; i++) {
			a[i]=(a[i]+b[i])%2;
		}
		return a;
	}
}

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        long[] num=new long[n];
        for(int i=0;i<n;i++) {
        	num[i]=sc.nextLong();
        }
        long sum=0;
        for (int i = 0; i < num.length-1; i++) {
			for (int j = i+1; j < num.length; j++) {
				long[] temp=XOR.xor(num[i], num[j]);
				sum+=BinaryConversion.binaryToDecimal(temp);
			}
		}
        sum%=(Math.pow(10, 9)+7);
        System.out.println(sum);
	}
}


Compiler output:
Main.java:32: error: class, interface, enum, or record expected
import java.util.Scanner;
^
1 error
Language: C++

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

const int NRB = 60;
const int NMAX = 3e5 + 5;
const int MOD = 1e9 + 7;

int n;
int A[NMAX];
int P[NRB][NMAX];

void precalc() {
    for (int i = n; i >= 1; i--) {
        for (int bit = 0; bit < NRB; bit++) {
            P[bit][i] = P[bit][i + 1] + ((A[i] >> bit) & 1LL);
        }
    }
}

inline add(long long &x, long long a) {
    x = (x + a) % MOD;
}

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

    cin >> n;
    for (int i = 1; i <= n; i++)
        cin >> A[i];
    
    precalc();

    /*cout << P[0][n];
    return 0;*/

    long long ans = 0;
    for (int i = 1; i <= n; i++) {
        long long aici = 0;
        for (int bit = 0; bit < NRB; bit++) {
            if (A[i] & (1LL << bit)) {
                add(aici, (n - i - P[bit][i + 1]) * (1LL << bit));
            }
            else {
                add(aici, P[bit][i + 1] * (1LL << bit));
            }
        }

        add(ans, aici);
        //cout << aici << " ";
    }

    cout << ans;


    return 0;
}

Compiler output:
a.cc:21:8: error: ISO C++ forbids declaration of 'add' with no type [-fpermissive]
   21 | inline add(long long &x, long long a) {
      |        ^~~
a.cc: In function 'int add(long long int&, long long int)':
a.cc:23:1: warning: no return statement in function returning non-void [-Wreturn-type]
   23 | }
      | ^
Language: C++

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

int main() {
  	int mod = 1000000007;
    int n;
    cin >> n;
    vector<uint64_t> a(n)
  	rep(i,n) cin >> a[i];
    vector<uint64_t>cnt1(60,0);
    for(uint64_t a_i : a){
        int j = 0;
        while(a_i > 0){
            if(a_i%2 == 1) cnt1[j]++;
            a_i /= 2;
            j++;
        }
    }
    vector<uint64_t> ans(60);
    rep(i,60){
        uint64_t cnt1_i = cnt1[i];
        ans[i] = cnt1_i*(n-cnt1_i)%mod;
    }
    uint64_t ANS = 0;
    for(int i = 59; i >= 0; i--){
        ANS = (2*ANS+ans[i])%mod;
    }
    cout << ANS << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:19: error: expected ',' or ';' before 'for'
    3 | #define rep(i, n) for (int i = 0; i < (int)(n); i++)
      |                   ^~~
a.cc:10:9: note: in expansion of macro 'rep'
   10 |         rep(i,n) cin >> a[i];
      |         ^~~
a.cc:10:13: error: 'i' was not declared in this scope
   10 |         rep(i,n) cin >> a[i];
      |             ^
a.cc:3:35: note: in definition of macro 'rep'
    3 | #define rep(i, n) for (int i = 0; i < (int)(n); i++)
      |                                   ^
Language: C++

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

#define rep(i,n) for (int i = 0; i < (n); ++i)
typedef long long ll;

const long long MOD = 1000000007;

void solve(long long N, std::vector<long long> A){
    ll sum=0;
    rep(i,60)
        ll c=0,d=1;
        for(int j=i+1;j<N;j++){
              (A[j]&1)?c++:1;
              A[j]>>1;
        }
        sum=sum+(c*(N-c)*d)%MOD;
        d=2*d%MOD;
    }
    cout<<sum%MOD<<endl;
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long N;
    scanf("%lld",&N);
    std::vector<long long> A(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&A[i]);
    }
    solve(N, std::move(A));
    return 0;
}

Compiler output:
a.cc: In function 'void solve(long long int, std::vector<long long int>)':
a.cc:13:19: error: 'i' was not declared in this scope
   13 |         for(int j=i+1;j<N;j++){
      |                   ^
a.cc:14:24: error: 'c' was not declared in this scope
   14 |               (A[j]&1)?c++:1;
      |                        ^
a.cc:17:18: error: 'c' was not declared in this scope
   17 |         sum=sum+(c*(N-c)*d)%MOD;
      |                  ^
a.cc:17:26: error: 'd' was not declared in this scope
   17 |         sum=sum+(c*(N-c)*d)%MOD;
      |                          ^
a.cc: At global scope:
a.cc:20:5: error: 'cout' does not name a type
   20 |     cout<<sum%MOD<<endl;
      |     ^~~~
a.cc:21:1: error: expected declaration before '}' token
   21 | }
      | ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define rep(i, n) for(int i = 0; i < n; i++)
#define MOD 1000000007
typedef long long ll;


int main() {
    int n;
    cin >> n;
    vector<ll> a(n);
    rep(i, n){
        cin >> a[i];
    }
    int maxbit = log(*max_element(a.begin(), a.end())) / log(2) + 1; //sqrt(4) = 2 4 = 100 3bits
    maxbit = 60;
    ll ans = 0;
    rep(i, maxbit){
        ll bits[2] = {};
        rep(j, n){
            if(a[j] & (1LL << i)){ //i番目のbitが1
                bits[1]++;
            }else{
                bits[0]++;
            }
        }
        //ans = (ans % MOD + (1LL * (bits[1] * bits[0]) % MOD * ((1LL << i) % MOD)) % MOD) % MOD;
        //ans +=((1LL*bits[0]*bits[1])%MOD*(1LL << i)%MOD) % MOD;
        ans = (ans%MOD+(1LL*bits[0]*bits[1])%MOD*(1LL<<i)%MOD)%MOD
        //ans %= MOD;
        //cout << i+1 << ":" << bits[0] << " " << bits[1] <<  endl;
    }
    cout << ans%MOD << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:34:5: error: expected ';' before '}' token
   34 |     }
      |     ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
long long int p(long long int a, long long int b){
	long long int c = 1;
	for(int i = 0;i < b;i++){
		c *= a;
		c = c % 1000000007
	}
	return c;
}
int main(){
	long long int n;
	long long int a[300000];
	long long int a2, ans = 0;
	long long int b[60];
	for(int i = 0;i < 60;i++) b[i] = 0;
	cin >> n;
	for(int i = 0;i < n;i++){
		cin >> a[i];
		a2 = a[i];
		for(int j = 0;j < 60;j++){
			if(a2 % 2){
				b[j]++;
			}
			a2 /= 2;
		}
	}
	for(int i = 0;i < 60;i++){
		ans += (b[i] * (n - b[i]) * p(2, i));
		ans %= 1000000007
	}
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'long long int p(long long int, long long int)':
a.cc:7:35: error: expected ';' before '}' token
    7 |                 c = c % 1000000007
      |                                   ^
      |                                   ;
    8 |         }
      |         ~                          
a.cc: In function 'int main()':
a.cc:30:34: error: expected ';' before '}' token
   30 |                 ans %= 1000000007
      |                                  ^
      |                                  ;
   31 |         }
      |         ~