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

#include <bits/stdc++.h>
#define FOR(i, a, n) for(ll i = (ll)a; i < (ll)n; i++)
#define rep(i, n) FOR(i, 0, n)
#define REP(i, n) FOR(i, 1, ll(n) + 1)
#define ALL(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;

constexpr ll mod = 1e9 + 7;
constexpr ll inf = 1LL << 60;

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

/*-------------------------------------------*/

struct MAX {
    ll mx1, mx2;
    void f(const ll a) {
        if(mx1 < a) {
            mx2 = mx1;
            mx1 = a;
        } else
            chmax(mx2, a);
    }
    void f(const MAX m) {
        f(m.mx1);
        f(m.mx2);
    }
    ll sum() { return mx1 + mx2; }
};

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

    int n;
    cin >> n;

    vector<MAX> mx(1 << n);
    rep(i, 1 << n) {
        ll a;
        cin >> a;
        mx[i] = {a, -inf};
    }
    rep(j, n) {
        int x = 1 << j;
        rep(i, 1 << n) {
            if(!(i & x)) i |= x;
            mx[i].f(mx[i ^ x]);
        }
    }

    ll ret = 0;
    FOR(i, 1, 1 << n) {
        chmax(ret, mx[i].sum());
        cout << ret << endl;
    }

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

#pragma target("avx")
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef unordered_map<ll, ll> U_MAP;
typedef priority_queue<ll> pq;
typedef priority_queue<ll, vector<ll>, greater<ll>> rpq;
const int INF = 1e9, MOD = 1e9 + 7, ohara = 1e6 + 10;
const ll LINF = 1e18;

#define rep(i, n) for (ll(i) = 0; (i) < (int)(n); (i)++)
#define rrep(i, a, b) for (ll i = (a); i < (b); i++)
#define rrrep(i, a, b) for (ll i = (a); i >= (b); i--)
#define all(v) (v).begin(), (v).end()
#define Size(n) (n).size()
#define Cout(x) cout << (x) << endl
#define doublecout(a) cout << fixed << setprecision(15) << a << endl;
#define fi first
#define se second
#define m_p make_pair
#define p_b push_back
string to_string(string s) { return '"' + s + '"'; }
string to_string(const char* s) { return to_string((string)s); }
string to_string(bool b) { return (b ? "true" : "false"); }
template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto& x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)

//------ Believe yourself as a genius!!!!!! ------

