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

#include<iostream>
int main()
{
  using namespace std;
  int n;
  int sum=0;
  cin >> n;
  vector<int> x,y,z,g;
  for(int i=0;i<n;i++)
  {
    int b;
    cin >> b;
    for(int j=0;j<b;j++)
    {
      int c;
      cin >> c;
      x.push_back(c);
      cin >> c;
      y.push_back(c);
    }
  }
  for(int k=0;k<y.size();k++)
  {
    if(y[k]==1)
    {
      z.push_back(x[k]);
    }
    else
      g.push_back(x[k]);
  }
  for(int i=0;i<z.size();i++)
  {
    int count=0;
    int ba=0;
    for(int j=i+1;j<z.size();j++)
    {
      if(z[i]==z[j])
      count++;
    }
    if(count==0)
    {
      for(int k=0;k<g.size();k++)
      {
        if(z[i]==g[k])
           {
             ba=1;
           }
           
      }
       
    }
           if(ba==0)
           {
             sum++;
           }
  }
  cout << sum;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'vector' was not declared in this scope
    8 |   vector<int> x,y,z,g;
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<iostream>
  +++ |+#include <vector>
    2 | int main()
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vector<int> x,y,z,g;
      |          ^~~
a.cc:17:7: error: 'x' was not declared in this scope
   17 |       x.push_back(c);
      |       ^
a.cc:19:7: error: 'y' was not declared in this scope
   19 |       y.push_back(c);
      |       ^
a.cc:22:17: error: 'y' was not declared in this scope
   22 |   for(int k=0;k<y.size();k++)
      |                 ^
a.cc:26:7: error: 'z' was not declared in this scope
   26 |       z.push_back(x[k]);
      |       ^
a.cc:26:19: error: 'x' was not declared in this scope
   26 |       z.push_back(x[k]);
      |                   ^
a.cc:29:7: error: 'g' was not declared in this scope
   29 |       g.push_back(x[k]);
      |       ^
a.cc:29:19: error: 'x' was not declared in this scope
   29 |       g.push_back(x[k]);
      |                   ^
a.cc:31:17: error: 'z' was not declared in this scope
   31 |   for(int i=0;i<z.size();i++)
      |                 ^
a.cc:42:21: error: 'g' was not declared in this scope
   42 |       for(int k=0;k<g.size();k++)
      |                     ^
Language: C++

#include <bits/stdc++.h>
#include "Local_Debug.h"
using namespace std;
#define Endl endl
#define debug(x) cout << #x << " = " << (x) << endl
typedef long long ll;
const int MOD = (int)1e9 + 7;
const int MAXN = (int)2e5 + 5;
ll n, a, x, y, mx, vis[20];
vector<pair<ll, ll>> v[20];
void dfs(ll pos, set<ll> yes, set<ll> no)
{
	if (pos == n + 1)
	{
		mx = max(mx, ll(yes.size()));
		return;
	}
	if (!vis[pos])
	{
		if (yes.count(pos))
		{
			bool flag = true;
			for (auto i : v[pos])
			{
				if (i.second&& no.count(i.first))
				{
					flag = false;
					break;
				}
				if (!i.second && yes.count(i.first))
				{
					flag = false;
					break;
				}
				i.second ? yes.emplace(i.first) : no.emplace(i.first);
			}
			if (!flag)
				return;
			dfs(pos + 1, yes, no);
		}
		else if (no.count(pos))
			dfs(pos + 1, yes, no);
		else
		{
			no.emplace(pos);
			dfs(pos + 1, yes, no);
			no.erase(pos);
			bool flag = true;
			for (auto i : v[pos])
			{
				if (i.second&& no.count(i.first))
				{
					flag = false;
					break;
				}
				if (!i.second && yes.count(i.first))
				{
					flag = false;
					break;
				}
				i.second ? yes.emplace(i.first) : no.emplace(i.first);
			}
			if (!flag)
				return;
			dfs(pos + 1, yes, no);
		}
	}
	else
		dfs(pos + 1, yes, no);
}
int main()
{
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	while (cin >> n)
	{
		mx = 0;
		for (ll i = 1; i <= n&&cin >> a; ++i)
		{
			vector<pair<ll, ll>>().swap(v[i]);
			while (a--&&cin >> x >> y)
				v[i].emplace_back(x, y);
		}
		for (ll i = 1; i <= n; ++i)
		{
			memset(vis, 0, sizeof(vis));
			vis[i] = 1;
			set<ll> yes, no;
			for (auto j : v[i])
				j.second ? yes.emplace(j.first) : no.emplace(j.first);
			yes.emplace(i);
			dfs(1, yes, no);
		}
		cout << mx << endl;
	}
}
/*
3
1
2 1
1
1 1
1
2 0

3
2
2 1
3 0
2
3 1
1 0
2
1 1
2 0

2
1
2 0
1
1 0
*/

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

#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <intrin.h>
using namespace std;

int main() {
	int n;
	cin >> n;
	vector<vector<pair<int,int>>> tes(n+1);
	for (int i = 1; i <= n; i++) {
		vector<pair<int, int>> t;
		int a;
		cin >> a;
		for (int j = 0; j < a; j++) {
			int x, y;
			cin >> x >> y;
			t.emplace_back(x, y);
		}
		tes[i] = t;
	}
	int ans = 0;
	for (int mask = 0; mask < (1 << n); mask++) {
		set<int>now;
		for (int j = 0; j < n; j++) {
			if (mask & (1 << j)) {
				now.emplace(j+1);
			}
		}
		bool ok = true;
		for (auto cur : now) {
			for (auto t : tes[cur]) {
				if (t.second == 0 && now.find(t.first) != now.end()) {
					ok = false;
				}
				if (t.second == 1 && now.find(t.first) == now.end()) {
					ok = false;
				}
			}
		}
		if (ok) {
			ans = max(ans, (int)__popcnt(mask));
		}
	}
	cout << ans;
	return 0;
}

Compiler output:
a.cc:5:10: fatal error: intrin.h: No such file or directory
    5 | #include <intrin.h>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
int main()
{
  using namespace std;
  int n;
  int sum=0;
  cin >> n;
  vector<int> x,y,z;
  for(int i=0;i<n;i++)
  {
    int b;
    cin >> b;
    for(int j=0;j<b;j++)
    {
      int c;
      cin >> c;
      x.push_back(c);
      cin >> c;
      y.push_back(c);
    }
  }
  for(int k=0;k<y.size();k++)
  {
    if(y[k]==1)
    {
      z.push_back(x[k]);
    }
  }
  for(int i=0;i<z.size();i++)
  {
    int count=0;
    for(int j=i+1;j<z.size();j++)
    {
      if(z[i]==z[j])
      count++;
    }
    if(count==0)
    {
      sum++;
    }
  }
  cout << sum;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'vector' was not declared in this scope
    8 |   vector<int> x,y,z;
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<iostream>
  +++ |+#include <vector>
    2 | int main()
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vector<int> x,y,z;
      |          ^~~
a.cc:17:7: error: 'x' was not declared in this scope
   17 |       x.push_back(c);
      |       ^
a.cc:19:7: error: 'y' was not declared in this scope
   19 |       y.push_back(c);
      |       ^
a.cc:22:17: error: 'y' was not declared in this scope
   22 |   for(int k=0;k<y.size();k++)
      |                 ^
a.cc:26:7: error: 'z' was not declared in this scope
   26 |       z.push_back(x[k]);
      |       ^
a.cc:26:19: error: 'x' was not declared in this scope
   26 |       z.push_back(x[k]);
      |                   ^
a.cc:29:17: error: 'z' was not declared in this scope
   29 |   for(int i=0;i<z.size();i++)
      |                 ^
Language: C++

import random as rng
import itertools as it
import collections as col
import heapq as hq
import sys
import copy as cp
import bisect
sys.setrecursionlimit(10**9)


def dump_impl(*objects):
    print(*objects, file=sys.stderr)


def dump_dummy(*objects):
    pass


dump = dump_impl if "DEBUG" in sys.argv else dump_dummy

N = int(input())
T = [None]*N
for i in range(N):
    Ai = int(input())
    T[i] = [-1]*N
    for j in range(Ai):
        xij, yij = map(int, input().split())
        dump(i, xij-1, yij)
        T[i][xij-1] = yij
dump(T)


def imply(p, q): return (not p) or q


ans = -1
for trusts in it.product([0, 1], repeat=N):
    dump(trusts)
    ok = True
    for i, trust in enumerate(trusts):
        if trust:
            for j, tij in enumerate(T[i]):
                ok = ok and imply(tij == 1, trusts[j]) and (
                    imply(tij == 0, not trusts[j]))
    if ok:
        ans = max([ans, len([i for i in trusts if i == 1])])
    dump(ans)
print(ans)


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import random as rng
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
 
  int N;
  int ar[N+2]
  cin>>N;
  memset(ar,0,sizeof(ar));
  cnt=0;
  while(N--)
  {int h;
   cin>>h;
  for(int i=1;i<=h;i++)
  {cin>>ar[i];
   if(ar[i])
    cnt++;
   
  }
    cout<<cnt;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: expected initializer before 'cin'
    8 |   cin>>N;
      |   ^~~
a.cc:9:10: error: 'ar' was not declared in this scope
    9 |   memset(ar,0,sizeof(ar));
      |          ^~
a.cc:10:3: error: 'cnt' was not declared in this scope; did you mean 'int'?
   10 |   cnt=0;
      |   ^~~
      |   int
a.cc:22:2: error: expected '}' at end of input
   22 | }
      |  ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: C++

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

int main(void) {
  ll n;
  cin >> n;
  ll a[n], x[20][20], y[20][20];
  ll ans = 0;
  rep (i, n) {
    cin >> a[i];
    rep (j, a[i]) {
      cin >> x[i][j] >> y[i][j];
      x[i][j]--;
    }
  }

  for (ll bit = 0; bit < (1<<n); bit++) {
    
    vector<ll> shojiki(n, 0);
    for (ll i = 0; i < n; i++) {
      if (bit & (1 << i)) {

        shojiki[i] = 1;



      }
    }

    bool ok = true;
    rep (i, n) {

      
      rep (j, a[i]) {

        if (shojiki[i]) {
          if (y[i][j]) {
            if (!shojiki[x[i][j]]) ok = false;
          }
          else {
            if (shojiki[x[i][j]]) ok = false;
          }
        }

        else {
          if (!y[i][j]) {
            if (!shojiki[x[i][j]]) ok = false;
          }
          else {
            if (shojiki[x[i][j]]) ok = false;
          }
        }
      }

    }
    if (ok) {
      int tmp = 0;
      rep (i, n) if (shojiki[i]) tmp++;
      ans = max(ans, tmp);
    }
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:61:16: error: no matching function for call to 'max(ll&, int&)'
   61 |       ans = max(ans, tmp);
      |             ~~~^~~~~~~~~~
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:61:16: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   61 |       ans = max(ans, tmp);
      |             ~~~^~~~~~~~~~
/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:61:16: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   61 |       ans = max(ans, tmp);
      |             ~~~^~~~~~~~~~
Language: C++

#include <iostream>
using namespace std;
template<class T> inline int countbit(T n){return (n==0)?0:(1+countbit(n&(n-1)));}

int shogen[16][16];


bool checkshogen(int pattern, int N) {
	int seijitu[16];
	for (int i = 1; i <= N; i++) {
		seijitu[i] = pattern & 1;
		pattern = pattern >> 1;
	}
	for (int i = 1; i <= N; i++) {
		if (seijitu[i] == 0) continue; // 不誠実なものの言うことは無視
		for (int j = 1; j <= N; j++) {
			if ((shogen[i][j]==1) && (seijitu[j]!=1)) {
				// 正直者が嘘をついている
				return false;
			}
			if ((shogen[i][j]==0) && (seijitu[j]!=0)) {
				// 正直者が嘘をついている
				return false;
			}
		}
	}
	return true;
}


int main(void) {
	int N;
	cin >> N;
	for (int i = 0; i <= N; i++) for (int j = 0; j <= N; j++)
		shogen[i][j]=-1;

	for (int i = 1; i <= N; i++) {
		int A, x, y;
		cin >> A;
		for (int j = 1; j <= A; j++) {
			cin >> x >> y;
			shogen[i][x] = y;
		}
	}

	// 2のN乗のパターンを作る
	// N=15なので間に合う
	int ans = 0;
	unsigned int last = (int)pow(2, N) -1;
	for (unsigned int i = 0; i <= last; i++) {
		// bitが1なら正直者、0なら不誠実とする
		if (checkshogen(i, N)) {
			ans = max(ans, countbit(i));
		}
	}
	cout << ans << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:49:34: error: 'pow' was not declared in this scope
   49 |         unsigned int last = (int)pow(2, N) -1;
      |                                  ^~~
Language: C++

#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;

const int maxn=16;
vector<pair<int,int>>per[maxn];
int main()
{
    int n;
    cin >> n;
    int num1 ,num2 ;
    for(int i=1;i<=n;i++){
        int len;
        cin >> len;
        for(int j=0;j<len;j++){
            cin >> num1 >> num2 ;
            per[i].push_back({num1,num2});
        }
    }
    int state[16];
    int maxstate=(1<<n) ;
    int ans=0;
    for(int i=0;i<maxstate;++i){
        int d=i;
        int flag=0;
        num1=0;
        for(int j=1;j<=n;j++,d/=2){
            if(d&1)
                num1++;
            state[j]=d&1;
        }

        for(int j=1;j<=n;j++){
            if(state[j]==1){
                for(auto k : per[j]){
                    if(state[k.first]!=k.second){
                        flag=1;
                        break;
                    }
                }
            }
            else{
                for(auto k : per[j]){
                    if(state[k.first]==k.second){
                        flag=1;
                        break;
                    }
                }
            }
            if(flag)
                break;
        }
        if(flag)
            continue;
        ans=max(ans,num1);
//        for(int j=1;j<=n;j++)
//            cout << state[j];
//        cout << endl;
    }
    cout << ans<< endl;
    return 0;

}


Compiler output:
a.cc:7:1: error: 'vector' does not name a type
    7 | vector<pair<int,int>>per[maxn];
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:18:13: error: 'per' was not declared in this scope
   18 |             per[i].push_back({num1,num2});
      |             ^~~
a.cc:36:30: error: 'per' was not declared in this scope
   36 |                 for(auto k : per[j]){
      |                              ^~~
a.cc:44:30: error: 'per' was not declared in this scope
   44 |                 for(auto k : per[j]){
      |                              ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{  
    int n;
    int call;
    cin >>n;
    int at;
    int foo;
    vector<int,vector<bool>> state;
    for(int i=0;i<n;i++){
        state.pushback(vector<bool>);
        cin >> call;
        for(int j=0;i<call;j++){
            cin >>at >> foo;
            if(foo==1){
                state.at(i).push_back()
            }
        }
    }
    cout << ans << endl;
    return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:15: error: 'class std::vector<int, std::vector<bool> >' has no member named 'pushback'; did you mean 'push_back'?
   12 |         state.pushback(vector<bool>);
      |               ^~~~~~~~
      |               push_back
a.cc:12:36: error: expected primary-expression before ')' token
   12 |         state.pushback(vector<bool>);
      |                                    ^
a.cc:17:29: error: request for member 'push_back' in 'state.std::vector<int, std::vector<bool> >::at(((std::vector<int, std::vector<bool> >::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::vector<int, std::allocator<bool> >, int>::value_type' {aka 'int'}
   17 |                 state.at(i).push_back()
      |                             ^~~~~~~~~
a.cc:21:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   21 |     cout << ans << endl;
      |             ^~~
      |             abs
In file included from /usr/include/c++/14/ext/alloc_traits.h:34,
                 from /usr/include/c++/14/bits/basic_string.h:39,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/alloc_traits.h: In instantiation of 'static void std::allocator_traits< <template-parameter-1-1> >::deallocate(_Alloc&, pointer, size_type) [with _Alloc = std::vector<int, std::allocator<bool> >; pointer = int*; size_type = long unsigned int]':
/usr/include/c++/14/bits/stl_vector.h:389:19:   required from 'void std::_Vector_base<_Tp, _Alloc>::_M_deallocate(pointer, std::size_t) [with _Tp = int; _Alloc = std::vector<bool>; pointer = int*; std::size_t = long unsigned int]'
  389 |           _Tr::deallocate(_M_impl, __p, __n);
      |           ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:368:2:   required from 'std::_Vector_base<_Tp, _Alloc>::~_Vector_base() [with _Tp = int; _Alloc = std::vector<bool>]'
  368 |         _M_deallocate(_M_impl._M_start,
      |         ^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:531:7:   required from here
  531 |       vector() = default;
      |       ^~~~~~
/usr/include/c++/14/bits/alloc_traits.h:362:13: error: 'class std::vector<int, std::allocator<bool> >' has no member named 'deallocate'; did you mean '_M_allocate'?
  362 |       { __a.deallocate(__p, __n); }
      |         ~~~~^~~~~~~~~~
      |         _M_allocate
Language: C++

#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string>
#include<algorithm>
#include<vector> 
#include<limits>
#include<numeric>
#include<type_traits>
#include<math.h>
#include<fstream>
#include<set>
#include<queue>
using namespace std;
typedef long long ll;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repi(i,a,b) for(int i = (int)(a); i < (int)(b); i++)
#define out(str) cout << str << endl
#define ALL(a) (a).begin(),(a).end()
#define INF (1<<29)

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

int N,maxi=0,A,x;
bool y;

int main(){
    cin>>N;
    vector<pair<int,bool>> v[N];
    rep(i,N){
        cin>>A;
        rep(j,A){
            cin>>x>>y;
            x--;
            v[i].push_back({x,y});
        }
    }
    rep(i,1<<N){
        // out(i);
        bitset<15> bs(i);
        bool ok=true;
        rep(j,N){
            // out(j);
            for(pair<int,bool> p:v[j]){
                // cout<<p.first<<" : "<<p.second<<endl;
                if(bs[j]){
                    if(bs[p.first]!=p.second)ok=false;
                }
                else{
                    if(bs[p.first]==p.second)ok=false;
                }
            }
        }
        if(ok){
            // out(bs);
            int tmp=0;
            rep(i,15)if(bs[i])tmp++;
            maxi=max(maxi,tmp);
        }
    }
    out(maxi);

    
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:42:9: error: 'bitset' was not declared in this scope
   42 |         bitset<15> bs(i);
      |         ^~~~~~
a.cc:14:1: note: 'std::bitset' is defined in header '<bitset>'; this is probably fixable by adding '#include <bitset>'
   13 | #include<queue>
  +++ |+#include <bitset>
   14 | using namespace std;
a.cc:42:20: error: 'bs' was not declared in this scope; did you mean 'abs'?
   42 |         bitset<15> bs(i);
      |                    ^~
      |                    abs
Language: C++

#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define EPS (1e-9)
#define INF (1e17)
#define PI (acos(-1))
//const double PI = acos(-1);
//const double EPS = 1e-15;
//long long INF=(long long)1E17;
#define i_7 (long long)(1e9+7)
//#define i_7 998'244'353
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
using namespace std;

bool prime_(int n){
  if(n==1){
    return false;
  }else if(n==2){
    return true;
  }else{
    for(int i=2;i<=sqrt(n);i++){
      if(n%i==0){
        return false;
      }
    }
    return true;
  }
}

long long gcd_(long long a, long long b){
  if(a<b){
    swap(a,b);
  }
  if(a%b==0){
    return b;
  }else{
    return gcd_(b,a%b);
  }
}
 
long long lcm_(long long x, long long y){
  return (x/gcd_(x,y))*y;
}


int main(){
  
  int n;
  cin>>n;
  vector<pair<int, int>> xy[n];
  REP(i,n){
    int a;
    cin>>a;
    int x,y;
    REP(j,a){
      cin>>x>>y;
      x--;
      xy[i].push_back(pake_pair(x,y));
    }
  }
  int ans = 0;
  for(int i = 0; i < (1<<n); i++){
    bool flag = true;
    REP(j,n){
      if(i & (1<<j)){//j番の人が正直者な時
        for(auto p:xy[j]){
          int x = p.first;
          int y = p.second;
          if(y == 1){
            if(i & (1<<x)){
              continue;
            }else{
              flag = false;
              break;
            }
          }else{
            if(i & (1<<x)){
              flag = false;
              break;
            }else{
              continue;
            }
          }
        }
      }
    }
    if(!flag){
      continue;
    }
    int temp = 0;
    REP(j,n){
      if(i & (1<<j)){
        temp++;
      }
    }
    ans = max(ans, temp);
  }
  
  cout<<ans<<endl;
          
  return 0; 
}


Compiler output:
a.cc: In function 'int main()':
a.cc:64:23: error: 'pake_pair' was not declared in this scope
   64 |       xy[i].push_back(pake_pair(x,y));
      |                       ^~~~~~~~~
Language: C++

#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define EPS (1e-9)
#define INF (1e17)
#define PI (acos(-1))
//const double PI = acos(-1);
//const double EPS = 1e-15;
//long long INF=(long long)1E17;
#define i_7 (long long)(1e9+7)
//#define i_7 998'244'353
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
using namespace std;

bool prime_(int n){
  if(n==1){
    return false;
  }else if(n==2){
    return true;
  }else{
    for(int i=2;i<=sqrt(n);i++){
      if(n%i==0){
        return false;
      }
    }
    return true;
  }
}

long long gcd_(long long a, long long b){
  if(a<b){
    swap(a,b);
  }
  if(a%b==0){
    return b;
  }else{
    return gcd_(b,a%b);
  }
}
 
long long lcm_(long long x, long long y){
  return (x/gcd_(x,y))*y;
}


int main(){
  
  int n;
  cin>>n;
  vector<pair<int, int>> xy[n];
  REP(i,n){
    int a;
    cin>>a;
    int x,y;
    REP(j,a){
      cin>>x>>y;
      x--;
      xy[i].push_back(pake_pair(x,y));
    }
  }
  int ans = 0;
  for(int i = 0; i < (1<<n); i++){
    bool flag = true;
    REP(j,n){
      if(i & (1<<j)){//j番の人が正直者な時
        for(auto p:xy[j]){
          int x = p.first;
          int y = p.second;
          if(y == 1){
            if(i & (1<<x)){
              continue;
            }else{
              flag = false;
              break;
            }
          }else{
            if(i & (1<<x)){
              flag = false;
              break;
            }else{
              continue;
            }
          }
        }
      }
    }
    if(!flag){
      continue;
    }
    int temp = 0;
    for(j,n){
      if(i & (1<<j)){
        temp++;
      }
    }
    ans = max(ans, temp);
  }
  
  cout<<ans<<endl;
          
  return 0; 
}


Compiler output:
a.cc: In function 'int main()':
a.cc:64:23: error: 'pake_pair' was not declared in this scope
   64 |       xy[i].push_back(pake_pair(x,y));
      |                       ^~~~~~~~~
a.cc:97:9: error: 'j' was not declared in this scope
   97 |     for(j,n){
      |         ^
a.cc:103:3: error: expected primary-expression before '}' token
  103 |   }
      |   ^
a.cc:102:26: error: expected ')' before '}' token
  102 |     ans = max(ans, temp);
      |                          ^
      |                          )
  103 |   }
      |   ~                       
a.cc:97:8: note: to match this '('
   97 |     for(j,n){
      |        ^
a.cc:103:3: error: expected primary-expression before '}' token
  103 |   }
      |   ^
Language: C++

#include<cstdio>
#include<cmath>
#include<string>
#include<vector>
#include<algorithm>

using namespace std;

int main()
{
	int n;
	int table[17][17];

	//freopen("input.txt", "r", stdin);

	memset(table, -1, sizeof(table));

	scanf("%d", &n);

	for (int i = 1; i <= n; i++)
	{
		int num;

		scanf("%d", &num);

		for (int j = 0; j < num; j++)
		{
			int a, b;

			scanf("%d %d", &a, &b);

			table[i][a] = b;
		}
	}

	int ub;

	ub = (int)pow(2.0, n);

	int lmax = 0;

	for (int i = 0; i < ub; i++)
	{
		int truth[17];
		int cnt = 0;

		int temp;

		temp = i;

		for (int j = 1; j <= n; j++)
		{
			truth[j] = temp % 2;

			cnt += temp % 2;

			temp /= 2;

		}

		bool valid = true;

		for (int j = 1; j <= n; j++)
		{
			if (truth[j])
			{
				for (int k = 1; k <= n; k++)
				{
					if (table[j][k]!=-1 && truth[k] != table[j][k])
					{
						valid = false;

						break;
					}
				}
			}

			if (!valid)
			{
				break;
			}
		}

		/*
		if (valid)
		{
			for (int j = 1; j <= n; j++)
			{
				for (int k = 1; k <= n; k++)
				{
					if (!truth[j])
					{
						if (truth[k] && table[k][j] != -1 && table[k][j])
						{
							valid = false;

							break;
						}
					}
				}

				if (!valid)
				{
					break;
				}
			}
		}
		*/

		if (valid&&cnt > lmax)
		{
			lmax = cnt;
		}
	}

	printf("%d\n", lmax);

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: error: 'memset' was not declared in this scope
   16 |         memset(table, -1, sizeof(table));
      |         ^~~~~~
a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    5 | #include<algorithm>
  +++ |+#include <cstring>
    6 |
Language: C++

#include <bits/stdc++.h>

typedef long long ll;
template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

template<class T>
inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}

using namespace std;

int main() {
    int N;
    int bit = 0;
    for (int i = 0; i < N; ++i) {
        int A;
        cin >> A;
        for (int j = 0; j < A; ++j) {
            int x, y;
            cin >> x >> y;
            if (y) bit |= (1<<(x-1));
            else bit &= ~(1<<(x-1));
        }
    }
    int res = _builtin_popcount(bit);
    cout << max(res, N-res) << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:15: error: '_builtin_popcount' was not declared in this scope; did you mean '__builtin_popcount'?
   37 |     int res = _builtin_popcount(bit);
      |               ^~~~~~~~~~~~~~~~~
      |               __builtin_popcount
Language: C++

#include<bits/stdc++.h>
using namespace std;
pair<int,bool> A[16][16];
int a[16];
int main()
{
  int n;
  cin>>n;
  for(int i=0;i<n;i++)
  {
    cin>>a[i];
    for(int j=0;j<a[i];j++)
      cin>>A[i][j].first>>A[i][j].second;
    A[i][j].first--;
  }
  int ans=0;
  for(int i=0;i<(1<<n);i++)
  {
    bool ok=true;
    for(int j=0;j<n;j++)
      if(i&1<<j)
        for(int k=0;k<a[j];k++)
          if(i>>A[j][k].first&1!=A[j][k].second)
            ok=false;
    if(ok)
      	ans=max(ans,__builtin_popcount(i));
  }
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:10: error: 'j' was not declared in this scope
   14 |     A[i][j].first--;
      |          ^
Language: C++

#include<iostream>
#include<stdio.h>
#include<stdlib.h>
#include<algorithm>
#include<vector>
#include<string.h>
#include<math.h>
#include<map>
#include<iomanip>
#include<queue>

using namespace std;
using ll = long long;
using ull = unsigned long long;

ll mod = 1e9 + 7;

int main(){	
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n;
	cin >> n;
	vector<ull> a(n);
	for(int i = 0; i < n; i++){
		cin >> a[i];
	}
	
	vector<int> cnt(100 , 0);
	for(int i = 0; i < n; i++){
		for(int bit = 0; bit < 60; bit++){
			if(a[i] & (1LL << bit))cnt[bit]++;
		}
	}
	
	ull ans = 0;
	ull t = 1;
	ull x = 0;
	for(int bit = 0; bit < 60; bit++){
		x = (ull)cnt[bit]*(n - cnt[bit]);
		x %= mod;
		ans += (t * x)%mod;
		ans %= mod;
		t *= 2;
		t %= mod
	}
	cout << ans << endl;
	return 0;
}
 


Compiler output:
a.cc: In function 'int main()':
a.cc:44:25: error: expected ';' before '}' token
   44 |                 t %= mod
      |                         ^
      |                         ;
   45 |         }
      |         ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
  int N;cin>>N;
  vector<int>A(60);
  for(int i=0;i<N;i++){
    int a;cin>>a;
    for(int j=0;j<60;j++)
      if(a&(1<<j))A[j]++;
  }
  int ans=0;
  for(int i=0;i<60;i++){
    ans+=A[i]*(N-A[i]);
    ans%=1e9+7;
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:8: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
   15 |     ans%=1e9+7;
      |     ~~~^~~~~~~
a.cc:15:8: note:   in evaluation of 'operator%=(long long int, double)'
Language: C++

#include<iostream>
using namespace std;
int maiN()
{
  int i,j,k,l,m,A[100000],n;
  cin>>n;
  for(i=1;i<=n;i++)
  {
    cin>>A[i];
  }
  int sum=0;
  for(i=1;i<n;i++)
  {
    for(j=i+1;j<=n;j++)
    {
      sum=sum+A[i]^A[j];
    }
  }
  cout<<sum;
}

Compiler output:
a.cc: In function 'int maiN()':
a.cc:20:1: warning: no return statement in function returning non-void [-Wreturn-type]
   20 | }
      | ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

/*
   Author : tarang
*/
#include<bits/stdc++.h>
#define ll long long
#define endl "\n"
#define fastio ios_base::sync_with(false); cin.tie(0);cout.tie(0);
#define PI = acos(-1)
using namespace std ;
ll power(ll b,ll e,ll m)
{
    if(e==0) return 1;
    if(e&1) return b*power(b*b%m,e/2,m)%m;
    return power(b*b%m,e/2,m);
}
int main(){
	 fastio ; 
	 ll m = 1000000007;
     ll n ; cin >> n ;
     vector<ll> v(n);
     for(ll i = 0 ; i < n ; i++){
     	cin >> v[i];
	 }
	 ll f[68] = {0};
//	 for(auto x:f) cout << x << " ";
//	 cout << endl;
	 for(ll i = 0 ; i < n ; i++){
	 	  for(ll j = 0 ; j < 61  ; j++){
	 	  	    if((v[i] & (1 << j)))
	 	  	       f[j]++;
		   }
	 }
	// for(auto x :f) cout << x << " ";
	// cout << endl;
	 ll res = 0 ;
	 for(ll i = 0 ; i < 61 ; i++){
	 	  ll x = f[i];
	 	  ll z = (n-x);
	 	  ll ans = power(2 , i , m);
	 	  //cout << x << " " << z << " " << ans << endl;
	 	  ll ans2 = ( x % m * z % m) % m ;
	 	  ans2 = ( ans2 % m * ans%m) % m ;
	 	  res = ( res % m + ans2%m) %m ;
	 }
	 cout << (res)%m << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:26: error: 'sync_with' is not a member of 'std::ios_base'
    7 | #define fastio ios_base::sync_with(false); cin.tie(0);cout.tie(0);
      |                          ^~~~~~~~~
a.cc:17:10: note: in expansion of macro 'fastio'
   17 |          fastio ;
      |          ^~~~~~
Language: C++

/*
   Author : tarang
*/
#include<bits/stdc++.h>
#define ll long long
#define fastio ios_base::sync_with(false); cin.tie(0);cout.tie(0);
const int MOD = 1000000007;
#define PI = acos(-1)
using namespace std ;
ll power(ll b,ll e,ll m)
{
    if(e==0) return 1;
    if(e&1) return b*power(b*b%m,e/2,m)%m;
    return power(b*b%m,e/2,m);
}
int main(){
     ll n ; cin >> n ;
     vector<ll> v(n);
     for(ll i = 0 ; i < n ; i++){
     	cin >> v[i];
	 }
	 ll f[68] = {0};
//	 for(auto x:f) cout << x << " ";
//	 cout << endl;
	 for(ll i = 0 ; i < n ; i++){
	 	  for(ll j = 0 ; j < 63  ; j++){
	 	  	    if(ll(v[i] & (1LL << j)))
	 	  	       f[j]++;
		   }
	 }
	// for(auto x :f) cout << x << " ";
	// cout << endl;
	 ll res = 0 ;
	 for(ll i = 0 ; i < 63 ; i++){
	 	  ll x = f[i];
	 	  ll z= (n-x);
	 	  ll ans = power(2 , i , MOD);
	 	  //cout << x << " " << z << " " << ans << endl;
	 	  res = (res % MOD + ((x % MOD) * (z % MOD) * (ans))% MOD) % MOD;
	 }
	 cout << (res)%MOD << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:5:12: error: expected primary-expression before 'long'
    5 | #define ll long long
      |            ^~~~
a.cc:27:32: note: in expansion of macro 'll'
   27 |                             if(ll(v[i] & (1LL << j)))
      |                                ^~
a.cc:27:32: error: expected ')' before 'long'
   27 |                             if(ll(v[i] & (1LL << j)))
      |                               ~^
      |                                )
Language: C++

#include <bits/stdc++.h>

// #include <atcoder/all>
using namespace std;
// using namespace atcoder;
typedef long long ll;
/* clang-format off */
#define MOD 1000000007
#define INF 1000000000000000000ll
#define REP(i, n) for (ll i = 0, i##_len = (n); i < i##_len; ++i)
#define ALL(a) (a).begin(), (a).end()
//#define __DEBUG__
#ifdef __DEBUG__
#define CH_P(a) cout <<"check_point("<<#a<<")" << "\n";
#define DEBUG(x) cout<<#x<<":"<<x<<"\n"
#define DEBUGS(v) cout << #v << ":";for(auto x:v){cout<<x<<" ";}cout<<"\n"
#endif
#ifndef __DEBUG__
#define CH_P(a) 
#define DEBUG(x) 
#define DEBUGS(v) 
#endif
/* clang-format on */
using mint = modint1000000007;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  ll n;
  cin >> n;
  vector<ll> a(n);
  REP(i, n) { cin >> a[i]; }
  vector<ll> cnt1(60, 0), cnt0(60, 0);
  REP(i, n) {
    REP(j, 60) {
      if (a[i] & (1ll << j))
        cnt1[j]++;
      else
        cnt0[j]++;
    }
  }
  ll ans = 0;
  REP(i, 60) {
    ans += cnt1[i] % MOD * cnt0[i] % MOD * (ll)powl(2, i) % MOD;
    ans %= MOD;
  }
  cout << ans << endl;

  return 0;
}


Compiler output:
a.cc:24:14: error: 'modint1000000007' does not name a type
   24 | using mint = modint1000000007;
      |              ^~~~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define perl(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define pb push_back
#define ins insert
#define all(x) (x).begin(),(x).end()
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9+10;
const ll INF=4e18;
const ll dy[8]={1,0,-1,0,1,1,-1,-1};
const ll dx[8]={0,-1,0,1,1,-1,1,-1};
using Graph = vector<vector<int>>;
double nCk(int n, int k) {
double res=1.0;
for(int i=0; i<n; i++){
res*=0.5;}
for(int i=0; i<k; i++){
res*=(double)(n-i);
res/=(double)(k-i);
}
return res;}
struct edge{ll to, cost;};
typedef pair<ll,ll> P;
struct graph{
  ll V;
  vector<vector<edge> > G;
  vector<ll> d;

  graph(ll n){
    init(n);
  }

  void init(ll n){
    V = n;
    G.resize(V);
    d.resize(V);
    rep(i,V){
      d[i] = INF;
    }
  }

  void add_edge(ll s, ll t, ll cost){
    edge e;
    e.to = t, e.cost = cost;
    G[s].push_back(e);
  }

  void dijkstra(ll s){
    rep(i,V){
      d[i] = INF;
    }
    d[s] = 0;
    priority_queue<P,vector<P>, greater<P> > que;
    que.push(P(0,s));
    while(!que.empty()){
      P p = que.top(); que.pop();
      ll v = p.second;
      if(d[v]<p.first) continue;
      for(auto e : G[v]){
        if(d[e.to]>d[v]+e.cost){
          d[e.to] = d[v]+e.cost;
          que.push(P(d[e.to],e.to));
        }
      }
    }
  }
};
int main(){
  ll n; cin>>n;
  rep(i,n) cin>>a[i];
  ll c[n+1]={};
  for(ll i=n-1; i>=0; i--){
    c[i] = c[i+1]^a[i];}
  mint ans = 0;
  rep(i,n){
    ans += a[i]^c[i+1];}
  cout << ans << endl;}

Compiler output:
a.cc: In function 'int main()':
a.cc:79:17: error: 'a' was not declared in this scope
   79 |   rep(i,n) cin>>a[i];
      |                 ^
a.cc:82:19: error: 'a' was not declared in this scope
   82 |     c[i] = c[i+1]^a[i];}
      |                   ^
a.cc:83:3: error: 'mint' was not declared in this scope; did you mean 'uint'?
   83 |   mint ans = 0;
      |   ^~~~
      |   uint
a.cc:85:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   85 |     ans += a[i]^c[i+1];}
      |     ^~~
      |     abs
a.cc:85:12: error: 'a' was not declared in this scope
   85 |     ans += a[i]^c[i+1];}
      |            ^
a.cc:86:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   86 |   cout << ans << endl;}
      |           ^~~
      |           abs
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
typedef pair<int,int> P;
typedef long long ll;
const int INF = 1001001001;
const ll INFL = 1e17;
const int MOD = 1e9+7;


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

Compiler output:
a.cc: In function 'int main()':
a.cc:20:26: error: 'mod' was not declared in this scope; did you mean 'modf'?
   20 |         ll now = x*(n-x)%mod;
      |                          ^~~
      |                          modf
Language: C++

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

ll modpow(ll a,ll n,ll mod){
  if(n == 0) return 1LL;
  if(n % 2 == 0){
    ll d = modpow(a,n/2,mod) % mod;
    return (d*d) % mod;
  }
  return (a % mod) * (modpow(a,n-1,mod) % mod) % mod;
}

int main(){
  ll n; cin >> n;
  vector<ll> a(n);
  for(int i = 0; i < n; i++) cin >> a[i];
  ll sum = 0;
  ll times = 0;
  while(times < 65){
    ll cnt1 = 0,cnt0 = 0;
    ll b_sum = 0;
    for(int i = 0; i < n; i++){
      if(a[i] % 2 == 1) cnt1++;
      a[i]/=2;
    }
    cnt0 = n-cnt1;
    b_sum = cnt0*cnt1%MOD
    ll res = modpow(2,times,MOD)*b_sum;
    sum += res%MOD;
    sum %= MOD;
    times++;
  }
  cout << sum << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:26: error: expected ';' before 'll'
   29 |     b_sum = cnt0*cnt1%MOD
      |                          ^
      |                          ;
   30 |     ll res = modpow(2,times,MOD)*b_sum;
      |     ~~                    
a.cc:31:12: error: 'res' was not declared in this scope
   31 |     sum += res%MOD;
      |            ^~~
Language: C++

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

using ll = long long;
const int mod = 1e9+7;
int main(void){
    // Your code here!
    int n;
    cin >> n;
    long long a[n];
    for (int i=0; i<n; i++){
        cin >> a[i];
    }
    
    long long ans = 0;
    long long digit = 1;
    for (int i=0; i<60; i++){
        long long one = 0, long long = 0;
        for (int j=0; j<n; j++){
            if((1LL << i) & a[j]) one++;
            else zero++;
        }
        long long add = (one * zero) % mod * digit % mod;
        ans = (ans + add) % mod;
        digit = (digit * 2) % mod;
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:28: error: expected unqualified-id before 'long'
   18 |         long long one = 0, long long = 0;
      |                            ^~~~
a.cc:21:18: error: 'zero' was not declared in this scope; did you mean 'bzero'?
   21 |             else zero++;
      |                  ^~~~
      |                  bzero
a.cc:23:32: error: 'zero' was not declared in this scope; did you mean 'bzero'?
   23 |         long long add = (one * zero) % mod * digit % mod;
      |                                ^~~~
      |                                bzero
Language: C++

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

signed main(){
    int N; cin >> N;
    vector<ll> a(N);
    for(int i = 0; i < N; i++) cin >> a[i];
    ll ans = 0;
    for(int digit = 0; digit <= 60; digit++){
        int c0 = 0, c1 = 0;
        for(int i = 0; i < N; i++){
            if(1 & (a[i] >> digit)) c1++;
            else c0++;
        }
        ll tmp = (1ll << digit) % MOD;
        int c = c0 * c1 %MOD;
        tmp = tmp * c % MOD;
        ans += tmp;
        ans %= MOD;
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:35: error: 'MOD' was not declared in this scope
   16 |         ll tmp = (1ll << digit) % MOD;
      |                                   ^~~
Language: C++

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

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

int main(){
	int n; scanf("%lld", &n);
	vector<ll> a(n);
	for(int i = 0; i < n; i++) scanf("%lld", &a[i]);
	vector<int> data(61, 0);
	for(int i = 0; i < n; i++){
		for(int j = 0; j <= 60; j++){
			if(a[i] & (1LL << j)) data[j]++;
		}
	}
	ll ans = 0;
	for(int i = 0; i <= 60; i++){
		(ans += data[i] * (n - data[i]) * modpow(2, i)) %= MOD;
	}
	printf("%lld\n", ans);
}


Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

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

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

int main(){
	int n; scanf("%d", &n);
	vector<ll> a(n);
	for(int i = 0; i < n; i++) scanf("%lld", &a[i]);
	vector<int> data(61, 0);
	for(int i = 0; i < n; i++){
		for(int j = 0; j <= 60; j++){
			if(a[i] & (1LL << j)) data[j]++;
		}
	}
	ll ans = 0;
	for(int i = 0; i <= 60; i++){
		(ans += data[i] * (n - data[i]) * modpow(2, i)) %= MOD;
	}
	printf("%lld\n", ans);
}


Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#ifdef _WIN32
#include "XOR.h"
#endif

#include <stdio.h>

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

constexpr int64_t MOD = 1'000'000'007;
constexpr int64_t help = 1;

#define ll long long int

void fastscan(ll& number) {
	//variable to indicate sign of input number 
	int c;

	number = 0;

	// extract current character from buffer 
	c = getchar();

	// Keep on extracting characters if they are integers 
	// i.e ASCII Value lies from '0'(48) to '9' (57) 
	for (; (c > 47 && c < 58); c = getchar())
		number = number * 10 + c - 48;

	// if scanned input has a negative sign, negate the 
	// value of the input number 
}
#ifdef _WIN32
namespace XOR
{
#endif 

	int main() {
		int64_t n;

		fastscan(n);


		std::array<uint64_t, 62> bits{};
		for (int64_t i = 0; i < n; i++) {
			int64_t d;
			fastscan(d);
			for (int64_t b = 0; b < 62; b++) {
				bits[b] += !!(d & (help << b));
			}
		}

		int64_t ans = 0;

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

		std::cout << ans;
	}
#ifdef _WIN32
}
#endif 


Compiler output:
a.cc: In function 'int main()':
a.cc:41:26: error: cannot bind non-const lvalue reference of type 'long long int&' to a value of type 'int64_t' {aka 'long int'}
   41 |                 fastscan(n);
      |                          ^
a.cc:16:19: note:   initializing argument 1 of 'void fastscan(long long int&)'
   16 | void fastscan(ll& number) {
      |                   ^
a.cc:44:28: error: 'uint64_t' was not declared in this scope
   44 |                 std::array<uint64_t, 62> bits{};
      |                            ^~~~~~~~
a.cc:10:1: note: 'uint64_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
    9 | #include <array>
  +++ |+#include <cstdint>
   10 | 
a.cc:44:40: error: template argument 1 is invalid
   44 |                 std::array<uint64_t, 62> bits{};
      |                                        ^
a.cc:47:34: error: cannot bind non-const lvalue reference of type 'long long int&' to a value of type 'int64_t' {aka 'long int'}
   47 |                         fastscan(d);
      |                                  ^
a.cc:16:19: note:   initializing argument 1 of 'void fastscan(long long int&)'
   16 | void fastscan(ll& number) {
      |                   ^
a.cc:49:37: error: invalid types 'int[int64_t {aka long int}]' for array subscript
   49 |                                 bits[b] += !!(d & (help << b));
      |                                     ^
a.cc:57:37: error: invalid types 'int[int64_t {aka long int}]' for array subscript
   57 |                         ans += (bits[b] * (n - bits[b]) % MOD) * p;
      |                                     ^
a.cc:57:52: error: invalid types 'int[int64_t {aka long int}]' for array subscript
   57 |                         ans += (bits[b] * (n - bits[b]) % MOD) * p;
      |                                                    ^
Language: C++

#include <stdio.h>

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

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

int main() {
	int n;

	scanf("%d", &n);

	std::cout << n;

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

	uint64_t ans = 0;

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

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


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