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

#include<iostream>
#include<algorithm>
#include<queue>
#include<vector>
#include<cmath>

using namespace std;

int n, k;
long long a[100010];
long long f[1000000000000];
vector<long long> V;
priority_queue<long long>Q;
long long answer;

long long maxi(int b[]){
  long long maximum = 0;
  for(int i = 0; i < n;++i){
    if(b[i] < maximum){
      maximum = b[i];
    }
  }
  return maximum;
}

int main(){
  cin >> n >> k;
  for(int i = 0; i < n; ++i){
    cin >> a[i];
    
  }
  for(int j = 0; j <= k; ++j){
    f[j] = 0;
    for(int i = 0; i < n; ++i){
       f[j] += (a[i] ^ j);
    }
    //V.push_back(f[j]);
    Q.push(f[j]);
    //cout << f[j] << endl;
    
  }
  //sort(V.begin(), V.end());
  //cout << V.back() << endl;
  cout << Q.top() << endl;
  
}

Compiler output:
/tmp/ccdHc9sA.o: in function `main':
a.cc:(.text+0x192): relocation truncated to fit: R_X86_64_PC32 against symbol `Q' defined in .bss section in /tmp/ccdHc9sA.o
a.cc:(.text+0x1b4): relocation truncated to fit: R_X86_64_PC32 against symbol `Q' defined in .bss section in /tmp/ccdHc9sA.o
/tmp/ccdHc9sA.o: in function `__static_initialization_and_destruction_0()':
a.cc:(.text+0x1f5): relocation truncated to fit: R_X86_64_PC32 against symbol `V' defined in .bss section in /tmp/ccdHc9sA.o
a.cc:(.text+0x20e): relocation truncated to fit: R_X86_64_PC32 against symbol `V' defined in .bss section in /tmp/ccdHc9sA.o
a.cc:(.text+0x227): relocation truncated to fit: R_X86_64_PC32 against symbol `Q' defined in .bss section in /tmp/ccdHc9sA.o
a.cc:(.text+0x240): relocation truncated to fit: R_X86_64_PC32 against symbol `Q' defined in .bss section in /tmp/ccdHc9sA.o
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>
#include<algorithm>
#include<queue>
#include<vector>
#include<cmath>

using namespace std;

int n, k;
long long a[100010];
long long f[1000000000005];
vector<long long> V;
priority_queue<long long>Q;
long long answer;

long long maxi(int b[]){
  long long maximum = 0;
  for(int i = 0; i < n;++i){
    if(b[i] < maximum){
      maximum = b[i];
    }
  }
  return maximum;
}

int main(){
  cin >> n >> k;
  for(int i = 0; i < n; ++i){
    cin >> a[i];
    
  }
  for(int j = 0; j <= k; ++j){
    f[j] = 0;
    for(int i = 0; i < n; ++i){
       f[j] += (a[i] ^ j);
    }
    //V.push_back(f[j]);
    Q.push(f[j]);
    //cout << f[j] << endl;
    
  }
  //sort(V.begin(), V.end());
  //cout << V.back() << endl;
  cout << Q.top() << endl;
  
}

Compiler output:
/tmp/ccnrLBuI.o: in function `main':
a.cc:(.text+0x192): relocation truncated to fit: R_X86_64_PC32 against symbol `Q' defined in .bss section in /tmp/ccnrLBuI.o
a.cc:(.text+0x1b4): relocation truncated to fit: R_X86_64_PC32 against symbol `Q' defined in .bss section in /tmp/ccnrLBuI.o
/tmp/ccnrLBuI.o: in function `__static_initialization_and_destruction_0()':
a.cc:(.text+0x1f5): relocation truncated to fit: R_X86_64_PC32 against symbol `V' defined in .bss section in /tmp/ccnrLBuI.o
a.cc:(.text+0x20e): relocation truncated to fit: R_X86_64_PC32 against symbol `V' defined in .bss section in /tmp/ccnrLBuI.o
a.cc:(.text+0x227): relocation truncated to fit: R_X86_64_PC32 against symbol `Q' defined in .bss section in /tmp/ccnrLBuI.o
a.cc:(.text+0x240): relocation truncated to fit: R_X86_64_PC32 against symbol `Q' defined in .bss section in /tmp/ccnrLBuI.o
collect2: error: ld returned 1 exit status
Language: Java

import java.util.Scanner;

public class Main2 {
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        int[] A = new int[N];
        for(int i = 0; i < N; i++){
            A[i] = sc.nextInt();
        }
        int max = 0;
        for(int i = 0; i <= K; i++){
            int sum = 0;
            for(int j = 0; j < N; j++){
                int xor = i ^ A[j];
                sum += xor;
            }
            if(max < sum){
                max = sum;
            }
        }
        System.out.println(max);
    }
}

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