int dy[] = {1, 0, -1, 0};
int dx[] = {0, 1, 0, -1};
// int dy[]={-1,0,1,-1,1,-1,0,1};int dx[]={-1,-1,-1,0,0,1,1,1};
string alph("abcdefghijklmnopqrstuvwxyz"), s;
ll n, cnt, ans, a[ohara], b, c, d, tmp, m, h, w, x, y, sum, k, q;
P dp[ohara];

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

  cin >> n;
  ll length = (1LL << n);
  rep(i, length) cin >> a[i];

  rep(i, length) {
    if (__builtin_popcount(i) != 1) {
      V sorted;
      sorted.p_b(dp[i].fi);
      sorted.p_b(dp[i].se);
      sorted.p_b(a[i]);
      sort(all(sorted));
      reverse(all(sorted));
      dp[i] = m_p(sorted[0], sorted[1]);
    }
    rep(j, n) {
      if (i & (1LL << j)) continue;
      V sorted;
      sorted.p_b(a[i].fi);
      sorted.p_b(a[(1LL << j)]);
      sort(all(sorted));
      reverse(all(sorted));

      dp[(i | (1LL << j))] = m_p(sorted[0], sorted[1]);
    }
  }
  rrep(i, 1, length) {
    ans = max(ans, dp[i].fi + dp[i].se);
    Cout(ans);
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:12: error: request for member 'first' in 'a[i]', which is of non-class type 'll' {aka 'long long int'}
   23 | #define fi first
      |            ^~~~~
a.cc:87:23: note: in expansion of macro 'fi'
   87 |       sorted.p_b(a[i].fi);
      |                       ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using pII = pair<int, int>;
#define fi first
#define se second
const int N = 1e6 + 10, INF = 0x3f3f3f3f;
int n, a[N], ans[N]; pII f[N];  
int main() {
	a[1 << n] = -INF;
	for (int i = 0; i < 1 << n; ++i) scanf("%d", a + i);
	for (int i = 0; i < 1 << n; ++i) f[i] = pII(i, 1 << n);
	for (int i = 0; i < n; ++i) {	
		for (int j = 0; j < 1 << n; ++j) {
			if ((j >> i) & 1) {
				int k = j ^ (1 << i);
				if (a[f[k].fi] > a[f[j].fi]) {
					f[j].se = f[j].fi;
					f[j].fi = f[k].fi;
				//	cout << j << " " << f[j].fi << " " << f[j].se << endl;
				} 
				if (f[k].fi != f[j].fi && a[f[k].fi] > a[f[j].se]) {
					f[j].se = f[k].fi;
				}
				if (f[k].se != f[j].fi && a[f[k].se] > a[f[j].se]) {
					f[j].se = f[k].se;
				} 
			//	cout << j << " " << f[j].fi << " " << f[j].se << endl;
			}
		}
	}
	memset(ans, 0, sizeof ans);
	for (int i = 1; i < 1 << n; ++i) {
		ans[i] = ans[i - 1];
	//	cout << i << " " << f[i].fi << " " << f[i].se << endl;
		if (f[i].fi != f[i].se && f[i].se != (1 << n)) {
			chmax(ans[i], a[f[i].fi] + a[f[i].se]);
		}
		printf("%d\n", ans[i]);
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:36:25: error: 'chmax' was not declared in this scope
   36 |                         chmax(ans[i], a[f[i].fi] + a[f[i].se]);
      |                         ^~~~~
Language: C++

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

using Int = long long int;
template <class T>
using Vector = std::vector<T>;

struct G {
    Vector<Int> idx;
    static Vector<Int> a;

    G& operator+=(const G& opp) {
        std::copy(opp.idx.begin(), opp.idx.end(),
                  std::back_inserter(idx));
        std::sort(idx.begin(), idx.end(), [&](Int i, Int j) {
            return a[i] == a[j] ? i < j : a[i] > a[j];
        });
        idx.erase(std::unique(idx.begin(), idx.end()), idx.end());
        idx.resize(2);
        return *this;
    }
};

int main() {
    Int n;
    std::cin >> n;
    Vector<Int> a(1 << n);
    for (auto& x : a) std::cin >> x;
    G::a = a;

    Vector<G> g(1 << n);
    for (Int s = 0; s < (1 << n); ++s) {
        g[s].idx.push_back(s);
    }

    // 高速ゼータ変換 下位集合版
    for (Int k = 0; k < n; ++k) {
        for (Int b = 0; b < (1 << n); ++b) {
            if ((b >> k) & 1) {
                g[b] += g[b ^ (1 << k)];
            }
        }
    }

    Int max = 0;
    for (Int s = 1; s < (1 << n); ++s) {
        max = std::max(max, a[g[s].idx[0]] + a[g[s].idx[1]]);
        std::cout << max << std::endl;
    }
    return 0;
}


Compiler output:
/usr/bin/ld: /tmp/ccAroUvf.o: warning: relocation against `_ZN1G1aE' in read-only section `.text._ZZN1GpLERKS_ENKUlxxE_clExx[_ZZN1GpLERKS_ENKUlxxE_clExx]'
/usr/bin/ld: /tmp/ccAroUvf.o: in function `main':
a.cc:(.text+0xed): undefined reference to `G::a'
/usr/bin/ld: /tmp/ccAroUvf.o: in function `G::operator+=(G const&)::{lambda(long long, long long)#1}::operator()(long long, long long) const':
a.cc:(.text._ZZN1GpLERKS_ENKUlxxE_clExx[_ZZN1GpLERKS_ENKUlxxE_clExx]+0x1f): undefined reference to `G::a'
/usr/bin/ld: a.cc:(.text._ZZN1GpLERKS_ENKUlxxE_clExx[_ZZN1GpLERKS_ENKUlxxE_clExx]+0x38): undefined reference to `G::a'
/usr/bin/ld: a.cc:(.text._ZZN1GpLERKS_ENKUlxxE_clExx[_ZZN1GpLERKS_ENKUlxxE_clExx]+0x63): undefined reference to `G::a'
/usr/bin/ld: a.cc:(.text._ZZN1GpLERKS_ENKUlxxE_clExx[_ZZN1GpLERKS_ENKUlxxE_clExx]+0x7c): undefined reference to `G::a'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
collect2: error: ld returned 1 exit status
Language: C++

use std::io::prelude::*;

fn input<T: std::str::FromStr>() -> T {
    let stdin = std::io::stdin();
    let it = stdin.lock().bytes().map(|c| c.unwrap() as char);
    let (fs, ft) = (|c: &char| c.is_whitespace(), |c: &char| !c.is_whitespace());
    let token = it.skip_while(fs).take_while(ft).collect::<String>();
    token.parse().ok().unwrap()
}
#[allow(dead_code)]
fn with_stdout_lock<F: FnOnce(std::io::BufWriter<std::io::StdoutLock>)>(f: F) {
    let out = std::io::stdout();
    f(std::io::BufWriter::new(out.lock()));
}
#[allow(unused_macros)]
macro_rules! debug {
    ($($var:expr),*) => { #[cfg(debug_assertions)] {
        $({ match &$var { v => eprint!("{}={:?} ", stringify!($var), v) } })*
        eprintln!();
    }};
}

fn main() {
    let n: usize = input();
    let a: Vec<i32> = (0..1 << n).map(|_| input()).collect();

    let mut dp = vec![(0, 0); 1 << n];
    for i in 0..1 << n {
        dp[i] = (a[i], 0);
    }
    debug!(dp);

    let max2 = |a: (i32, i32), b: (i32, i32)| {
        let mut v = [a.0, a.1, b.0, b.1];
        v.sort();
        (v[2], v[3])
    };

    for i in 0..n {
        for j in 0..1 << n {
            if (j >> i) & 1 == 1 {
                dp[j] = max2(dp[j], dp[j ^ (1 << i)]);
            }
        }
    }
    debug!(dp);

    let mut ans = vec![0; 1 << n];
    for i in 1..1 << n {
        ans[i] = std::cmp::max(ans[i - 1], dp[i].0 + dp[i].1);
    }
    with_stdout_lock(|mut w| {
        for i in 1..1 << n {
            writeln!(w, "{}", ans[i]).unwrap();
        }
    });
}


Compiler output:
a.cc:10:2: error: invalid preprocessing directive #[
   10 | #[allow(dead_code)]
      |  ^
a.cc:15:2: error: invalid preprocessing directive #[
   15 | #[allow(unused_macros)]
      |  ^
a.cc:17:27: error: stray '#' in program
   17 |     ($($var:expr),*) => { #[cfg(debug_assertions)] {
      |                           ^
a.cc:25:24: error: too many decimal points in number
   25 |     let a: Vec<i32> = (0..1 << n).map(|_| input()).collect();
      |                        ^~~~
a.cc:28:14: error: too many decimal points in number
   28 |     for i in 0..1 << n {
      |              ^~~~
a.cc:39:14: error: too many decimal points in number
   39 |     for i in 0..n {
      |              ^~~~
a.cc:40:18: error: too many decimal points in number
   40 |         for j in 0..1 << n {
      |                  ^~~~
a.cc:49:14: error: too many decimal points in number
   49 |     for i in 1..1 << n {
      |              ^~~~
a.cc:53:18: error: too many decimal points in number
   53 |         for i in 1..1 << n {
      |                  ^~~~
a.cc:1:1: error: 'use' does not name a type
    1 | use std::io::prelude::*;
      | ^~~
a.cc:3:1: error: 'fn' does not name a type
    3 | fn input<T: std::str::FromStr>() -> T {
      | ^~
a.cc:11:1: error: 'fn' does not name a type
   11 | fn with_stdout_lock<F: FnOnce(std::io::BufWriter<std::io::StdoutLock>)>(f: F) {
      | ^~
a.cc:16:1: error: 'macro_rules' does not name a type
   16 | macro_rules! debug {
      | ^~~~~~~~~~~
a.cc:23:1: error: 'fn' does not name a type
   23 | fn main() {
      | ^~
Language: C++

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

int main(){
  int N;cin>>N;
  int M=(int)pow(2, N);
  vll A;
  for (int i=0;i<M;++i){ll a;cin>>a;A.push_back(a);}
  //adjacency_matrix
  vi vertices[M];
  //number of 1 contained in the binary digit
  vi layers[N];
  for (int i=0;i<M;++i){
    //number of 1
    int count=0;
    for (int j=0;j<18;++j){
      //jth digit 
      int d=(i>>j)&1;
      if (d==1){
        vertices[i].push_back(i-(int)pow(2, j));
        count++;
      }
    }
    layers[count].push_back(i);
  }

  vll first(M)=A;
  vll second(M)={};

  //layerと、向きがあるグラフができた。
  for (int layer=0;layer<N;++layer){
    //layer=layerの数字がいくつあるか
    int L=layers[layer].size();
    //各layer=layerである数字に対して、
    for (int l=0;l<L;++l){
      //数字
      int i=layers[layer][l];
      //その数字に直接繋がっている一階層下の数字たち
      int S=vertices[i].size();
      //その数字iよりもbitwiseの意味で小さい数字jを添字にもつAjのうち、最大、二位になりうるもののこうほ
      vll candidates;
      candidates.push_back(A[i]);
      for (int j=0;j<S;++j){
        candidates.push_back(first[vertices[i][j]]);
      }
      sort(candidates.begin(), candidates.end(), greater<ll>());
      first[i]=candidates[0];
      second[i]=candidates[1];
    }
  }

  vll ans;
  ans.push_back(first[1]+second[1]);
  if(M!=2){
    for (int k=2;k<M;++k){
      ll a=max(first[k]+second[k],ans[k-1]);
      ans.push_back(a);
    }
  }

  for (int k=0;k<M-1;++k){
    cout << ans[k] << endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:15: error: expected ',' or ';' before '=' token
   30 |   vll first(M)=A;
      |               ^
a.cc:31:16: error: expected ',' or ';' before '=' token
   31 |   vll second(M)={};
      |                ^
Language: C++

#include<bits/stdc++.h>

using namespace std;

#define taskname "test1"
#define ff(i, a, b) for(int i=a; i<=b; ++i)
#define fd(i, a, b) for(int i=a; i>=b; --i)
#define ll long long
#define int long long

const int N = 262149;
int f_max[N];
int k, n, a[N];

void enter()
{
	cin >> k;
	n = 1 << k;
	for(int i = 0; i < n; ++i)
		cin >> a[i];
}

int getBit(int x, int i)
{
	return (x >> i ) & 1;
}

void solve()
{
	f_max[0] = a[0];
	int cur_best = 0;
	for(int x = 1; x < n; ++x)
	{
		f_max[x] = a[x];
		int testMax = cur_best;
		vector<int> v;
		while(!v.empty())
			v.pop_back();
		for(int i = 0; i <= 18; ++i)
			if(getBit(x, i) == 1)
			{
				int y = x & ~ (1 << i);
				testMax = max(testMax, f_max[y] + a[x]);
				v.push_back(y);
				f_max[x] = max(f_max[x], f_max[y]);
			}
		//cout << x <<" : "<< endl;
		for(int i = 0; i < v.size(); ++ i)
			for(int j = i + 1; j < v.size(); ++j)
				testMax = max(testMax, max(f_max[v[i]] + a[v[j]], a[v[i]] + f_max[v[j]]));
		cur_best = max(cur_best, testMax);
		cout << testMax << endl;
	}
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);   cout.tie(nullptr);
    if (ifstream("test.inp"))
    {
        freopen("test.inp", "r", stdin);
        #ifdef CHECKING
            freopen(taskname".out", "w", stdout);
        #else
            freopen("test.out", "w", stdout);
        #endif //CHECKING
    }
    else if (ifstream(taskname".inp"))
    {
        freopen(taskname".inp", "r", stdin);
        freopen(taskname".out", "w", stdout);
    }
		enter();
		solve();
	return 0;
}


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

#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
using namespace std;
int f[1<<18][2];
int n;
int _max(int x, int y) { return x > y ? x : y; d}
int main() {
	int i, j, k;
	scanf("%d", &n);
	for(i = 0; i < 1<<n; i++) scanf("%d", &f[i][0]);
	for(i = 0; i < n; i++){
		for(j = 0; j < 1<<n; j++){
			if(j&(1<<i)){
				int p = j^(1<<i);
				if(f[p][0] > f[j][0]) f[j][1] = f[j][0], f[j][0] = f[p][0];
				else if(f[p][0] > f[j][1]) f[j][1] = f[p][0];
				if(f[p][1] > f[j][1]) f[j][1] = f[p][1];
			}
		}
	}
	int ans = 0;
	for(i = 1; i < 1<<n; i++){
		ans = _max(ans, f[i][0]+f[i][1]);
		printf("%d\n", ans);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int _max(int, int)':
a.cc:8:48: error: 'd' was not declared in this scope
    8 | int _max(int x, int y) { return x > y ? x : y; d}
      |                                                ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int a[1000010],n,r,s1,s2;
int main(){
	scanf("%d",&r);
	for(int i=0;i<(1<<r);i++)
		scanf("%d",&a[i]);
	for(int i=1;i<(1<<n);i++){
		s1=a[i],s2=0;
		for(int j=i;j;j=(j-1)&i){
			if(a[j]>s1){
				s2=s1;
				s1=a[j];
			}
			else if(a[j]>s2)
				s2=a[j];
		}
		ans=max(ans,s1+s2);
		printf("%d\n",ans);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   18 |                 ans=max(ans,s1+s2);
      |                 ^~~
      |                 abs
Language: Java

package X1;
import java.util.*;
public class OrPlusMax {

	public static void main(String[] args) {
		Scanner Cf=new Scanner(System.in);
		int N=Cf.nextInt();
		int K=N;
		int[] values=new int[(int)Math.pow(2, N)];
		int[] ark=new int[(int)Math.pow(2, N)];
		for(int i=0;i<Math.pow(2, N);i++) {
			values[i]=Cf.nextInt();
			ark[i]=i;
			
		}
		
		ArrayList<ArrayList<Integer>> Bucket=new ArrayList<>();
		HashMap<Integer,Integer> Cover=new HashMap<>();
		for(int k=0;k<ark.length;k++) {
			Cover.put(ark[k],Integer.MIN_VALUE);
		}
		for(int i=0;i<ark.length;i++) {
			for(int j=0;j<ark.length;j++) {
				if(i<j) {
				int Julian=i|j;
				for(int X=Julian;X<ark.length;X++) { 
					if(Cover.get(X).intValue()<values[i]+values[j]) {
						Cover.put(X,values[i]+values[j]);
						//System.out.println(Julian+"  "+values[i]+"  "+values[j]);

						}
				}
				
				}
				}
		}
		
		for(int i=1;i<Cover.size();i++) {
			System.out.println(Cover.get(i).intValue()+"  ");
		}
		
		
		
		
		
	}

}


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

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<bitset>
using namespace std;
#define REP(i,m,n) for(int i=(int)m ; i < (int) n ; i++ )
#define rep(i,n) REP(i,0,n)
typedef long long ll;
typedef pair<int,int> pint;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;
int dx[4]={1,0,-1,0} , dy[4]={0,1,0,-1} ;

int main(){
    int k;
    cin>>k;
    int n=1<<k;
    ll a[n];
    rep(i,n)cin>>a[i];
    ll ma[n],se[n];
    rep(i,n)ma[i]=se[i]=0;
    rep(mask,n){
        for(int i=mask;i>=0;i--){
            i&=mask;
            ma[mask]=max(a[i],ma[mask]);
        }
    }
    rep(mask,n){
        int cnt=0;
        for(int i=mask;i>=0;i--){
            i&=mask;
            if(a[i]==ma[mask])cnt++;
            else se[mask]=max(a[i],se[mask]);
        }
        if(cnt>=2)se[mask]=ma[mask];
    }

    ll ans[n];
    rep(i,n)ans[i]=0;
    rep(mask,n){
        for(int i=mask;i>=0;i--){
            i&=mask;
            if(a[i]!=ma[mask])ans[mask]=max(a[i]+ma[mask],ans[mask]);
            else ans[mask]=max(ans[mask],a[i]+se[mask]);
        }
    }
    rep(i,n-1)ans[i+1]=max(ans[i],ans[i+1]);
    rep(i,n-1)printf("%lld\n",s[i+1]);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:57:31: error: 's' was not declared in this scope
   57 |     rep(i,n-1)printf("%lld\n",s[i+1]);
      |                               ^
Language: C++

#include <algorithm>
#include <iostream>
#include <vector>
#include <math.h>
#include <set>
#include <map>
#include <string>
#include <stack>
#include <queue>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <bitset>
#include <complex>
#define _USE_MATH_DEFINES
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> plglg;
typedef tuple<int, int, int> tiii;
typedef tuple<ll, ll, ll> tlglglg;
typedef complex<double> xy_t;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
double pi = 3.141592653589793;
ll mod = 1000000007;
int intmax = 2147483647;
int intmin = -2147483648;
ll llmax = 9223372036854775807;
ll llmin = -9223372036854775807;
ll inf = llmax / 2;
double eps = 1e-11;

ll a[(1 << 19)][2];
int n;
void zeta() {
    for (int i = 0; i < n; i++) {
        for (int b = 0; b < (1 << n); b++) {
            if (b & (1 << i)) {
                ll ar[4] = {a[b][0], a[b][1], a[b^(1<<i)][0], a[b^(1<<i)][1]};
                sort(ar, ar + 4);
                reverse(ar, ar + 4);
                a[b][0] = ar[0];
                a[b][1] = ar[1];
            }
        }
    }
}

ll k[20];

int main() {
    int N;
    cin >> N;
    n = N;
    for (int i = 0; i < (1 << N); i++) {
        fill(a[i], a[i] + 2, 0);
        cin >> a[i][0];
    }
    ll keta = 1;
    ll maxx[2];
    k[0] = 0;
    maxx[0] = max(a[0][0], a[1][0]);
    maxx[1] = min(a[0][0], a[1][0]);
    for (int i = 2; i < (1 << N); i++) {
        if (i == (1 << keta)) {
            k[keta] = maxx[0] + maxx[1];
            keta++;
        }
        if (a[i][0] > maxx[0]) {
            maxx[1] = maxx[0];
            maxx[0] = a[i][0];
        } else if (a[i][0] > maxx[1]) {
            maxx[1] = a[i][0];
        }
    }
    zeta();
    keta = 0;
    if (N < 3) {
        usleep(10000);
    }
    if (N < 2) {
        usleep(100000);
    }
    for (int i = 1; i < (1 << N); i++) {
        if (i == (1 << keta)) {
            keta++;
        }
        cout << max(k[keta - 1], a[i][0] + a[i][1]) << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:80:9: error: 'usleep' was not declared in this scope
   80 |         usleep(10000);
      |         ^~~~~~
a.cc:83:9: error: 'usleep' was not declared in this scope
   83 |         usleep(100000);
      |         ^~~~~~
Language: C++


    #include "bits/stdc++.h"
    using namespace std;
    
    int n;
    vector<int> v;
    int fl[1<<18][18][2];
    int main(){
		cin>>n;
		for(int i=0;i<(1<<n);i++){
			int a;
			scanf("%d",&a);
			v.push_back(a);
		}
		for(int k=1;k<(1<<n);k++){
		for(int j=0;j<18;j++){
			for(int i=0;i<2;i++){
				fl[j][i]=INT_MIN;
			}
		}
		int ans=INT_MIN;
		for(int i=0;i<v.size();i++){
			for(int j=0;j<18;j++){
				int until=((k>>j)<<j);
				int tmp=until;
				if(j){
					int k=(1<<(j-1));
					k--;
					until|=k;
				}
				if((until|i)>k)continue;
				int s=unt;
				while(unt){
					ans=max(ans,fl[unt][j][0]+v[i]);
					if(j==0){
						ans=max(ans,fl[unt][j][1]+v[i]);
					}
					unt--;
					unt&=s;
				}
				ans=max(ans,fl[unt][j][0]+v[i]);
					if(j==0){
						ans=max(ans,fl[unt][j][1]+v[i]);
					}
			}
			for(int j=0;j<18;j++){
				int z=((i>>j)<<j);
				if((z&k)!=z){
					continue;
				}
				int c=0;
				if(j)c=((i>>(j-1))&1);
				fl[z][j][c]=max(fl[z][j][c],v[i]);
			}
		}
		cout<<ans<<endl;
	}
		return 0;
	}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:41: error: incompatible types in assignment of 'int' to 'int [2]'
   18 |                                 fl[j][i]=INT_MIN;
      |                                         ^
a.cc:32:39: error: 'unt' was not declared in this scope; did you mean 'uint'?
   32 |                                 int s=unt;
      |                                       ^~~
      |                                       uint
Language: C++

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

struct vals {
int a, b;
vals(int v = 0, y = 0) : a(v), b(y) {}
int operator () const { return a + b; }
};

vals operator || (const vals &l, const vals &r) {
  if (l.a >= r.a) {
    return vals(l.a, max(l.b, r.a));
  } else {
    return vals(r.a, max(r.b, l.a));
  }
}

const int MAXN = 19;
int N;
vals A[1 << MAXN];
int main() {
scanf("%d", &N);
for (int i = 0; i < (1 << N); i++) {
int v; scanf("%d", &v); A[i] = vals(v);
}
for (int a = 0; a < N; a++) {
for (int i = 0; i < (1 << N); i++) {
if (i & (1 << a)) continue;
A[i | (1 << a)] = A[i | (1 << a)] || A[i];
}
}
for (int a = 0; a < (1 << N); a++) {
if (a & (a + 1)) {
A[a] = A[a] || A[(a & (a+1)) - 1];
}
}
for (int a = 1; a < (1 << N); a++) {
printf("%d\n", A[a]());
}
}

Compiler output:
a.cc:6:17: error: 'y' has not been declared
    6 | vals(int v = 0, y = 0) : a(v), b(y) {}
      |                 ^
a.cc:7:5: error: declaration of 'operator()' as non-function
    7 | int operator () const { return a + b; }
      |     ^~~~~~~~
a.cc:7:15: error: expected ';' at end of member declaration
    7 | int operator () const { return a + b; }
      |               ^
      |                ;
a.cc:7:23: error: expected unqualified-id before '{' token
    7 | int operator () const { return a + b; }
      |                       ^
a.cc: In constructor 'vals::vals(int, int)':
a.cc:6:34: error: 'y' was not declared in this scope; did you mean 'yn'?
    6 | vals(int v = 0, y = 0) : a(v), b(y) {}
      |                                  ^
      |                                  yn
a.cc: In function 'int main()':
a.cc:38:20: error: no match for call to '(vals) ()'
   38 | printf("%d\n", A[a]());
      |                ~~~~^~
Language: C++

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

struct vals {
int a, b;
vals(int v = 0) : a(v), b(0) {}
int operator () const { return a + b; }
};

vals operator || (const vals &l, const vals &r) {
  if (l.a >= r.a) {
    return vals{l.a, max(l.b, r.a)};
  } else {
    return vals{r.a, max(r.b, l.a)};
  }
}

const int MAXN = 19;
int N;
vals A[1 << MAXN];
int main() {
scanf("%d", &N);
for (int i = 0; i < (1 << N); i++) {
int v; scanf("%d", &v); A[i] = vals(v);
}
for (int a = 0; a < N; a++) {
for (int i = 0; i < (1 << N); i++) {
if (i & (1 << a)) continue;
A[i | (1 << a)] = A[i | (1 << a)] || A[i];
}
}
for (int a = 0; a < (1 << N); a++) {
if (a & (a + 1)) {
A[a] = A[a] || A[(a & (a+1)) - 1];
}
}
for (int a = 1; a < (1 << N); a++) {
printf("%d\n", A[a]());
}
}

Compiler output:
a.cc:7:5: error: declaration of 'operator()' as non-function
    7 | int operator () const { return a + b; }
      |     ^~~~~~~~
a.cc:7:15: error: expected ';' at end of member declaration
    7 | int operator () const { return a + b; }
      |               ^
      |                ;
a.cc:7:23: error: expected unqualified-id before '{' token
    7 | int operator () const { return a + b; }
      |                       ^
a.cc: In function 'vals operator||(const vals&, const vals&)':
a.cc:12:35: error: no matching function for call to 'vals::vals(<brace-enclosed initializer list>)'
   12 |     return vals{l.a, max(l.b, r.a)};
      |                                   ^
a.cc:6:1: note: candidate: 'vals::vals(int)'
    6 | vals(int v = 0) : a(v), b(0) {}
      | ^~~~
a.cc:6:1: note:   candidate expects 1 argument, 2 provided
a.cc:4:8: note: candidate: 'constexpr vals::vals(const vals&)'
    4 | struct vals {
      |        ^~~~
a.cc:4:8: note:   candidate expects 1 argument, 2 provided
a.cc:4:8: note: candidate: 'constexpr vals::vals(vals&&)'
a.cc:4:8: note:   candidate expects 1 argument, 2 provided
a.cc:14:35: error: no matching function for call to 'vals::vals(<brace-enclosed initializer list>)'
   14 |     return vals{r.a, max(r.b, l.a)};
      |                                   ^
a.cc:6:1: note: candidate: 'vals::vals(int)'
    6 | vals(int v = 0) : a(v), b(0) {}
      | ^~~~
a.cc:6:1: note:   candidate expects 1 argument, 2 provided
a.cc:4:8: note: candidate: 'constexpr vals::vals(const vals&)'
    4 | struct vals {
      |        ^~~~
a.cc:4:8: note:   candidate expects 1 argument, 2 provided
a.cc:4:8: note: candidate: 'constexpr vals::vals(vals&&)'
a.cc:4:8: note:   candidate expects 1 argument, 2 provided
a.cc: In function 'int main()':
a.cc:38:20: error: no match for call to '(vals) ()'
   38 | printf("%d\n", A[a]());
      |                ~~~~^~
Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for (long long i=0;i<(n);i++)
#define FOR(i,a,b) for (long long i=(a);i<(b);i++)
#define RREP(i,n) for(long long i=n;i>=0;i--)
#define RFOR(i,a,b) for(long long i=(a);i>(b);i--)
#define dump1d_arr(array) REP(i,array.size()) cerr << #array << "[" << (i) << "] ==> " << (array[i]) << endl
#define dump2d_arr(array) REP(i,array.size()) REP(j,array[i].size()) cerr << #array << "[" << (i) << "]" << "[" << (j) << "] ==> " << (array[i][j]) << endl
#define dump(x)  cerr << #x << " => " << (x) << endl
#define dumpP(p) cerr << "( " << p.first << " , " << p.second << " )" << ends
#define SORT(c) sort((c).begin(),(c).end())
#define MIN(vec) *min_element(vec.begin(), vec.end())
#define MAX(vec) *max_element(vec.begin(), vec.end())
#define UNIQ(vec) vec.erase(unique(vec.begin(), vec.end()),vec.end()) //ソートの必要あり
#define IN(n,m)  (!(m.find(n) == m.end()))
#define ENUM(m) for (auto itr = m.begin(); itr != m.end(); ++itr)
#define dump_MAP(m) for(auto itr = m.begin(); itr != m.end(); ++itr) { cerr << itr->first << " --> "  << itr->second << endl; }
#define FINDL(vec,x) (lower_bound(vec.begin(),vec.end(),x) - vec.begin())
#define FINDU(vec,x) (upper_bound(vec.begin(),vec.end(),x) - vec.begin())
#define ROUND(N) setprecision(N)
#define ROUND_PRINT(N,val) cout << fixed;cout << setprecision(N) << val << endl
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define INARR(h,w,x,y) (0 <= y && y < h && 0 <= x && x < w)
#define EQ(a,b) (abs(a - b) < 1e-10)
#define ZETA(b,k,n) REP(b,n) REP(k,1<<n) if ((k & (1 << b)))
using namespace std;
constexpr int dx[4] = {0,1,0,-1};
constexpr int dy[4] = {1,0,-1,0};
constexpr long double pi = M_PI;
constexpr double eps = 1e-10;
constexpr long mod = 1000000007;
constexpr short shINF = 32767;
constexpr long loINF = 2147483647;
constexpr long long llINF = 9223372036854775807;
typedef long long LL;
typedef vector<long> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<LL,LL> pr;
typedef vector<bool> VB;
typedef vector<pr> VP;
struct Order {
	bool operator() (pr const& a,pr const& b) const {
		return a.first > b.first || ((a.first == b.first) && (a.second > b.second));
	}
};

VI merge(VI &A,VI &B) {
	VI cp(A.begin(),A.end());
	REP(i,B.size()) cp.push_back(B[i]);
	sort((cp).begin(),(cp).end(),greater<long>());
	return vector<long>(cp.begin(),cp.begin()+min(2,(int)cp.size()));
}

int main(void) {
	int N;
	cin >> N;
	VI A(1<<N);
	REP(i,1<<N) cin >> A[i];
	VVI dp(1<<N,VI(2,0));
	REP(i,1<<N) dp[i] = {A[i]};	
	ZETA(b,k,N) {
		dp[k] = merge(dp[k],dp[k ^ (1 << b)])
	}
	long ans = 0;
	FOR(i,1,1<<N) {
		ans = max(ans,dp[i][0]+dp[i][1]);
		cout << ans << endl;
	}
	//dump2d_arr(dp);
}



Compiler output:
a.cc: In function 'int main()':
a.cc:63:54: error: expected ';' before '}' token
   63 |                 dp[k] = merge(dp[k],dp[k ^ (1 << b)])
      |                                                      ^
      |                                                      ;
   64 |         }
      |         ~
Language: C++

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

int main(void) {
  ll N;
  cin >> N;
  ll A[1LL << 18];
  REP(i, 0, 1LL << N) scanf("%lld", A + i);

  ll ans = 0;
  REP(k, 1, 1LL << N) {
    ll p = 0, q = 0;
    ll i = k;
    do {
      ll x = max(max(p, q), A[i]);
      q = p + q + A[i] - w - min(min(p, q), A[i]);
      p = w;
      i = (i - 1) & k;
    } while(i != k);
    ans = max(ans, p + q);
    printf("%lld\n", ans);
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:26: error: 'w' was not declared in this scope
   18 |       q = p + q + A[i] - w - min(min(p, q), A[i]);
      |                          ^
Language: C++

#include <bits/stdc++.h>
#define ll long long
using namespace std;
typedef pair<LL, LL> pii;
LL n, ans, a[1 << 18 + 5];
vector <pii> v[1<<18+5];
int main() {
	scanf ("%d", &n);
	for (int i = 0; i < (1 << n); i ++)
		scanf ("%lld", &a[i]);
	for (int i = 0; i < (1 << n); i ++)
		v[i].push_back(make_pair(a[i], i));
	for (int S = 0; S < (1 << n); S ++) {
		for (int i = 0; i < n; i ++) {
			if (!((S >> i) & 1))
				continue;
			for (int j = 0; j < v[S ^ (1 << i)].size(); j ++)
				v[S].push_back(v[S ^ (1 << i)][j]);
		}
		sort (v[S].begin(), v[S].end(), greater<pii>());
		v[S].erase(unique(v[S].begin(), v[S].end()), v[S].end());
		if (v[S].size() > 2)
			v[S].resize(2);
	}
	for (int S = 1; S < (1 << n); S ++) {
		ans = max(ans, v[S][0].first + v[S][1].first);
		printf ("%lld\n",ans);
	}
	return 0;
}

Compiler output:
a.cc:4:14: error: 'LL' was not declared in this scope; did you mean 'll'?
    4 | typedef pair<LL, LL> pii;
      |              ^~
      |              ll
a.cc:4:18: error: 'LL' was not declared in this scope; did you mean 'll'?
    4 | typedef pair<LL, LL> pii;
      |                  ^~
      |                  ll
a.cc:4:20: error: template argument 1 is invalid
    4 | typedef pair<LL, LL> pii;
      |                    ^
a.cc:4:20: error: template argument 2 is invalid
a.cc:5:1: error: 'LL' does not name a type; did you mean 'll'?
    5 | LL n, ans, a[1 << 18 + 5];
      | ^~
      | ll
a.cc: In function 'int main()':
a.cc:8:23: error: 'n' was not declared in this scope; did you mean 'yn'?
    8 |         scanf ("%d", &n);
      |                       ^
      |                       yn
a.cc:10:33: error: 'a' was not declared in this scope
   10 |                 scanf ("%lld", &a[i]);
      |                                 ^
a.cc:12:42: error: 'a' was not declared in this scope
   12 |                 v[i].push_back(make_pair(a[i], i));
      |                                          ^
a.cc:26:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   26 |                 ans = max(ans, v[S][0].first + v[S][1].first);
      |                 ^~~
      |                 abs
a.cc:26:40: error: request for member 'first' in 'v[S].std::vector<int>::operator[](0)', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   26 |                 ans = max(ans, v[S][0].first + v[S][1].first);
      |                                        ^~~~~
a.cc:26:56: error: request for member 'first' in 'v[S].std::vector<int>::operator[](1)', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   26 |                 ans = max(ans, v[S][0].first + v[S][1].first);
      |                                                        ^~~~~
Language: C

#include <bits/stdc++.h>
#define REP(i, a, n) for(ll i = ((ll) a); i < ((ll) n); i++)
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;

pll top2(pll x, pll y) {
  vector<ll> s = { x.first, x.second, y.first, y.second };
  sort(s.begin(), s.end(), greater<ll>());
  return pll(s[0], s[1]);
}

int main(void) {
  ll N;
  cin >> N;
  vector<ll> A(1LL << N);
  REP(i, 0, 1LL << N) cin >> A[i];

  const ll INF = 1LL << 50;
  vector<pll> dp(1LL << N);
  REP(i, 0, 1LL << N) dp[i] = pll(i, 0);
  REP(i, 0, 1LL << N) {
    REP(j, 0, N) if(!(i & (1LL << j))) {
      pll x = dp[i | (1LL << j)], y = dp[i];
      vector<ll> s = { x.first, x.second, y.first, y.second };
      sort(s.begin(), s.end());
      s.erase(unique(s.begin(), s.end()), s.end());
      sort(s.begin(), s.end(), [&](ll p, ll q) { return A[p] > A[q]; });
      dp[i | (1LL << j)] = pll(s[0], s[1]);
    }
  }

  ll ans = 0;
  REP(i, 1, 1LL << N) {
    ans = max(ans, A[dp[i].first] + A[dp[i].second]);
    cout << ans << endl;
  }
}

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

#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int main(void)
{
	int i,n,S;
	scanf("%d",&n);
	for(i=0;i<(1<<n);++i)scanf("%d",&a[i]);
	for(i=0;i<(1<<n);++i)v[i].emplace_back(a[i],i);
	for(S=0;S<(1<<n);++S)
	{
		for(i=0;i<n;++i)
		{
			if(!(S>>i)&1)continue;
			for(j=);
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:42: error: 'a' was not declared in this scope
   10 |         for(i=0;i<(1<<n);++i)scanf("%d",&a[i]);
      |                                          ^
a.cc:11:30: error: 'v' was not declared in this scope
   11 |         for(i=0;i<(1<<n);++i)v[i].emplace_back(a[i],i);
      |                              ^
a.cc:11:48: error: 'a' was not declared in this scope
   11 |         for(i=0;i<(1<<n);++i)v[i].emplace_back(a[i],i);
      |                                                ^
a.cc:17:29: error: 'j' was not declared in this scope
   17 |                         for(j=);
      |                             ^
a.cc:17:31: error: expected primary-expression before ')' token
   17 |                         for(j=);
      |                               ^
a.cc:18:17: error: expected primary-expression before '}' token
   18 |                 }
      |                 ^
a.cc:17:33: error: expected ';' before '}' token
   17 |                         for(j=);
      |                                 ^
      |                                 ;
   18 |                 }
      |                 ~                
a.cc:18:17: error: expected primary-expression before '}' token
   18 |                 }
      |                 ^
a.cc:17:33: error: expected ')' before '}' token
   17 |                         for(j=);
      |                            ~    ^
      |                                 )
   18 |                 }
      |                 ~                
a.cc:18:17: error: expected primary-expression before '}' token
   18 |                 }
      |                 ^
Language: C++

#include<bits/stdc++.h>
#define inf (0x7f7f7f7f)
#define Max(a, b) ((a) > (b) ? (a) : (b))
#define Min(a, b) ((a) < (b) ? (a) : (b))
typedef long long ll;
using namespace std;
template <class T>
inline void read(T &x){
    int f = 0, ch = 0; x = 0;
    for(; !isdigit(ch); ch = getchar()) if(ch == '-') f = 1;
    for(; isdigit(ch); ch = getchar()) x = x * 10 + ch - 48;
    if(f) x = -x;
}
#define int ll
#define par pair<int, int>
#define fi first
#define se second
par f[(1<<19)+105]; 
int main(){
	int n; read(n);
	for(int i = 0; i < (1 << n); i++) read(f[i].fi);
	for(int j = 0; j < n; j++)
		for(int i = 1; i < (1 << n); i++){
			if(i & (1 << j)){
				par now = f[i^(1<<j)];
				if(now.fi > f[i].fi){
					f[i].se = Max(f[i].fi, now.se);
					f[i].fi = now.fi;
				}
				else f[i].se = Max(f[i].se, now.fi);	
			}
		}
	for(int i = 1; i < (1 << n); i++){
		//cout << i << " " << f[i].fi << " " << f[i].se << endl;
		par now = f[i-1];
		if(now.fi + now.se > f[i].fi + f[i].se) f[i] = now;
		printf("%lld\n", f[i].fi + f[i].se);
	}
	return 0;
}


Compiler output:
a.cc:14:13: error: '::main' must return 'int'
   14 | #define int ll
      |             ^~
a.cc:19:1: note: in expansion of macro 'int'
   19 | int main(){
      | ^~~
Language: C++

#include<cstdio>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<cstring>
#include<cstdlib>
#include<ctime>
#include<vector>
#include<set>
#include<map>
#include<queue>
using namespace std;
#define li long long
#define gc getchar()
#define pc putchar
li read(){
	li x = 0,y = 0,c = gc;
	while(!isdigit(c)){y = c;c = gc;}
	while(isdigit(c)){x = (x << 1) + (x << 3) + (c ^ '0');c = gc;}
	return y == '-' ? -x : x;
}
void print(li x){
	if(x < 0){pc('-');x = -x;}
	if(x >= 10) print(x / 10);
	pc(x % 10 + '0');
}
void file(){freopen(".in","r",stdin);freopen(".out","w",stdout);}
int n,m,a[300010],b[300010],c[300010],d[300010],e[300010];
int bt[300010];

int main(){
	//file();
	int i,j,k;
	n = read(); m = 1 << n;
	for(i = 0;i < m;++i) a[i] = read(),c[i] = i,d[i] = a[i];
	for(i = 1;i < m;++i) bt[i] = bt[i >> 1] + (i & 1);
	for(i = 1;i < m;i <<= 1){
		for(j = 0;j < m;++j) if(!(i & j)){
			if(d[i ^ j] < d[j]){
				d[i ^ j] = d[j];
				c[i ^ j] = c[j];
			}	
		} 
	}
	for(i = 0;i < m;++i) if(i != c[i]) e[i] = a[i];
	for(i = 1;i < m;i <<= 1){
		for(j = 0;j < m;++j) if(!(i & j)){
			if()e[i ^ j] = max(e[i ^ j],e[i ^ j]);
			if(c[i ^ j] != c[j]) e[i ^ j] = max(e[i ^ j],a[c[j]]);
		}
	}
	for(i = 0;i < m;++i) b[i] = d[i] + e[i];
	//for(i = 0;i < m;++i) cerr<<d[i]<<" ";cerr<<endl;
	//for(i = 0;i < m;++i) cerr<<c[i]<<" ";cerr<<endl;
	//for(i = 0;i < m;++i) cerr<<e[i]<<" ";cerr<<endl;
	/*for(i = 0;i < m;++i){
		for(j = i;j;j = j - 1 & i){
			//cerr<<i<<" "<<j<<" "<<(i ^ j)<<endl;
			b[i] = max(b[i],a[j] + d[i ^ j]);
		}
	}*/
	for(i = 1;i < m;++i){
		b[i] = max(b[i],b[i - 1]);
		print(b[i]);pc('\n');
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:48:28: error: expected primary-expression before ')' token
   48 |                         if()e[i ^ j] = max(e[i ^ j],e[i ^ j]);
      |                            ^
Language: C++

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

#define INF 1.1e9
#define LINF 1.1e18
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) for (int i = (n) - 1; i >= 0; i--)
#define ALL(v) (v).begin(), (v).end()
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define BIT(x, n) bitset<n>(x)
#define PI 3.14159265358979323846

typedef long long ll;
typedef pair< ll, ll > P;
typedef pair< int, P > PP;

//-----------------------------------------------------------------------------

int n;
ll a[270000];
ll ma[270000];

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

    REP(i, 20) REP(j, 2) max_bit[i][j] = (ll)-LINF;

    cin >> n;
    ll idx = 1;
    REP(i, n) idx *= 2;
    REP(i, idx) {
        cin >> a[i];
    }

    ma[1] = a[0] + a[1];

    FOR(k, 2, idx) {
        vector<int> bit;
        int j = k;
        while(j) {
            bit.pb(j % 2);
            j /= 2;
        }
        int sum = 0;
        for(int i = (int)bit.size() - 2; i >= 0; i--) {
            if (bit[i] == 1) {
                int two = 1;
                REP(j, i + 1) {
                    if (bit[j] == 1) sum += two;
                    two *= 2;
                }
                break;
            }
        }
        ma[k] = max(ma[k - 1], a[k] + ma[sum]);
    }
    FOR(k, 1, idx) cout << ma[k] << endl

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:26: error: 'max_bit' was not declared in this scope
   31 |     REP(i, 20) REP(j, 2) max_bit[i][j] = (ll)-LINF;
      |                          ^~~~~~~
a.cc:62:41: error: expected ';' before 'return'
   62 |     FOR(k, 1, idx) cout << ma[k] << endl
      |                                         ^
      |                                         ;
   63 | 
   64 |     return 0;
      |     ~~~~~~
Language: C++

#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
const int N=(1<<18)+5;
int n,a[maxn],m;
int f[N],g[N];
ll read(){
	ll x=0,w=1;
	char ch=0;
	while (ch<'0' || ch>'9'){
		  if (ch=='-') w=-1;
		  ch=getchar();
	}
	while (ch<='9' && ch>='0'){
		  x=(x<<1)+(x<<3)+ch-'0';
		  ch=getchar();
	}
	return x*w;
}
int main() {
	n=read();
	m=1<<n;
	for (int i=0;i<m;i++) a[i]=read();
	for (int i=1;i<m;i++)
		for (int j=i;j>=0;j=(j-1)&i) {
			if (a[j]>f[i]){ 
				g[i]=f[i];
				f[i]=a[j];
			} 
			else g[i]=max(g[i],a[j]);
			if (j==0) break;
		}
	int s=0;
	for (int i=1;i<m;i++) {
		s=max(s,f[i]+g[i]);
		printf("%d\n",s);
	}
	return 0;
}

Compiler output:
a.cc:6:9: error: 'maxn' was not declared in this scope
    6 | int n,a[maxn],m;
      |         ^~~~
a.cc:8:1: error: 'll' does not name a type
    8 | ll read(){
      | ^~
a.cc: In function 'int main()':
a.cc:22:11: error: 'read' was not declared in this scope; did you mean 'fread'?
   22 |         n=read();
      |           ^~~~
      |           fread
a.cc:24:31: error: 'a' was not declared in this scope
   24 |         for (int i=0;i<m;i++) a[i]=read();
      |                               ^
a.cc:27:29: error: 'a' was not declared in this scope
   27 |                         if (a[j]>f[i]){
      |                             ^
Language: C++

#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
//#include <cstring>
using namespace std;
typedef long long ll;
const int maxn=(1<<19)+10;
ll a[maxn];
ll ans[maxn];
int main()
{
    int n;
    while (scanf("%d",&n)!=EOF) {
        for(int i=0;i<(1<<n);i++)
            scanf("%lld",a+i);
        memset(ans, 0, sizeof(ans));
        for(int i=0;i<(1<<n);i++)
            for(int j=0;j<(1<<n);j++)
                if((i|j)<(1<<n)&&i!=j)
                    ans[(i|j)]=max(ans[i|j],a[i]+a[j]);
        for(int i=2;i<(1<<n);i++)
            ans[i]=max(ans[i],ans[i-1]);
            for(int i=1;i<(1<<n);i++)printf("%lld\n",ans[i]);
    }
    return 0;
}

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

#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
//#include <cstring>
using namespace std;
typedef long long ll;
const int maxn=(1<<19)+10;
ll a[maxn];
ll ans[maxn];
int main()
{
    int n;
    while (scanf("%d",&n)!=EOF) {
        for(int i=0;i<(1<<n);i++)
            scanf("%lld",a+i);
        memset(ans, 0, sizeof(ans));
        for(int i=0;i<(1<<n)-1;i++)
            for(int j=0;j<(1<<n)-1;j++)
                if(i!=j)
                    ans[(i|j)]=max(ans[i|j],a[i]+a[j]);
        for(int i=2;i<(1<<n);i++)
            ans[i]=max(ans[i],ans[i-1]);
            for(int i=1;i<(1<<n);i++)printf("%lld\n",ans[i]);
    }
    return 0;
}

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

#include <algorithm>
#include <cstdio>
#define MOD 1000000007
typedef long long ll; 
inline ll quick_pow(ll a, int n)
{
	ll res = 1; 
	while (n)
	{
		if (n & 1)
			res = res * a % MOD; 
		a = a * a % MOD; 
		n >>= 1; 
	}
	return res; 
}
ll dp[25005][405], sum[25005][405]; 
int arr[25005]; 
bool vis[405]; 
int main()
{
	// freopen("ARC100-F.in", "r", stdin); 
	int n, k, m, lp = -1, rp = -1; 
	scanf("%d%d%d", &n, &k, &m); 
	for (int i = 0; i < m; i++)
		scanf("%d", arr + i); 
	bool flg = false; 
	for (int i = 0; i + k <= m; i++)
	{
		memset(vis, false, sizeof(vis)); 
		int cnt = 0; 
		for (int j = 0; j < k; j++)
		{
			cnt += !vis[arr[i + j]];
			vis[arr[i + j]] = true;
		}
		flg |= cnt == k; 
	}
	ll ans = quick_pow(k, n - m) * (n - m + 1) % MOD; 
	if (flg)
	{
		printf("%lld\n", ans);
		return 0; 
	}
	memset(vis, false, sizeof(vis)); 
	for (int i = 0; i < m && -1 == lp; i++)
	{
		if (!vis[arr[i]])
			vis[arr[i]] = true; 
		else
			lp = i; 
	}
	memset(vis, false, sizeof(vis)); 
	for (int i = m - 1; i >= 0 && -1 == rp; i--)
	{
		if (!vis[arr[i]])
			vis[arr[i]] = true; 
		else
			rp = i; 
	}
	for (int i = 1; i < k; i++)
	{
		dp[0][i] = 1; 
		sum[0][i] = i; 
	}
	for (int i = 1; i <= n; i++)
	{
		for (int j = 1; j < k; j++)
		{
			dp[i][j] = (dp[i - 1][j + 1] * (k - j) + sum[i - 1][j]) % MOD; 
			sum[i][j] = (sum[i][j - 1] + dp[i][j]) % MOD; 
		}
	}
	for (int i = 0; i + m <= n; i++)
	{
		if (~lp)
			(ans -= dp[i][lp] * dp[n - (i + m)][m - rp - 1]) %= MOD; 
		else
		{
			ll cur = 1;
			for (int j = i + m; j - i < k && j <= n; j++)
			{
				(ans -= dp[i][j - i] * (j == n ? 1 : sum[n - j - 1][j - i]) % MOD * cur) %= MOD; 
				cur = cur * (k - j + i) % MOD; 
			}
		}
	}
	printf("%lld\n", (ans + MOD) % MOD);
	return 0; 
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:17: error: 'memset' was not declared in this scope
   30 |                 memset(vis, false, sizeof(vis));
      |                 ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <cstdio>
  +++ |+#include <cstring>
    3 | #define MOD 1000000007
a.cc:45:9: error: 'memset' was not declared in this scope
   45 |         memset(vis, false, sizeof(vis));
      |         ^~~~~~
a.cc:45:9: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

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

string a;
int b=0;

int main () {
  cin >> a;
  for(int i=0; i<a.length(); i++){
    cout << a[i] << endl;
    if (a[i] == '+') {
      b=b+1;
    } else if (a[i] == '-') {
      b=b-1
    }
  }
  cout << b << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:12: error: expected ';' before '}' token
   14 |       b=b-1
      |            ^
      |            ;
   15 |     }
      |     ~
Language: C++

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

string a;
int b=0;

int main () {
  cin >> a;
  for(int i=0; i<a.length(); i++){
    if (a[i] == '+') {
      b=b+1;
      cout << b << endl;
    } else if (a[i] == '-') {
      b=b-1
      cout << b << endl;
    }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:12: error: expected ';' before 'cout'
   14 |       b=b-1
      |            ^
      |            ;
   15 |       cout << b << endl;
      |       ~~~~