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

#include <bits/stdc++.h>
using namespace std;
#define int long long
const long long MOD = 1e9+7;
const long long B = 61;

signed main() {
    int N;
    cin >> N;
    vector<long long> A(N);
    for (int i = 0; i < N; i++) {
        cin >> A[i];
    }
    vector<vector<bool>> bit(N, vector<bool>(B));
    for (long long i = 0; i < N; i++) {
        for (long long j = 0; j < B; j++) {
            bit[i][j] = (A[i]&(1LL<<j));
        }
    }
    
    long long ans = 0;
    long long two = 1;
    for (int j = 0; j < B; j++) {
        int one = 0, zero = 0;
        for (int i = 0; i < N; i++) {
            if (bit[i][j]) one++;
            else zero++;
        }
        /*
        if (j == 33) cout << one << " " << zero << endl;
        cout << j << "bit is " << ans << endl;
        */
        long long res = ((two * one)%MOD) * zero) % MOD;
        ans += res;
        ans %= MOD;
        two *= 2LL;
        two %= MOD;
    }
    
    cout << ans%MOD << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:49: error: expected ',' or ';' before ')' token
   33 |         long long res = ((two * one)%MOD) * zero) % MOD;
      |                                                 ^
Language: C++

#include <iostream>
#include <vector>

using namespace std;
constexpr int64_t MOD = 1'000'000'007;