n, k = gets.chomp.split(" ").map(&:to_i)
a = gets.chomp.split(" ").map(&:to_i)
bin = []
ans = []
bb =0
while k >0
  k =k/2
  bb +=1
end

200.times do
 bin << 0
end

a.each do |n|
  i =0
  n.to_s(2).split("").reverse.each do |m|
    bin[i] += m.to_i
    i += 1
  end
end

# puts a.length
ave = a.length / 2


bin.each do |n|
  if n >ave
    ans << 0
  else
    ans << 1
  end
end

ans2 = []
i = 0
bb.times do
  ans2 << ans[i]
  i +=1
end
ans2 = ans2.reverse.join.to_i(2)

sum = 0

a.each do |n|
  sum += n ^ ans2
end
puts sum


Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | n, k = gets.chomp.split(" ").map(&:to_i)
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
main.c:1:4: error: type defaults to 'int' in declaration of 'k' [-Wimplicit-int]
    1 | n, k = gets.chomp.split(" ").map(&:to_i)
      |    ^
main.c:1:8: error: 'gets' undeclared here (not in a function)
    1 | n, k = gets.chomp.split(" ").map(&:to_i)
      |        ^~~~
main.c:1:35: error: expected expression before ':' token
    1 | n, k = gets.chomp.split(" ").map(&:to_i)
      |                                   ^
main.c:2:1: error: expected ',' or ';' before 'a'
    2 | a = gets.chomp.split(" ").map(&:to_i)
      | ^
main.c:11:1: error: invalid suffix "times" on floating constant
   11 | 200.times do
      | ^~~~~~~~~
main.c:23:3: error: invalid preprocessing directive #puts
   23 | # puts a.length
      |   ^~~~
Language: C++

#include <iostream>
#include <string>
#include <cstdlib>
#include <vector>
#include <sstream>
#include <set>
#include <tuple>
#include <algorithm>
#include <memory>
#include <numeric>
#include <queue>
#include <functional>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef pair<ll, P> PP;

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

	ll N, K;
	cin >> N >> K;



	ll bit_max = 0;
	if (K != 0)
	{
		ll t = K;
		ll tt = 0;
		while (true)
		{
			if (t == 0)
			{
				break;
			}
			t /= 2;
			tt++;
		}

		bit_max = tt;
	}

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

	for (ll i = 0; i < N; ++i)
	{
		//cout << A[i] << endl;
		ll t = A[i];
		ll tt = 0;
		while (true)
		{
			if (t == 0)
			{
				break;
			}
			t /= 2;
			tt++;
		}

		bit_max = max(bit_max, tt);
	}

	vector<P> points; // point, risk

	//ll sum = 0;
	//ll sum_bak = 0;
	//ll bit_idx = bit_max+1;

	//ll tmp_X = 0;

	for (ll bit_idx = 0; bit_idx < bit_max; ++bit_idx)
	{
		ll n_on = 0;
		for (ll i = 0; i < N; ++i)
		{
			n_on += (A[i] & (1 << bit_idx)) >> bit_idx;
		}

		//cout << n_on << endl;

		if (n_on * 2 > N)
		{
			// should be 0
			points.emplace_back(pow(2, bit_idx) * n_on, 0);
		}
		else
		{
			// should be 1
			//sum += pow(2, bit_idx) * (N - n_on);
			points.emplace_back(pow(2, bit_idx) * (N - n_on), pow(2, bit_idx));
		}

		//cout << n_on << endl;
		//cout << sum << endl;

		//bit_idx--;
	}

	sort(points.begin(), points.end(), std::greater<P>());

	ll tmp_X = 0;
	ll sum = 0;

	for (const auto& p : points)
	{
		//cout << p.first << " " << p.second << endl;
	}


	for (const auto& p : points)
	{
		if (tmp_X + p.second > K)
		{
			continue;
		}

		sum += p.first;
		//cout << p.first << " " << p.second << endl;
	}


	cout << sum << endl;
	//cout << N << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:94:45: error: 'pow' was not declared in this scope
   94 |                         points.emplace_back(pow(2, bit_idx) * n_on, 0);
      |                                             ^~~
a.cc:100:45: error: 'pow' was not declared in this scope
  100 |                         points.emplace_back(pow(2, bit_idx) * (N - n_on), pow(2, bit_idx));
      |                                             ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
typedef pair<ll,ll> P;
#define MOD 1000000007
int main(){
  ll n,k;
  cin>>n>>k;
  vector<ll> a(n),b(n);
  for(int i=0;i<n;i++){
    cin>>a[i];
    b[i]=a[i];
  }
  if(k==0){
    ll c=0;
    for(int i=0;i<n;i++) c+=a[i];
    cout<<c;
    return 0;
  }
  sort(a.begin(),a.end());
  reverse(a.begin(),a.end());
  ll x=max(a[0],k);
  ll c=0;
  while(x!=0){
    x/=2;
    c++;
  }
  vector<ll> d(c,0);
  for(int i=0;i<n;i++){
    for(int j=0;j<c;j++){
      if(b[i]%2==1) d[j]++;
      b[i]/=2;
    }
  }
  x=k;
  ll cnt=0;
  while(x!=0){
    x/=2;
    cnt++;
  }
  x=a[0];
  ll cn=0;
  while(x!=0){
    x/=2;
    cn++;
  }
  vector<ll> f(c);
  x=k;
  for(int i=0;i<c;i++){
    f[i]=x%2;
    x/=2;
  }
  ll x=1,me=0;
  for(int i=0;i<c;i++){
    if(i<cnt-1){
      me+=max(d[i],n-d[i])*x;
      x*=2;
    }else{
      me+=d[i]*x;
      x*=2;
    }
  }
  ll mem=0;
  x/=2;
  bool bo=false;
  for(int i=c-1;i>=0;i--){
    if(bo){
      mem+=max(d[i],n-d[i])*x;
      x/=2;
    }else{
      if(f[i]==0){
        mem+=d[i]*x;
        x/=2;
      }else{
        if(d[i]<n-d[i]){
          mem+=(n-d[i])*x;
          x/=2;
        }else{
          mem+=max(d[i],n-d[i])*x;
          x/=2;
          bo=true;
        }
      }
    }
  }
  cout<<max(me,mem);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:53:6: error: redeclaration of 'long long int x'
   53 |   ll x=1,me=0;
      |      ^
a.cc:22:6: note: 'long long int x' previously declared here
   22 |   ll x=max(a[0],k);
      |      ^
Language: C++

#include <bits/stdc++.h>
 
#define INT_INF (2 * 1e9)
#define LL_INF  (2LL * 1e18)
#define FAST_IO ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
#ifdef __LOCAL
#define DBG(X) cout << #X << "=" << (X) << endl;
#else
#define DBG(X)
#endif
 
using namespace std;
 
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const ll mod = 1e9 + 7;

#define ll ull

vector<ll> a;

ll f(ll val)
{
	ll ret = 0;

	for(auto el: a)
		ret += (el ^ val);

	return ret;
}

void solve()
{
	int n;
    ll k;
	cin >> n >> k;

	a.resize(n);

	for(auto& el: a)
		cin >> el;

	ll best = 0;

	for(ll msk = 1; msk <= k; msk <<= 1LL)
		if(f(msk) > f(0))
			best |= msk;

	/*if(best <= k)
	{
		cout << f(best) << endl;

		return;
	}

	ll ans = 0;

	for(ll msk = 1; msk <= best; msk <<= 1LL)
	{
		ll nans = (best & (~msk));

		if(nans <= k)
		{
			if(f(nans) > f(ans))
				ans = nans;
		}
	}

	DBG(best);
	DBG(ans);*/

	ans = best & k;

	cout << f(ans) << endl;
}

int main(int argc, char** argv)
{
	FAST_IO;
	solve();

	return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:76:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   76 |         ans = best & k;
      |         ^~~
      |         abs
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main()
{
	int i, j;
	int n;
	long long k;

	cin >> n >> k;

	vector<long long> a;
	a.resize(n);

	long long max = 0;

	for (i = 0; i < n; i++)
	{
		cin >> a[i];

		if (max < a[i])
		{
			max = a[i];
		}
	}

	int p = 1;
	int p2 = 1;

	while (true)
	{
		max /= 2;

		if (max <= 0)
		{
			break;
		}

		p++;
	}

	if (k == 0)
	{
		p2 = 0;
	}
	else
	{
		long long tempK = k;

		while (true)
		{
			tempK /= 2;

			if (tempK <= 0)
			{
				break;
			}

			p2++;
		}
	}

	vector<int> num;
	num.resize(p);

	for (j = 0; j < p; j++)
	{
		num[j] = 0;
	}

	for (i = 0; i < n; i++)
	{
		for (j = 0; j < p; j++)
		{
			if ((a[i] & (long long)(pow(2, j))) != 0)
			{
				num[j]++;
			}
		}
	}

	float temp = n / 2.0f;

	long  long result = 0;
	long long r;

	long long now = 0;

	for (i = p2-1; i >= p; i--)
	{
		r = pow(2, i);

		if (now + r <= k)
		{
			now += r;
			result += r * n;
		}
	}

	for (i = p - 1; i >= 0; i--)
	{
		if (num[i] < temp)
		{
			r = pow(2, i);

			if(now + r <= k)
			{
				result += r * (n - num[i]);
				now += r;
			}
		}
		else
		{
			result += pow(2, i) * num[i];
		}
	}

	printf("%lld", result);

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:77:49: error: 'pow' was not declared in this scope
   77 |                         if ((a[i] & (long long)(pow(2, j))) != 0)
      |                                                 ^~~
a.cc:93:21: error: 'pow' was not declared in this scope; did you mean 'now'?
   93 |                 r = pow(2, i);
      |                     ^~~
      |                     now
a.cc:106:29: error: 'pow' was not declared in this scope; did you mean 'now'?
  106 |                         r = pow(2, i);
      |                             ^~~
      |                             now
a.cc:116:35: error: 'pow' was not declared in this scope; did you mean 'now'?
  116 |                         result += pow(2, i) * num[i];
      |                                   ^~~
      |                                   now
Language: C++

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

using namespace std;
int main(){
    //int i = 1^4;
    //cout << i << endl;
    unsigned int n,k;
    cin >> n >> k;
    vector<unsigned int> a(n);
    for(unsigned int i = 0;i < n;i++){
        cin >> a[i];
    }
    vector<unsigned int> sum(k+1);
    unsigned int reuslt = 0;
    for(unsigned int x = 0;x <= k;x++){
        sum[x] = 0;
        for(unsigned int i = 0;i < n;i++){
            sum[x] += x^a[i];
        }
        if(result < sum[x]) result = sum[x];
    }
    cout << sum[k] << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:12: error: 'result' was not declared in this scope; did you mean 'reuslt'?
   22 |         if(result < sum[x]) result = sum[x];
      |            ^~~~~~
      |            reuslt
Language: C++

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

int N;
long long K,KK = 1e12,ans = 0;

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cin >> N >> K;
	vector<long long> A(N);

	for(auto &x : A){
		cin >> x;
	}
	long long key = 0;
	if(K > 1){
		key++;
		while(key <= K){
			key <<= 1;
		}
		key >>= 1;
	}

	while(key <= K){
		int temp = 0;
		REP(i,N){
			temp += key^A[i];
		}
		ans = max(temp,ans);
		key++;
	}
	
	cout << ans << endl;
//  cout << key << endl;

}

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

#include <iostream>
#include <vector>
#include <numeric>
#include <climits>

using namespace std;

int main(void) {

    long long n,k;

    cin >> n >> k;

    vector<long long > a;
    for(int i =0 ; i< n; i++) {
        long long ae;
        cin >> ae;

        // cout << i << " " << ae << endl;
        a.push_back(ae);
    }

    if (k == 0) {

        long long sum =0;
        for(const long long& ai : a) {
                // cout <<"inner:"<< ai << endl;
                sum += ai;
        }

        
        cout << sum << endl;
        return 0;
    }

    long long max = 0;
    for (long long  x = 0; x <= k; x++) {

        long long sum = 0;

        for(const long long& ai: a) {
            sum += x ^ ai;
        }

        if (sum > max) {
            max = sum;
        }
    }

    cout << max << endl;


Compiler output:
a.cc: In function 'int main()':
a.cc:50:25: error: expected '}' at end of input
   50 |     cout << max << endl;
      |                         ^
a.cc:8:16: note: to match this '{'
    8 | int main(void) {
      |                ^
Language: C++

#include<cstdio>
#include<iostream>
#include<queue>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<stack>
#include<bitset>
#define int long long
using namespace std;
int a[100001],rem[100001],num[1001];
//int dp[1001];
int n,k;
int dfs(int cur,int d)
{
//	if(d==0&&dp[cur])
//		return dp[cur];
	if(cur==0)
		return 0;
	int ans=0;
	if(d==1&&num[cur]==0)
		ans=dfs(cur-1,d)+rem[cur]*(pow(2,cur-1));
	else if(d==1)
	{
		ans=dfs(cur-1,1)+(n-rem[cur])*(pow(2,cur-1));
		int t=dfs(cur-1,0)+rem[cur]*(pow(2,cur-1));
		ans=max(ans,t);
	}
	else
	{
		ans=dfs(cur-1,0)+(n-rem[cur])*(pow(2,cur-1));
		int t=dfs(cur-1,0)+rem[cur]*(pow(2,cur-1));
		ans=max(ans,t);
		dp[cur]=ans;
	}
	return ans;
}
signed main()
{
	scanf("%lld%lld",&n,&k);
	for(int i=1;i<=n;i++)
		scanf("%lld",&a[i]);
	for(int i=1;i<64;i++)
	{
		int cur=pow(2,i-1);
		for(int j=1;j<=n;j++)
		{
			int t=a[j]&cur;
			if(t)
				rem[i]++;
		}
	}
	int now=0;
	while(k)
	{
		num[++now]=k&1;
		k>>=1;
	}
	printf("%lld",dfs(63,1));
	return 0;
}

Compiler output:
a.cc: In function 'long long int dfs(long long int, long long int)':
a.cc:34:17: error: 'dp' was not declared in this scope; did you mean 'd'?
   34 |                 dp[cur]=ans;
      |                 ^~
      |                 d
Language: C++

    #include <bits/stdc++.h>
    using namespace std;
        
    int main()
    {
        int N, K; cin >> N >> K;
        int sum = 0;
        cin >> N;
        while(n--) {
            int A; cin >> A;
            sum +=  K ^ A;
        }
        cout << sum << endl;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:9:15: error: 'n' was not declared in this scope
    9 |         while(n--) {
      |               ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
    
int main()
{
    int n, k; cin >> n >> k;
    int sum = 0;
    cin >> n;
    while(n--) {
        int A; cin >> A;
        sum +=  K ^ A;
    }
    cout << sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: 'K' was not declared in this scope
   11 |         sum +=  K ^ A;
      |                 ^
Language: C

#include <iostream>
#include <algorithm>
#include <bitset>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <cstring>
#include <utility>
#include <vector>
#include <complex>
#include <valarray>
#include <fstream>
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
#include <numeric>

#define rep(X,Y) for (int (X) = 0;(X) < (Y);++(X))
#define rrep(X,Y) for (int (X) = Y-1;(X) >= 0;--(X))
#define repa(X,A,Y) for (int (X) = A;(X) <= (Y);++(X))
#define all(X) (X).begin(),(X).end()
#define mod(n, m) (((n)%(m)+(m))%m)
#define fi first
#define sc second
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;
const int INFINT = 1 << 30;                          // 1.07x10^ 9
const ll INFLL = 1LL << 60;                          // 1.15x10^18
const double EPS = 1e-10;
const int MOD = 1000000007;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};

const int MAX_N = 100000;
int N;
ll K;
ll A[MAX_N];
int bit[62];

ll my_pow(ll x, ll n) {
  if (n == 0) return 1;
  ll res = pow(x*x, n/2);
  if (n & 1) res *= x;
  return res;
}

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

  cin >> N >> K;
  rep(i, N) cin >> A[i];

  for (int i = 0; i < N; ++i) {
      int tmp = 0;
      while ((A[i]>>tmp) > 0) {
          if (((A[i]>>tmp)&1) == 1) ++bit[tmp];
          ++tmp;
      }
  }


  vector<int> flag;
  ll tmp_k = K;
  int tmp_bit = 0;
  while ((tmp_k>>tmp_bit) > 0) {
      if (((tmp_k>>tmp_bit)&1) == 1) flag.push_back(tmp_bit);
      ++tmp_bit;
  }
  ll ans = 0;
  for (int i = 0; i < 62; ++i) {
      ans += bit[i] * my_pow(2, i);
  }

  for (int i = 0; i < flag.size(); ++i) {
     int b = flag[i];
     ll tmp_ans = 0;
     for (int k = 0; k < 62; ++k) {
         if (k < b) {
             tmp_ans += max(N-bit[k], bit[k]) * my_pow(2, k);
         } else if (k == b) {
             tmp_ans += bit[k] * my_pow(2, k);
         } else {
             if ((K>>k)&1 == 1) {
                 tmp_ans += (N-bit[k]) * my_pow(2, k);
             } else {
                 tmp_ans += bit[k] * my_pow(2, k);
             }
         }
     }
     ans = max(ans, tmp_ans);
  }

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


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

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

int nth_bit(int64_t num, int n){
    return (num >> n) & 1;
}

int main(){
    int N;
    int64_t K, A[100000];
    cin >> N >> K;
    for(int i=0; i<N; i++) cin >> A[i];

    int64_t opt = 0, opt_less = -1e18;

    for(int d=40; d>=0; d--){
        int num1 = 0;
        for(int i=0; i<N; i++) if(nth_bit(A[i], d)) num1++;
        int num0 = N - num1;

        opt_less += (1LL<<d) * max(num0, num1);
        
        if(nth_bit(K, d)){
            opt_less = max(opt_less, opt + (1LL<<d) * num1);
            opt += (1LL<<d) * max(num0, num1);
        }else{
            opt += (1LL<<d) * num1;
        }
    }

    cout << max(opt, opt_less) << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:27: error: no matching function for call to 'max(int64_t&, long long int)'
   24 |             opt_less = max(opt_less, opt + (1LL<<d) * num1);
      |                        ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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:24:27: note:   deduced conflicting types for parameter 'const _Tp' ('long int' and 'long long int')
   24 |             opt_less = max(opt_less, opt + (1LL<<d) * num1);
      |                        ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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:24:27: note:   mismatched types 'std::initializer_list<_Tp>' and 'long int'
   24 |             opt_less = max(opt_less, opt + (1LL<<d) * num1);
      |                        ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: Java

import java.util.Arrays;
import java.util.Scanner;

public class D {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int N=sc.nextInt();
		int K=sc.nextInt();
		int[] A=new int[N];

		for(int i=0;i<N;i++) {
			A[i]=sc.nextInt();
		}
		Arrays.sort(A);
		for(int i=0;i<N;i++) {
			System.err.println (A[i]);
		}
		int max=0;
		for(int k=0;k<K;k++) {
			int tmp=0;
			for(int i=0;i<N;i++) {
				tmp+=A[i]^k;
			}
			if(tmp>max)max=tmp;
		}
		System.out.println(max);
	}

}


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

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> iint;
typedef pair<ll,ll> llll;
#define ALL(x) (x).begin(),(x).end()
const ll zero = 0;
const ll one = 1;
const ll INF = 9223372036854775807; //10^18
const int inINF = 2147483647; //10^9
const ll MOD = 1000000007; //10^9+7
const ll MOD2 = 998244353;
void Yes() {printf("Yes\n");}
void No() {printf("No\n");}
void YES() {printf("YES\n");}
void NO() {printf("NO\n");}

int main(){
    int x,y;
    cin >> x >> y;
    printf("%d %d\n", min(x,y), max(x+y-n,0));
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:41: error: 'n' was not declared in this scope
   22 |     printf("%d %d\n", min(x,y), max(x+y-n,0));
      |                                         ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
 
int main(){
    
  ll n,a,b;
  cin >> n >> a >> b;
  cout << min(a,b) << " " << max(0, (a+b)-n);
 
}





Compiler output:
a.cc: In function 'int main()':
a.cc:10:33: error: no matching function for call to 'max(int, ll)'
   10 |   cout << min(a,b) << " " << max(0, (a+b)-n);
      |                              ~~~^~~~~~~~~~~~
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:10:33: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   10 |   cout << min(a,b) << " " << max(0, (a+b)-n);
      |                              ~~~^~~~~~~~~~~~
/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:10:33: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   10 |   cout << min(a,b) << " " << max(0, (a+b)-n);
      |                              ~~~^~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
 
int main(){
    
  ll n,a,b;
  cin >> n >> a >> b;
  cout << min(a,b) << " " << max(0, (a+b)-n)
 
}





Compiler output:
a.cc: In function 'int main()':
a.cc:10:33: error: no matching function for call to 'max(int, ll)'
   10 |   cout << min(a,b) << " " << max(0, (a+b)-n)
      |                              ~~~^~~~~~~~~~~~
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:10:33: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   10 |   cout << min(a,b) << " " << max(0, (a+b)-n)
      |                              ~~~^~~~~~~~~~~~
/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:10:33: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   10 |   cout << min(a,b) << " " << max(0, (a+b)-n)
      |                              ~~~^~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, from, to) for (int i = from; i < (to); ++i)
#define mp(x,y) make_pair(x,y)
#define all(x) (x).begin(),(x).end()
#define pb push_back
using ll = long long;
using vin=vector<int>;
using vll=vector<ll>;
using vst=vector<string>;
using P = pair<int, int>;
const int inf=1e9+7;
const ll INF=1e18;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b); }
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
const int dx[4] = { 1, 0, -1, 0 };
const int dy[4] = { 0, 1, 0, -1 };


int main(){cout<<fixed<<setprecision(10);
		   int a,b;
           cin>>a>>b;
           cout<<min(a,b)<<" "<<max(0,a+b-n)<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:43: error: 'n' was not declared in this scope
   26 |            cout<<min(a,b)<<" "<<max(0,a+b-n)<<endl;
      |                                           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N, A, B;
  cin >> N >> A >> B;
  cout << min(A, B) << " ";
  if (A + B - N > 0)  {
    cout << A + B - N << endl;
  }
  else {
    cout << 0 << endl;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:13:4: error: expected '}' at end of input
   13 |   }
      |    ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int a,b;
  cin>>a>>b>>c;
  cout<<min(b,c)<<" "<<(b+c-a<=0 0:b+c-a)<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:14: error: 'c' was not declared in this scope
    5 |   cin>>a>>b>>c;
      |              ^
a.cc:6:33: error: expected ')' before numeric constant
    6 |   cout<<min(b,c)<<" "<<(b+c-a<=0 0:b+c-a)<<endl;
      |                        ~        ^~
      |                                 )
Language: C

#include <stdio.h>
 
int main (void)
{
 int N,a,b;
 
scanf("%d",&N);
scanf("%d",&a);
scanf("%d",&b);
 
printf("%d",(a<b?a;b));
 
if(N<(a+b))
printf("  0");
else
printf("  %d",(a+b)-N);
 
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:19: error: expected ':' before ';' token
   11 | printf("%d",(a<b?a;b));
      |                   ^
      |                   :
Language: C

#include <stdio.h>
 
int main (void)
{
 int N,a,b;
 
scanf("%d",&N);
scanf("%d",&a);
scanf("%d",&b);
 
pirntf("%d",(a<b?a;b));
 
if(N<(a+b))
printf("  0");
eise
printf("  %d",(a+b)-N);
 
return 0;
}
#include <stdio.h>

int main (void)
{
 int N,a,b;

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

printf("%d",(a<b?a;b));

if(N<(a+b))
printf("  0");
else
printf("  %d",(a+b)-N);

return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:1: error: implicit declaration of function 'pirntf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   11 | pirntf("%d",(a<b?a;b));
      | ^~~~~~
      | printf
main.c:11:19: error: expected ':' before ';' token
   11 | pirntf("%d",(a<b?a;b));
      |                   ^
      |                   :
main.c:15:1: error: unknown type name 'eise'
   15 | eise
      | ^~~~
main.c:16:8: error: expected declaration specifiers or '...' before string constant
   16 | printf("  %d",(a+b)-N);
      |        ^~~~~~
main.c:16:15: error: expected declaration specifiers or '...' before '(' token
   16 | printf("  %d",(a+b)-N);
      |               ^
main.c: At top level:
main.c:22:5: error: redefinition of 'main'
   22 | int main (void)
      |     ^~~~
main.c:3:5: note: previous definition of 'main' with type 'int(void)'
    3 | int main (void)
      |     ^~~~
main.c: In function 'main':
main.c:30:19: error: expected ':' before ';' token
   30 | printf("%d",(a<b?a;b));
      |                   ^
      |                   :
Language: C

#include <stdio.h>

int main (void)
{
 int N,a,b;

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

pirntf("%d",(a<b?a;b));

if(N<(a+b))
printf("  0");
eise
printf("  %d",(a+b)-N);

return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:1: error: implicit declaration of function 'pirntf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   11 | pirntf("%d",(a<b?a;b));
      | ^~~~~~
      | printf
main.c:11:19: error: expected ':' before ';' token
   11 | pirntf("%d",(a<b?a;b));
      |                   ^
      |                   :
main.c:15:1: error: unknown type name 'eise'
   15 | eise
      | ^~~~
main.c:16:8: error: expected declaration specifiers or '...' before string constant
   16 | printf("  %d",(a+b)-N);
      |        ^~~~~~
main.c:16:15: error: expected declaration specifiers or '...' before '(' token
   16 | printf("  %d",(a+b)-N);
      |               ^
Language: C++

//#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
#define PI 3.14159265359
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
const long long INF= 1e+18+1;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll> >vvl;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> T;
const ll MOD=1000000007LL;
string abc="abcdefghijklmnopqrstuvwxyz";
string ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
int main(){
  ll n,a,b;
  cout<<max(a,b)<<" "<<max(a+b-n,0)<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:27: error: no matching function for call to 'max(ll, int)'
   17 |   cout<<max(a,b)<<" "<<max(a+b-n,0)<<endl;
      |                        ~~~^~~~~~~~~
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:2:
/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:17:27: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   17 |   cout<<max(a,b)<<" "<<max(a+b-n,0)<<endl;
      |                        ~~~^~~~~~~~~
/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:17:27: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   17 |   cout<<max(a,b)<<" "<<max(a+b-n,0)<<endl;
      |                        ~~~^~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
#define all(x) (x).begin(), (x).end()
#define endl '\n'
#define fsp(x) cout << fixed << setprecision(x)
const ll inf = LLONG_MAX;
const long double pi = M_PI;
void Yes() {cout << "Yes" << endl;}
void No() {cout << "No" << endl;}
void YES() {cout << "YES" << endl;}
void NO() {cout << "NO" << endl;}

int main() {
  ll n, a, b;
  cin >> n >> a >> b;
  cout << min(a, b) << " " << abs(min(n - a - b, 0)) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:38: error: no matching function for call to 'min(ll, int)'
   18 |   cout << min(a, b) << " " << abs(min(n - a - b, 0)) << endl;
      |                                   ~~~^~~~~~~~~~~~~~
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:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:18:38: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   18 |   cout << min(a, b) << " " << abs(min(n - a - b, 0)) << endl;
      |                                   ~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281: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:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:18:38: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   18 |   cout << min(a, b) << " " << abs(min(n - a - b, 0)) << endl;
      |                                   ~~~^~~~~~~~~~~~~~
Language: C++

#include<iostream>
#include<algotithm>
using namespace std;
int main(){
  int n,a,b;cin >> n >> a >> b;
  cout << min(a,b) << " " << a+b-n << endl;
}

Compiler output:
a.cc:2:9: fatal error: algotithm: No such file or directory
    2 | #include<algotithm>
      |         ^~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N,A,B;cin>>N>>A>>B;
  cout<<min(A,B)<<" "<<((A+B<=N?0:A+B-N))<< <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:45: error: expected primary-expression before '<<' token
    6 |   cout<<min(A,B)<<" "<<((A+B<=N?0:A+B-N))<< <<endl;
      |                                             ^~
Language: C++

using namespace std;

int main (){
  int N, A, B;
  cin >> N >> A >> B;
  
  if (A >= B){
    cout << A << endl;
  }
  else {
    cout << B << endl;
  }
  if (N >= A + B){
    cout << 0;
  }
  else if (A + B > N) {
    cout << A + B - N;
  }
  else {
    cout << N;
  }
 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin >> N >> A >> B;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:8:5: error: 'cout' was not declared in this scope
    8 |     cout << A << endl;
      |     ^~~~
a.cc:8:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:8:18: error: 'endl' was not declared in this scope
    8 |     cout << A << endl;
      |                  ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
a.cc:11:5: error: 'cout' was not declared in this scope
   11 |     cout << B << endl;
      |     ^~~~
a.cc:11:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:11:18: error: 'endl' was not declared in this scope
   11 |     cout << B << endl;
      |                  ^~~~
a.cc:11:18: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:14:5: error: 'cout' was not declared in this scope
   14 |     cout << 0;
      |     ^~~~
a.cc:14:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:17:5: error: 'cout' was not declared in this scope
   17 |     cout << A + B - N;
      |     ^~~~
a.cc:17:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:20:5: error: 'cout' was not declared in this scope
   20 |     cout << N;
      |     ^~~~
a.cc:20:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,a,b,x,y;
  cin >> n >> a >> b;
  if(a<b){
    x = a;
  }else{
    x = b:
  }
  if(a+b-n<0){
    y = 0;
  }else{
    y = a+b-n;
  }
  cout << x << y << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:10: error: expected ';' before ':' token
    9 |     x = b:
      |          ^
      |          ;
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,a,b,x,y;
  if(a<b){
    x = a;
  }else{
    x = b:
  }
  if(a+b-n<0){
    y = 0;
  }else{
    y = a+b-n;
  }
  cout << x << y << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:10: error: expected ';' before ':' token
    8 |     x = b:
      |          ^
      |          ;
Language: C++

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

using ll=long long; 

void solve(){
	int n,x,y;
	cin>>n>>x>>y;
	cout<<min(x,y)<<" "<max(0, x+y-n)<<endl;
}

signed main(){
	//while(1)
	solve();
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:9:42: error: invalid operands of types 'const int' and '<unresolved overloaded function type>' to binary 'operator<<'
    9 |         cout<<min(x,y)<<" "<max(0, x+y-n)<<endl;
      |                             ~~~~~~~~~~~~~^~~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

#define rep(i, N) for (int i = 0; i < (int)N; i++)
const ll MOD = pow(10,9)+7;
const ll LLINF = pow(2,61)-1;
const int INF = pow(2,30)-1;


int main() {
  int N, A, B; cin >> N >> A >> B;
  int rmax = max(A, B);
  int rmin = max(0,A+B-N);
  cout << result << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:11: error: 'result' was not declared in this scope
   16 |   cout << result << endl;
      |           ^~~~~~
Language: C++

#include<iostream>
int main(){
int a,b,c;std::cin>>a>>b>>c;
  std::cout<<std::min(b,c)<<" "<<std::max(0,b+c-a)<<"\n"
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:57: error: expected ';' before '}' token
    4 |   std::cout<<std::min(b,c)<<" "<<std::max(0,b+c-a)<<"\n"
      |                                                         ^
      |                                                         ;
    5 | }
      | ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0,i##_max=(N);i<i##_max;++i)
#define repp(i,l,r) for(int i=(l),i##_max=(r);i<i##_max;++i)
#define per(i,N) for(int i=(N)-1;i>=0;--i)
#define perr(i,l,r) for(int i=r-1,i##_min(l);i>=i##_min;--i)
#define all(arr) (arr).begin(), (arr).end()
#define SP << " " <<
#define SPF << " "
#define SPEEDUP cin.tie(0);ios::sync_with_stdio(false);
#define MAX_I INT_MAX //1e9
#define MIN_I INT_MIN //-1e9
#define MAX_UI UINT_MAX //1e9
#define MAX_LL LLONG_MAX //1e18
#define MIN_LL LLONG_MIN //-1e18
#define MAX_ULL ULLONG_MAX //1e19
  typedef long long ll;
  typedef pair<int,int> PII;
  typedef pair<char,char> PCC;
  typedef pair<ll,ll> PLL;
  typedef pair<char,int> PCI;
  typedef pair<int,char> PIC;
  typedef pair<ll,int> PLI;
  typedef pair<int,ll> PIL; 
  typedef pair<ll,char> PLC; 
  typedef pair<char,ll> PCL; 

inline void YesNo(bool b){ cout << (b?"Yes" : "No") << endl;}
inline void YESNO(bool b){ cout << (b?"YES" : "NO") << endl;}
inline void Yay(bool b){ cout << (b?"Yay!" : ":(") << endl;}

int main(void){
  SPEEDUP
  cout << setprecision(15);
  int N,X,Y;cin >> N >> X >> Y;
  cout << min(X,Y) SP << max(0,X+Y-N) << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:36:23: error: expected primary-expression before '<<' token
   36 |   cout << min(X,Y) SP << max(0,X+Y-N) << endl;
      |                       ^~