int main(void) {
	ios::sync_with_stdio(false);
	cin.tie(0);

    int64_t N;
    cin >> N;
    vector<int64_t> num(60);
    for(int i=0; i<N; i++) {
        int64_t A;
        cin >> A;
        for(int j=0; j<60; j++) {
            if(A & (1LL << j)) {
                ++num[j];
            }
        }
    }

    int64_t ans = 0;
    for(int j=0; j<60; j++) {
        ans += (((((1LL << j) % MOD * num[j]) % MOD) * (N-num[j]) % MOD);
    }

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


Compiler output:
a.cc: In function 'int main()':
a.cc:26:73: error: expected ')' before ';' token
   26 |         ans += (((((1LL << j) % MOD * num[j]) % MOD) * (N-num[j]) % MOD);
      |                ~                                                        ^
      |                                                                         )
Language: C++

#include <algorithm>
#include <string.h>
#include <iostream>
#include <math.h>
#include <stdio.h>
using namespace std;
typedef long long int ll;
const int mod = 1e9 + 7;
const int N = 3e5 + 10;
ll x[N], p[64], sum1[N], sum0[N];
int main()
{
    p[0] = 1;
    for (int i = 1; i < 63; i++)
        p[i] = (p[i - 1] * 2ll;
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++)
        cin >> x[i];
    ll ans = 0;
    for (int i = 0; i <63; i++)
    {
            memset(sum1, 0, sizeof(sum1));
            memset(sum0, 0, sizeof(sum0));
            for (int j = n; j >= 1; j--)
            {
                sum1[j] = sum1[j + 1];
                sum0[j] = sum0[j + 1];
                if ((x[j] >> i) & 1)
                    sum1[j]++;
                else
                    sum0[j]++;
                if ((x[j] >> i) & 1)
                {
                    ll temp = (sum0[j + 1] % mod * p[i] % mod) % mod;
                    ans = (ans % mod + temp % mod) % mod;
                }
                else
                {
                    ll temp = (sum1[j + 1] % mod * p[i] % mod) % mod;
                    ans = (ans % mod + temp % mod) % mod;
                }
            }
    }
    cout << ans % mod << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:31: error: expected ')' before ';' token
   15 |         p[i] = (p[i - 1] * 2ll;
      |                ~              ^
      |                               )
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i,s,n) for(int i = s; i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
#define ATYN(n) cout << ( (n) ? "Yes":"No") << endl;
#define CFYN(n) cout << ( (n) ? "YES":"NO") << endl;
#define OUT(n) cout << (n) << endl;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
constexpr int MOD = 1000000007;

int mod(const ll &x){
    return x > 0 ? x % MOD : (x+MOD) % MOD;
}

int modm(const ll &x,const ll &m){
    return x * m % MOD;
}

int modpow(ll x, ll p) {
    int ret = 1;
    while(p > 0) {
        if (p & 1) ret = modm(ret,x);
        x = modm(x,x);
        p >>= 1;
    }
    return ret;
}

// x * modinv(d)
int modd(ll x,ll d) {
    return modm(x,modpow(d,MOD-2));
}

int main(void)
{
    IOS
    constexpr int N = 62;
    int n; cin >> n;
    vector<bitset<N>> v;
    vector<int> c1(N) , c0(N);
    REP(i,n) {
        ll x;
        cin >> x;
        v.push_back(bitset<N>(x));
        REP(j,N) {
            if(v[i][j]) c1[j]++;
            else c[0]++;
        }
    }

    int ans = 0;
    REP(i,n-1) {
        REP(j,N) {
            if(v[i][j]) c1[j]--;
            else c0[j]--;
        }
        bitset<N> bs(v[i]);
        ll tmp = 0;
        REP(j,N) {
            if (bs[j]) tmp = mod(tmp + modm(mod(1LL << j),c0[j]));
            else tmp = mod(tmp + modm(mod(1LL << j),c1[j]));
        }
        ans = mod(ans + tmp);
    }

    cout << ans << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:52:18: error: 'c' was not declared in this scope
   52 |             else c[0]++;
      |                  ^
Language: C++


#include<iostream>
#include<iomanip>
#include<vector>
#include<map>
#include<set>
#include<algorithm>
#include<numeric>
#include<limits>
#include<bitset>
#include<functional>
#include<type_traits>
#include<queue>
#include<stack>
#include<array>
#include<random>
#include<utility>
#include<cstdlib>
#include<ctime>


using namespace std;

using ll = long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const double PI = acos(-1.0);
#define YES(n) cout << ((n) ? "YES" : "NO") << endl;
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl;
#define all(v) v.begin(), v.end()
const long MOD = pow(10, 9) + 7;

char alfa[] = { 'A','B' ,'C','D' ,'E' ,'F' ,'G' ,'H' ,'I' ,'J' ,'K' ,'L' ,'M' ,'N' ,'O' ,'P' ,'Q' ,'R' ,'S' ,'T' ,'U' ,'V' ,'W' ,'X' ,'Y','Z' };

inline void finish() {
	cout << -1 << endl;
	exit(0);
}

unsigned GetDigit(unsigned num) {
	return log10(num) + 1;
}

class Mod {
public:
	static inline ll Add(ll a, ll b) {
		return (a + b) % MOD;
	}

	static inline ll Sub(ll a, ll b) {
		ll ans = (a - b) % MOD;
		return (ans < 0) ? (ans + MOD) : ans;
	}

	static inline ll Mul(ll a, ll b) {
		return (a * b) % MOD;
	}

	static inline ll Div(ll a, ll b) {
		return (a % MOD) * modinv(b, MOD) % MOD;
	}
};
ll modinv(ll a, ll m) {
	ll b = m, u = 1, v = 0;
	while (b) {
		ll t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}

template <typename T>
inline void debug(vector<T> v) {
	cout << "[";
	for (ll i = 0; i < v.size() - 1; ++i) {
		cout << v[i] << ", ";
	}
	cout << v[v.size() - 1] << "]" << endl;
}

void Main();
inline void DebugMain() {
	while (true) {
		Main();
	}
}

int main() {
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);

	bool debug = false;
	if (debug) {
		cout << "\x1b[41m" << "Debug Mode " << endl;
	}
	(debug) ? DebugMain() : Main();
	return 0;
}

class man
{
public:
	int A;
	vector<pii> X;
	bool HeIsTrue;
private:
	
};

inline void Main() {
		ll X, Y, N;
		vector<ll> A;
		ll M1, D1, M2, D2;
		ll ans;
		ll sum=0,count =0;
		string S;
		string S2;
		int b[60];
		bool flag = false;
	
		cin >> N;
		
		for (int i = 0; i < 60; i++) {
			b[i] = 0;
		}

		for (int i = 0; i < N; i++) {
			cin >> X;
			for (int j = 0; j <60; j++) {
				if(X & (ll)1<<j) {
					b[j]++;
				}
			}
		}



		for (int i = 0; i < 60; i++) {
			sum = (sum + (((N - b[i]) * (b[i])) * (ll)pow(2, i))) % MOD;
		}
		cout << sum;
}



Compiler output:
a.cc: In static member function 'static ll Mod::Div(ll, ll)':
a.cc:61:36: error: 'modinv' was not declared in this scope
   61 |                 return (a % MOD) * modinv(b, MOD) % MOD;
      |                                    ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
  int n,i,j;
  long long s=0;
  cin>>n;
  int a[n];
  for(i=0;i<n;i++)
  {
    cin>>a[i]
  }
  for(i=0;i<n-1;i++)
  {
    for(j=i+1;j<n;j++)
    {
      s=s+a[i]^a[j];
    }
  }
  cout<<s;
  
}

    

Compiler output:
a.cc: In function 'int main()':
a.cc:11:14: error: expected ';' before '}' token
   11 |     cin>>a[i]
      |              ^
      |              ;
   12 |   }
      |   ~
Language: C++

#include<bits/stdc++.h>

using namespace std;

long long const mod = 1000000007ll;

int main(){
  int N;
  cin >> N;
  
  vector<int> d(60, 0);
  vector<long long> A(N);
  
  for(int i = 0; i < N; i++){
    cin >> A[i];
    for(int j = 0; j < 60; j++){
      if(A[i] & (1ll << j)) d[j]++;
    }
  }
  
  long long sum = 0ll;
  for(int i = 0; i < N; i++){
    long long k = 1ll;
    for(int j = 0; j < 60; j++){
      if(A[i] & (1ll << j)){
        sum += k * (long long)(N - i - d[j]);
        d[j]--;
      }else{
        sum += k * (long long)d[j];
      }
      k *= 2;
    }
  }
  
  cout << sum % << endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:17: error: expected primary-expression before '<<' token
   35 |   cout << sum % << endl;
      |                 ^~
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (n); i++)
#define RREP(i, n) for (int i = (n); i >= 0; i--)
#define FOR(i, m, n) for (int i = (m); i < (n); i++)
#define ALL(obj) begin(obj), end(obj)
using namespace std;
using ll = unsinged long long;
const int MOD = 1e9 + 7;
int main() {
    ll N;
    vector<ll> A;
    cin >> N;
    REP(i, N) {
        ll a;
        cin >> a;
        A.push_back(a);
    }

    ll ans;
    REP(i, 63) {
        ll zc, oc;
        zc = oc = 0;
        REP(j, N) {
            if (A[j] % 2 == 0) {
                zc++;
            } else {
                oc++;
            }
            A[j] /= 2;
        }
        ans = (ans + ((zc * oc) << i) % MOD) % MOD;
    }

    cout << ans << endl;

    return 0;
}


Compiler output:
a.cc:7:12: error: 'unsinged' does not name a type; did you mean 'unsigned'?
    7 | using ll = unsinged long long;
      |            ^~~~~~~~
      |            unsigned
a.cc: In function 'int main()':
a.cc:10:5: error: 'll' was not declared in this scope
   10 |     ll N;
      |     ^~
a.cc:11:14: error: template argument 2 is invalid
   11 |     vector<ll> A;
      |              ^
a.cc:12:12: error: 'N' was not declared in this scope
   12 |     cin >> N;
      |            ^
a.cc:14:11: error: expected ';' before 'a'
   14 |         ll a;
      |           ^~
      |           ;
a.cc:15:16: error: 'a' was not declared in this scope
   15 |         cin >> a;
      |                ^
a.cc:16:11: error: request for member 'push_back' in 'A', which is of non-class type 'int'
   16 |         A.push_back(a);
      |           ^~~~~~~~~
a.cc:19:7: error: expected ';' before 'ans'
   19 |     ll ans;
      |       ^~~~
      |       ;
a.cc:21:11: error: expected ';' before 'zc'
   21 |         ll zc, oc;
      |           ^~~
      |           ;
a.cc:22:9: error: 'zc' was not declared in this scope
   22 |         zc = oc = 0;
      |         ^~
a.cc:22:14: error: 'oc' was not declared in this scope
   22 |         zc = oc = 0;
      |              ^~
a.cc:24:18: error: invalid types 'int[int]' for array subscript
   24 |             if (A[j] % 2 == 0) {
      |                  ^
a.cc:29:14: error: invalid types 'int[int]' for array subscript
   29 |             A[j] /= 2;
      |              ^
a.cc:31:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   31 |         ans = (ans + ((zc * oc) << i) % MOD) % MOD;
      |         ^~~
      |         abs
a.cc:34:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   34 |     cout << ans << endl;
      |             ^~~
      |             abs
Language: C++

#include <iostream>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
#include <limits>
#include <ios>
#include <iomanip>
#include <stdio.h>
#include <iomanip>
#include <queue>
#include <set>
using namespace std;

#define rep(i,N) for(int (i)=0; (i)<(N); (i)++)
#define revrep(i,N) for(int (i)=(N)-1; (i)>=0; (i)--)
#define dump(vec) for(int i = 0; i < (vec).size(); i++){cout << vec.at(i) << ",";}cout << endl

typedef long long ll;

int main(void)
{
    int N = 0;
    cin >> N;
    vector<ll> A(N);
    rep(i,N) {
        cin >> A.at(i);
    }

    vector<ll> keta(101,0);
    rep(k,61){
        ll s = 0;
        ll t = 0;
        rep(i,N) {
            if (((A.at(i) >> k )& 0x01) == 1) {
                t++;
            } else {
                s++;
            }
        }
        ll u = s*t;a
        keta.at(k) = u;
    }
    //dump(keta);

    rep(k,keta.size()-1){
        keta.at(k+1) += (keta.at(k)/2);
        if(keta.at(k) % 2 == 1) {
            keta.at(k) = 1;
        } else {
            keta.at(k) = 0;
        };
    }

    //dump(keta);

    ll ret = 0;
    rep(k,keta.size()){
        if (keta.at(k)) {
            ll temp = 1;
            rep(i,k){
                temp *= 2;
                temp %= (1000000000+7);
            }
            ret += temp;
            ret %= (1000000000+7);
        }        
    }

    cout << ret << endl;
    

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:42:20: error: 'a' was not declared in this scope
   42 |         ll u = s*t;a
      |                    ^
Language: C++

v#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007

int main()
{
  int n;cin>>n;
  vector<long long> a(n);
  int i,j;
  for(i=0;i<n;i++)cin>>a.at(i);
  vector<long long> sum1(60,0);
  long long ans=0;
  for(i=0;i<60;i++)
  {
    for(j=0;j<n;j++)
    {
      if(((long long)1<<i)&a.at(j))sum1.at(i)++;
    }
  }
  long long ks=1;
  for(i=0;i<60;i++)
  {
    ans=(ans+sum1.at(i)*(n-sum1.at(i))*ks)%MOD;
    ks=(ks*2)%MOD;
  }
  cout<<ans%MOD<<endl;
}


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: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope
    7 |   int n;cin>>n;
      |         ^~~
a.cc:8:3: error: 'vector' was not declared in this scope
    8 |   vector<long long> a(n);
      |   ^~~~~~
a.cc:8:10: error: expected primary-expression before 'long'
    8 |   vector<long long> a(n);
      |          ^~~~
a.cc:10:24: error: 'a' was not declared in this scope
   10 |   for(i=0;i<n;i++)cin>>a.at(i);
      |                        ^
a.cc:11:10: error: expected primary-expression before 'long'
   11 |   vector<long long> sum1(60,0);
      |          ^~~~
a.cc:17:28: error: 'a' was not declared in this scope
   17 |       if(((long long)1<<i)&a.at(j))sum1.at(i)++;
      |                            ^
a.cc:17:36: error: 'sum1' was not declared in this scope
   17 |       if(((long long)1<<i)&a.at(j))sum1.at(i)++;
      |                                    ^~~~
a.cc:23:14: error: 'sum1' was not declared in this scope
   23 |     ans=(ans+sum1.at(i)*(n-sum1.at(i))*ks)%MOD;
      |              ^~~~
a.cc:26:3: error: 'cout' was not declared in this scope
   26 |   cout<<ans%MOD<<endl;
      |   ^~~~
a.cc:26:18: error: 'endl' was not declared in this scope
   26 |   cout<<ans%MOD<<endl;
      |                  ^~~~
Language: C++

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

const long long INF = 1e9+7;

int main() {
	int n;
	cin >> n;
	vector<bitset<60>> a(n);
	for(int i=0; i<n; i++){
		long tmp;
		cin >> tmp;
		bitset<60> data(tmp);
        a.at(i) = data;
	}
	long long ans;
	vector<long> num(60);
	for(int i=0; i<60; i++){
		int tmp=0;
		for(int j=0; j<n; j++){
			if(a.at(j).test(i)) tmp++;
		}
		num.at(i) = tmp;
	}
	for(int i=0; i<60; i++){
		long long mul1 = num.at(i)*(n-num.at(i))%INF;
		long long mul2 = pow(2, i) %INF;
		ans += mul1*mul2;
        ans %= INF;
	}
    cout << ans << endl;
}


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

#include <iostream>
#include <algorithm>
#include <cmath>
#include <queue>
#include <set>
#include <vector>
#include <string>
using namespace std;

#pragma GCC optimize("O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)
#pragma comment(linker, "/stack:200000000")
//(UNCOMMENT WHEN TRYING TO BRUTEFORCE WITH A LOT OF LOOPS)
#pragma GCC optimize("unroll-loops")

#define DEBUG(x) cout << ">> " << #x << ": " << x << endl;
#define _ ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
const ll MOD = 1000000007;
typedef long long ll;
typedef long double ld;

int main() { _
  ll n; cin >> n;
  vector<ll> v(n);
  ll total = 0;
  for (ll i = 0; i < n; i++) {
    cin >> v[i];
  }
  for (ll i = 0; i < 64; i++) {
    ll oc=0, zc=0;
    for (ll j = 0; j < n; j++) {
      if (v[j]&1) oc++;
      else zc++;
      v[j] >>= 1;
    }
    ll ibsum = ((oc*zc)%MOD) * ((1<<i)%MOD);
    total += ibsum%MOD;
    total %= MOD;
  }
  cout << total << endl;
  return 0;
}

Compiler output:
a.cc:19:7: error: 'll' does not name a type
   19 | const ll MOD = 1000000007;
      |       ^~
a.cc: In function 'int main()':
a.cc:37:25: error: 'MOD' was not declared in this scope
   37 |     ll ibsum = ((oc*zc)%MOD) * ((1<<i)%MOD);
      |                         ^~~
Language: C++

/*
    Author:zeke
    
    pass System Test!
    GET AC!!
*/
#include <iostream>
#include <queue>
#include <vector>
#include <iostream>
#include <vector>
#include <string>
#include <cassert>
#include <algorithm>
#include <functional>
#include <cmath>
#include <queue>
#include <set>
#include <stack>
#include <deque>
#include <map>
#include <iomanip>
#include <utility>
#include <stack>
#include <bitset>
using ll = long long;
using ld = long double;
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define rep3(var, min, max) for (ll(var) = (min); (var) < (max); ++(var))
#define repi3(var, min, max) for (ll(var) = (max)-1; (var) + 1 > (min); --(var))
#define Mp(a, b) make_pair((a), (b))
#define F first
#define S second
#define Icin(s) \
    ll(s);      \
    cin >> (s);
#define Scin(s) \
    ll(s);      \
    cin >> (s);
template <class T>
bool chmax(T &a, const T &b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T &a, const T &b)
{
    if (b < a)
    {
        a = b;
        return 1;
    }
    return 0;
}
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef vector<V> VV;
typedef vector<P> VP;
ll mod = 1e9 + 7;
unsigned long long MOD = 1e9 + 7;
ll INF = 1e18;
long long modMult(long long a, long long b, long long m)
{
    long long res = 0;
    long long exp = a % m;
    while (b)
    {
        if (b & 1)
        {
            res += exp;
            if (res > m)
                res -= m;
        }
        exp <<= 1;
        if (exp > m)
            exp -= m;
        b >>= 1;
    }
    return res;
}
long long powMod(long long a, long long b, long long m)
{
    long long res = 1;
    long long exp = a % m;
    while (b)
    {
        if (b & 1)
            res = modMult(res, exp, m);
        exp = modMult(exp, exp, m);
        b >>= 1;
    }
    return res;
}
//powMod(a,b,MOD)
//O(log(b))?
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n;
    cin >> n;
    vector<ll> vec(n);
    vector<ll> reg(100,0);
    rep(i, n) {
        cin >> vec[i];
    }
    rep(i, n)
    {
        for(ll j=61;j>=0;j--)
        {
            if(pow(2,j)<=vec[i]){
                reg[j]++;
                vec[i]-=pow(2,j);
            }
        }
    }
    ll res=0;
    ll g=1;
    rep(i, 62)
    {
        ll k=g;
        ll f=reg[i]*(n-reg[i]);
        f%=MOD;
        ll p=k*f%=MOD;
        res += p;
        res %= MOD;
        g*=2;
        g%=MOD;
    }
    cout << res%MOD << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:131:15: error: lvalue required as left operand of assignment
  131 |         ll p=k*f%=MOD;
      |              ~^~
Language: C++

#include <bits/stdc++.h> 
using namespace std; 
typedef long long int ll;
// Returns sum of bitwise OR 
// of all pairs 
ll sumXOR(ll arr[], ll n) 
{ 
    ll sum = 0; 
    for (ll i = 0; i < 32; i++)  
    { 
        //  Count of zeros and ones 
        ll zc = 0, oc = 0;  
          
        // Individual sum at each bit position 
        ll idsum = 0;  
        for (ll j = 0; j < n; j++) 
        { 
            if (arr[j] % 2 == 0) 
                zc++; 
            else
                oc++; 
            arr[j] /= 2; 
        } 
          
        // calculating individual bit sum  
        idsum = oc * zc * (1 << i);  
  
        // final sum     
        sum += idsum;
        sum%=1000000007;
    } 
    return sum; 
} 
  
int main() 
{ 
    ll sum = 0; 
    ll a;
    cin>>a;
    int arr[a];
    for(ll i=0;i<a;i++){
      cin>>arr[i];
    }
    int n = sizeof(arr) / sizeof(arr[0]); 
    sum = sumXOR(arr, n); 
    cout<<sum<<endl; 

} 

Compiler output:
a.cc: In function 'int main()':
a.cc:45:18: error: cannot convert 'int*' to 'll*' {aka 'long long int*'}
   45 |     sum = sumXOR(arr, n);
      |                  ^~~
      |                  |
      |                  int*
a.cc:6:14: note:   initializing argument 1 of 'll sumXOR(ll*, ll)'
    6 | ll sumXOR(ll arr[], ll n)
      |           ~~~^~~~~
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < (ll)n; i++)
#define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF (1ll << 60)
#define sz(x) int(x.size())
using namespace std;
typedef long long ll;
using vl = vector<ll>;
using vvl = vector<vl>;
typedef double db;
typedef string str;
typedef pair<ll, ll> p;
constexpr int MOD = 1000000007;
using ll = long long;
template <class T> inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

void print(const std::vector<int> &v) {
    std::for_each(v.begin(), v.end(), [](int x) { std::cout << x << " "; });
    std::cout << std::endl;
}

ll modpow(ll a, ll p) {
    if(p == 0)
        return 1;
    if(p % 2 == 0) {
        ll halfp = p / 2;
        ll half = modpow(a, halfp);
        return half * half % MOD;
    } else {
        return a * modpow(a, p - 1) % MOD;
    }
}

long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while(b) {
        long long t = a / b;
        a -= t * b;
        swap(a, b);
        u -= t * v;
        swap(u, v);
    }
    u %= m;
    if(u < 0)
        u += m;
    return u;
}

int main() {
    ll N;
    cin >> N;
    vector<ll> A(N);
    map<ll, ll> cnt;
    REP(i, N) {
        cin >> A[i];
        REP(j, 61) {
            if(!(A[i] & (1LL << j))) {
                cnt[j]++;
            }
        }
    };

    ll ans = 0LL;
    REP(j, 61) {
      ll tmp = cnt[j] * (N - cnt[j]) % mod;
        ans += tmp * modpow(2LL, j);
        ans %= MOD;
    }

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


Compiler output:
a.cc: In function 'int main()':
a.cc:79:40: error: 'mod' was not declared in this scope; did you mean 'modf'?
   79 |       ll tmp = cnt[j] * (N - cnt[j]) % mod;
      |                                        ^~~
      |                                        modf
Language: C++

#include <bits/stdc++.h>     
 
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define ll long long
#define int ll
#define forn(i, a, b) for(int i = (a); i <= (b); ++i)
#define forev(i, b, a) for(int i = (b); i >= (a); --i)
#define VAR(v, i) __typeof( i) v=(i)
#define forit(i, c) for(VAR(i, (c).begin()); i != (c).end(); ++i)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#define file(s) freopen(s".in","r",stdin); freopen(s".out","w",stdout);
 
using namespace std;
 
const int maxn = (int)2e5 + 100;
const int mod = (int)1e9 + 7;
 
#define inf mod
 
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;   
typedef vector<ll> Vll;               
typedef vector<pair<int, int> > vpii;
typedef vector<pair<ll, ll> > vpll;

int n, x, cnt[70][2], ans;
main () {
	scanf("%lld", &n);
	forn(i, 1, n){
		scanf("%lld", &x);
		a[i] = x;
		forn(i, 0, 60){
			int b = (x >> i) & 1;
			ans = (ans + (1ll << i) % mod * 1ll * cnt[i][b ^ 1] % mod) % mod;
			cnt[i][b]++;
		}
	}
	printf("%lld\n", ans);
}

Compiler output:
a.cc:33:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   33 | main () {
      | ^~~~
a.cc: In function 'int main()':
a.cc:37:17: error: 'a' was not declared in this scope
   37 |                 a[i] = x;
      |                 ^
Language: C++

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

const long long INF = 1e9+7;

int main() {
	int n;
	cin >> n;
	vector<bitset<60>> a(n);
	for(int i=0; i<n; i++){
		long tmp;
		cin >> tmp;
		bitset<60> data(tmp);
        a.at(i) = data;
	}
	long long ans;
	vector<long> num(60);
	for(int i=0; i<60; i++){
		int tmp=0;
		for(int j=0; j<n; j++){
			if(a.at(j).test(i)) tmp++;
		}
		num.at(i) = tmp;
	}
	for(int i=0; i<60; i++){
		ans += pow(2, i)*num.at(i)*(n-num.at(i))%INF;
	}
	cout << ans%INF <<endl;

}



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

import numpy as np
def sumXOR( arr,  n): 
      
    sum = 0
    for i in range(0, 62): 
  
        #  Count of zeros and ones 
        zc = 0
        oc = 0
           
        # Individual sum at each bit position 
        idsum = 0
        for j in range(0, n): 
            if (arr[j] % 2 == 0): 
                zc = zc + 1
                  
            else: 
                oc = oc + 1
            arr[j] = int(arr[j] / 2) 
          
           
        # calculating individual bit sum  
        idsum = oc * zc * (1 << i) 
   
        # final sum     
        sum = sum + idsum;  
      
    return sum
n = int(input())
arr = np.array([int(a) for a in input().split()])
ans = sumXOR(arr,n)
print(ans%mod)

Compiler output:
a.cc:7:12: error: invalid preprocessing directive #Count
    7 |         #  Count of zeros and ones
      |            ^~~~~
a.cc:11:11: error: invalid preprocessing directive #Individual
   11 |         # Individual sum at each bit position
      |           ^~~~~~~~~~
a.cc:22:11: error: invalid preprocessing directive #calculating
   22 |         # calculating individual bit sum
      |           ^~~~~~~~~~~
a.cc:25:11: error: invalid preprocessing directive #final
   25 |         # final sum
      |           ^~~~~
a.cc:1:1: error: 'import' does not name a type
    1 | import numpy as np
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:28:5: error: expected unqualified-id before 'return'
   28 |     return sum
      |     ^~~~~~
Language: C++

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

int main() {
  int64_t r = 0;
  int n, k = 0;
  cin >> n;
  vector<string> v(n);
  for(int i = 0; i < n; ++i){
    int64_t a, c = 0;
    string b = "";
    cin >> a;
    while(a > 0){
      if(a % 2 == 0) b += '0';
      else b += '1';
      a /= 2;
      ++c;
    }
    v.at(i) = b;
    k = max(k, c);
  }
  vector<int> c1(k, 0);
  for(int i = 0; i < k; ++i){
    for(int j = 0; j < n; ++j){
      if(v.at(j).size() > i && v.at(j).at(i) == '1') ++c1.at(i);
    }
  }
  for(int i = 0; i < k; ++i){
    int64_t ri = c1.at(i) * (n - c1.at(i));
    ri %= 1000000007;
    for(int j = 0; j < i; ++j){
      ri *= 2;
      ri %= 1000000007;
    }
    r += ri;
    r %= 1000000007;
  }
  cout << r << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:12: error: no matching function for call to 'max(int&, int64_t&)'
   20 |     k = max(k, c);
      |         ~~~^~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:20:12: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'int64_t' {aka 'long int'})
   20 |     k = max(k, c);
      |         ~~~^~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:20:12: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   20 |     k = max(k, c);
      |         ~~~^~~~~~
Language: C++

#include <bits/stdc++.h>

#define REP(type, i, a, b) for( type i = a; i < b; i++ )
typedef long long ll;
#define MODNUM 1000000007;

using namespace std;

int main (void) {
    ll N, ans;
    scanf("%lld", &N);
    ll A;
    vector<ll> OneC(60),ZeroC(60);
    REP(int,i,0,60){
        OneC.at(i) = 0;
        ZeroC.at(i) = 0;
    }
    REP(int,i,0,N){
        scanf("%lld", &A);
        REP(int,j,0,60){
            if ( A % 2 ) OneC.at(j)++;
            else ZeroC.at(j)++;
            A /= 2;
        }
    }
    ans = 0;
    REP(int,j,0,60){
        ans += ( pow(2, j) % MODNUM ) * ( OneC.at(j) % MODNUM ) * ( ZeroC.at(j) % MODNUM );
        ans = ans % MODNUM;
    }
    printf("%lld\n", ans);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:28: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%'
   28 |         ans += ( pow(2, j) % MODNUM ) * ( OneC.at(j) % MODNUM ) * ( ZeroC.at(j) % MODNUM );
      |                  ~~~~~~~~~ ^
      |                     |
      |                     __gnu_cxx::__promote<double>::__type {aka double}
a.cc:5:26: error: expected ')' before ';' token
    5 | #define MODNUM 1000000007;
      |                          ^
a.cc:28:30: note: in expansion of macro 'MODNUM'
   28 |         ans += ( pow(2, j) % MODNUM ) * ( OneC.at(j) % MODNUM ) * ( ZeroC.at(j) % MODNUM );
      |                              ^~~~~~
a.cc:28:16: note: to match this '('
   28 |         ans += ( pow(2, j) % MODNUM ) * ( OneC.at(j) % MODNUM ) * ( ZeroC.at(j) % MODNUM );
      |                ^
a.cc:28:37: error: expected primary-expression before ')' token
   28 |         ans += ( pow(2, j) % MODNUM ) * ( OneC.at(j) % MODNUM ) * ( ZeroC.at(j) % MODNUM );
      |                                     ^
a.cc:28:63: error: expected primary-expression before ')' token
   28 |         ans += ( pow(2, j) % MODNUM ) * ( OneC.at(j) % MODNUM ) * ( ZeroC.at(j) % MODNUM );
      |                                                               ^
a.cc:28:90: error: expected primary-expression before ')' token
   28 |         ans += ( pow(2, j) % MODNUM ) * ( OneC.at(j) % MODNUM ) * ( ZeroC.at(j) % MODNUM );
      |                                                                                          ^
Language: C++

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

const int mod = 1000000007;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const {
    return pow(mod-2);
  }
  mint& operator/=(const mint a) {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const {
    mint res(*this);
    return res/=a;
  }
};

mint po(mint a,int b){
    mint ans=1;
    rep(i,b){
        ans*=a;
    }
    return ans;
}

int main(){
int n; cin >> n;
mint ad=0; int jou=0;
int f=1; int s=1;
vector<vector<ll>> a(n,vector<ll>(61));
vector<ll> len(n);
  rep(i,n){
    ll p; ll lee=0;
    cin >> p;
    int g=0;
    while(p!=0){
    if(p%2) a[i][g]=1;
    else a[i][g]=0;
    lee++;
    g++;
    p/=2;
    }
    len[i]=lee;
  }

vector<ll> zero(61,0); vector<ll> one(61,0);
rep(j,61)
    rep(i,n){
        if(a[j][i]==1) one[j]++;
        else zero[j]++;
    }
}

int y=0;
/*rep(i,n){
        while(ju){
     	   if(a[i][y]==0){
            ad+=po(2,y)*one[y];
            }
            else{
            ad+=po(2,y)*zero[y];
            }
        }
        y++;
        ju--;
        }
      y=0;
    }
}*/
rep(i,61){
    ad+=zero[i]*one[i];
}
cout << ad.x/2 << endl;
return 0;
}


Compiler output:
a.cc:2:18: error: expected unqualified-id before 'for'
    2 | #define rep(i,n) for(int i=0; i<n; i++)
      |                  ^~~
a.cc:108:1: note: in expansion of macro 'rep'
  108 | rep(i,61){
      | ^~~
a.cc:108:5: error: 'i' does not name a type
  108 | rep(i,61){
      |     ^
a.cc:2:31: note: in definition of macro 'rep'
    2 | #define rep(i,n) for(int i=0; i<n; i++)
      |                               ^
a.cc:108:5: error: 'i' does not name a type
  108 | rep(i,61){
      |     ^
a.cc:2:36: note: in definition of macro 'rep'
    2 | #define rep(i,n) for(int i=0; i<n; i++)
      |                                    ^
a.cc:111:1: error: 'cout' does not name a type
  111 | cout << ad.x/2 << endl;
      | ^~~~
a.cc:112:1: error: expected unqualified-id before 'return'
  112 | return 0;
      | ^~~~~~
a.cc:113:1: error: expected declaration before '}' token
  113 | }
      | ^
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < (ll)n; i++)
#define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF (1ll << 60)
#define sz(x) int(x.size())
using namespace std;
typedef long long ll;
using vl = vector<ll>;
using vvl = vector<vl>;
typedef double db;
typedef string str;
typedef pair<ll, ll> p;
constexpr int MOD = 1000000007;
using ll = long long;
template <class T> inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

void print(const std::vector<int> &v) {
    std::for_each(v.begin(), v.end(), [](int x) { std::cout << x << " "; });
    std::cout << std::endl;
}

ll modpow(ll a, ll p) {
    if(p == 0)
        return 1;
    if(p % 2 == 0) {
        ll halfp = p / 2;
        ll half = modpow(a, halfp);
        return half * half % MOD;
    } else {
        return a * modpow(a, p - 1) % MOD;
    }
}

int main() {
    ll N;
    cin >> N;
    vector<ll> A(N);
    map<ll, ll> cnt;
    REP(i, N) {
        cin >> A[i];
        REP(j, 61) {
            if(!(A[i] & (1LL << j))) {
                cnt[j]++;
            }
        }
    };
    ll ans = 0LL;
    REP(i, N) {
        REP(j, 61) {
            if(A[i] & (1LL << j)) {
                // flagが立っていたら
                // cout << i << " hoge" << j << ":" << cnt[j] << endl;
                // 1 0
              ll tmp = modpow(2LL, j) * cnt[j];
              tmp %= mod;
                ans += tmp;
            } else {
                // 0 1
              ll tmp = modpow(2LL, j) * (N- cnt[j]);
              tmp%=mod;
                ans += tmp;
            }
            ans %= MOD;
        }
        ans %= MOD;
    }
    cout << ans / 2LL << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:69:22: error: 'mod' was not declared in this scope; did you mean 'modf'?
   69 |               tmp %= mod;
      |                      ^~~
      |                      modf
a.cc:74:20: error: 'mod' was not declared in this scope; did you mean 'modf'?
   74 |               tmp%=mod;
      |                    ^~~
      |                    modf
Language: C++

#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>

using namespace std;
const long long MOD = 1000000007;
const long long INF = 9999999999999999;
using ll = long long;
ll two[70];

vector <ll> binary(ll bina){
    vector <ll> ans;
    for (ll i = 0; bina>0;i++)
    {
        ans.push_back((bina%2));
        bina = bina/2;
    }
    return ans;
}

int main(){
	cin.tie(0);
   	ios::sync_with_stdio(false);
  for(ll i = 0;i<62;i++){
    two[i] = 0;
  }
  ll N;
  cin>>N;
  ll kazu[N];
  for(ll i = 0;i<N;i++){
    cin>>kazu[i];
  }
  for(ll i = 0;i<N;i++){
    vector <ll> tow = binary(kazu[i]);
    for(ll k = 0;k<tow.size();k++){
      if(tow[k] == 1){
        two[k]++;
      }
    }
  }
  ll ans = 0;

  
  
  for(ll i = 0;i<70;i++){
    ll temp = pow(2,i)%MOD;
    ans += (N-two[i])*two[i]%MOD*temp%MOD;
    ans = ans%MOD;
  }
  cout << ans << endl;
  return 0;
}


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

#include<bits/stdc++.h>

using namespace std;

#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define pb push_back
#define pf push_front
#define mp make_pair
#define mt make_tuple
#define popb pop_back
#define popf pop_front
#define int long long int
#define vi         vector<int>
#define vll        vector<ll>
#define vpii       vector<pair<int,int>>
#define vpll       vector<pair<ll,ll>>
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define sz(container) int((container).size())
#define rep(i,a,b) for(i=a;i<b;i++)
#define tr(container,it)   for(typeof(container.begin()) it = container.begin(); it != container.end(); it++)
#define present(container, element) (container.find(element) != container.end())      //set,map etc.
#define cpresent(container, element) (find(all(container),element) != container.end())    //vector
#define hell 1000000007
#define mod 998244353
#define fs first
#define sc second
signed main()
{
  fastio
//   freopen("INPUT.txt", "r", stdin);
//   freopen("OUTPUT.txt", "w", stdout);

  int n,i,j;
  cin>>n;
  int a[n];
  for(i=0;i<n;i++)
    cin>>a[i];
  int sum = 0; 
    for (i = 0; i < 61; i++)  
    { 
        int zc = 0, oc = 0;  
          int idsum = 0;  
        for (j = 0; j < n; j++) 
        { 
            if (a[j] % 2 == 0) 
                zc++; 
            else
                oc++; 
            a[j] /= 2; 
        } 
        idsum = ((oc * zc)%hell) * (((1 << i)%hell);   
		sum += idsum;  
		sum%=hell;
    } 
    cout<< sum; 
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:52:52: error: expected ')' before ';' token
   52 |         idsum = ((oc * zc)%hell) * (((1 << i)%hell);
      |                                    ~               ^
      |                                                    )
Language: C++

#incude <iostream>
using namespace std;

typedef unsigned long long i64;

#define BIGNUM 1000000007
#define remainder(x) ((x) % BIGNUM)

int N;
i64 *A;

void Solve()
{
  i64 sum = 0LL;
  for (int i = 1; i < N; ++i){
    for (int j = i + 1; j <=N; ++j){
      i64 exor = A[i] xor A[j];
      sum += remainder(exor);
    }
//    sum = remainder(sum);
  }
  cout << remainder(sum) << endl;
}

void Init()
{
  cin >> N;
  A = new i64[N + 2];
  for (int i = 1; i <= N; ++i)
    cin >> A[i];
}

void Clean()
{
  delete[] A;
}

int main()
{
  Init();
  Solve();
  Clean();
  return 0;
}


Compiler output:
a.cc:1:2: error: invalid preprocessing directive #incude; did you mean #include?
    1 | #incude <iostream>
      |  ^~~~~~
      |  include
a.cc: In function 'void Solve()':
a.cc:22:3: error: 'cout' was not declared in this scope
   22 |   cout << remainder(sum) << endl;
      |   ^~~~
a.cc:1:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #incude <iostream>
a.cc:22:29: error: 'endl' was not declared in this scope
   22 |   cout << remainder(sum) << endl;
      |                             ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #incude <iostream>
a.cc: In function 'void Init()':
a.cc:27:3: error: 'cin' was not declared in this scope
   27 |   cin >> N;
      |   ^~~
a.cc:27:3: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include<vector>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<cstdint>
#define MOD 1000000007
#define ll long long
using namespace std;

int main() {
 vector<int> lists(61);
 for (int i = 0; i < 61; i++) {
  lists.at(i) = 0;
 }
 
 ll N;
 cin >> N;

 for (int i = 0; i < N; i++) {
  ll p_two, temp;
  cin >> temp;

  for (int j = 0; j < 61; j++) {
   p_two = pow(2, j);  
   if ((temp & p_two) !=  0) {
    lists.at(j) += 1;
   }
  }
 }

 ll ans = 0;

 for (int i = 0; i < 61; i++) {
  ans += pow(2, i) * lists[i] * (N - lists[i]);
  ans %= MOD;
 }

 cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:2: error: 'cin' was not declared in this scope
   17 |  cin >> N;
      |  ^~~
a.cc:6:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    5 | #include<cstdint>
  +++ |+#include <iostream>
    6 | #define MOD 1000000007
a.cc:38:2: error: 'cout' was not declared in this scope
   38 |  cout << ans << endl;
      |  ^~~~
a.cc:38:2: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:38:17: error: 'endl' was not declared in this scope
   38 |  cout << ans << endl;
      |                 ^~~~
a.cc:6:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    5 | #include<cstdint>
  +++ |+#include <ostream>
    6 | #define MOD 1000000007
Language: C++

#include<bits/stdc++.h>

long long pow_mod(long long base,long long exp,long long mod){
    long long res = 1;
    while(exp>0){
        if(exp & 1)res = res * base % mod;
        base = base * base % mod;
        exp >>= 1;
    }
    return res;
}

const int mood = 1000000007;     
int main()
{
    int n;
    std::cin>>n;
    std::vector<long long> a(n);
    std::vector<std::pair<int,int>> eo(61); //first 1 second 0
    for(int i=0;i<61;i++)eo[i] = {0,0};
    for(int i=0;i<n;i++){
        std::cin>>a[i];
        for(long long j=0;j<60;j++){
            if(a[i] & ((long long)1<<j))eo[j].first++;
            else eo[j].second++;
        }
    }
    long long ans = 0;
    for(int i=0;i<61;i++){
        //std::cout<<eo[i].first<<" : "<<eo[i].second<<std::endl;;
        int tmp = (eo[i].first * eo[i].second) % mood;
        long long kake = std::pow_mod(2,i,mood);
        ans += tmp*kake;
        ans %= mood;
    }
    std::cout<<ans<<std::endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:31: error: 'pow_mod' is not a member of 'std'; did you mean 'pow_mod'?
   32 |         long long kake = std::pow_mod(2,i,mood);
      |                               ^~~~~~~
a.cc:3:11: note: 'pow_mod' declared here
    3 | long long pow_mod(long long base,long long exp,long long mod){
      |           ^~~~~~~
Language: C++

#pragma warning(disable: 4996)
#define _USE_MATH_DEFINES
#include <iostream>
#include <iomanip>
#include <random>
#include <unordered_map>
#include <functional>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <algorithm>
#include <vector>
#include <bitset>
#include <numeric>
#include <string>
#include <set>
#include <tuple>
#include <utility>
#include <regex>
using namespace std;

int main(void) {
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	int N;
	cin >> N;
	string A;
	vector<long long> num(N);
	for (int i = 0; i < N; ++i) {
		cin >> A;
		if (A.size() > 11) {
			A = A.substr(A.size() - 11, A.size());
		}
		long long a = stoll(A);
		num[i] = a;
	}

	long long c = num[0];
	for (int i = 1; i < N; ++i) {
		c = c xor num[i];
	}
	cout << c%(1e9+7);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:18: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
   43 |         cout << c%(1e9+7);
      |                 ~^~~~~~~~
      |                 |     |
      |                 |     double
      |                 long long int
Language: C++

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

long long int Xorsum(int arr[], int n)
{
    long long int sum = 0;
    for (int i = 0; i < 32; i++)
    {
        //  Count of zeros and ones
        int zc = 0, oc = 0;

        // Individual sum at each bit position
        long long int idsum = 0;
        for (int j = 0; j < n; j++)
        {
            if (arr[j] % 2 == 0)
                zc++;
            else
                oc++;
            arr[j] /= 2;
        }

        // calculating individual bit sum
        idsum = oc * zc * (1 << i);

        // final sum
        sum =((sum%M) +(dsum%M))%M;
    }
    return sum;
}
int main()
{
int t,n,ans=0,a[300000],sum=0,i,j;
cin>>n;
for(i=0;i<n;i++)
{
    cin>>a[i];
    sum=sum+a[i];
}
/*for(i=0;i<n-1;i++)
{
    ans=((ans%M)+((sum-p[i])%M))%M;
}
*/
ans=Xorsum(a,n);
ans=ans;
cout<<ans%M<<endl;
return 0;
}


Compiler output:
a.cc: In function 'long long int Xorsum(int*, int)':
a.cc:29:25: error: 'dsum' was not declared in this scope; did you mean 'idsum'?
   29 |         sum =((sum%M) +(dsum%M))%M;
      |                         ^~~~
      |                         idsum