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

#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <functional>
#include <climits>
#include <cstring>

using namespace std;

#define int long long
#define rep(i, n) for (int i=0;i<(int)n;++i)
#define rep1(i, n) for (int i=1;i<=(int)n;++i)
#define unless(a) if(!(a))
#define all(a) begin(a),end(a)
#define fst first
#define scd second
#define PB emplace_back
#define PPB pop_back

using ll=long long;
using vi=vector<int>;
using pii=pair<int, int>;

constexpr ll TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n - 1); }
bool chmin(int&a,int b){return a>b?(a=b,true):false;}
bool chmax(int&a,int b){return a<b?(a=b,true):false;}
ll read(){ll a;scanf("%lld",&a);return a;}

const int inf = TEN(9) + 10;
const int mod = TEN(9) + 10;

int odd_sum[200010]; // 奇数項の和
int even_sum[200010]; // 偶数項の和
int rui_mx[200010], rui_rev_mx[200010];

int N;
signed main()
{
	cin >> N;
	vi A(N+2);
	rep1(i,N)cin>>A[i];

	for (int i = 1; i <= N; i+=2)  {
		odd_sum[i] = A[i];
		if (i - 2 >= 0) {
			odd_sum[i] += odd_sum[i - 2];
			odd_sum[i - 1] = odd_sum[i - 2];
		}
	}

	for (int i = 2; i <= N; i+=2)  {
		even_sum[i] = A[i];
		if (i - 2 >= 0) {
			even_sum[i] += even_sum[i - 2];
			even_sum[i - 1] = even_sum[i - 2];
		}
	}

	if (N % 2 == 0) {
		int mx = odd_sum[N - 1];
		chmax(mx, even_sum[N]);
		//1hajimari
		for (int i = 1; i + 3 <= N; i += 2) { // iで2飛ばす
			if (i + 3 <= N) chmax(mx, odd_sum[i] + even_sum[N] - even_sum[i + 2]);
		}
		cout<<mx<<endl;
	} else { // N is od
		int mx = odd_sum[N] - odd_sum[1]; // 3 から始まる
		
		// 2始まり
		chmax(mx, even_sum[N - 1]);
		for (int i = 2; i+3 <= N; i += 2) { // iで2飛ばす
			if (i + 3 <= N) chmax(mx, even_sum[i] + odd_sum[N] - odd_sum[i + 1]);
		}

		// 1始まり
		chmax(mx, odd_sum[N - 2]);
		for (int i = 1; i +4<= N; i += 2) { // iで1度だけ3飛ばす
			chmax(mx, odd_sum[i] + odd_sum[N] - odd_sum[i + 2]);
		}
		// 1で始まって2 飛ばしを2回する
		// 前処理
		for (int i = 4; i <= N - 3; i += 2) {
			rui_mx[i] = odd_sum[i - 3];
			chmax(rui_mx[i], rui_mx[i - 2]);
		}
		for (int i = N - 3; i >= 1; i -= 2) {
			rui_rev_mx[i] = odd_sum[i + 3] - odd_sum[i];
			chmax(rui_rev_mx[i], rui_rev_mx[i + 2]);
		}

		for (int i = 4; i <= N; i += 2) {
			chmax(mx, rui_mx[i] + A[i] + rui_rev_mx[i]);
		}

		cout << mx << endl;
	}
}




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

n=int(input())
vals= input()
a= list(map(int,vals.split()))
count=0
a.sort()
if n%2==0:
    for i in range(0,int(n/2)):
        count=count+a[2*i+1]
elif n%2==1:
    for j in range(1,int((n+1)/2)):
        count=count+a[2*j]
print(count)


Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | n=int(input())
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
main.c:1:3: error: expected expression before 'int'
    1 | n=int(input())
      |   ^~~
Language: C

#include <bits/stdc++.h>
#define rep(begin, end) for (i=begin;i<end;i++)
#define init(arr, val) for (i=0;i<end;i++) arr[i] = val;
#define prlong longlong long(i0, i1) prlong longf("%d %d\n", i0, i1)

using namespace std;
const long long inf = pow(10,9);
const long long nil = -1;
long long i, j, n, m, k, ans;
long long a[200000];
long long accumeven[100000];
long long accumodd[100000];

long long calc(long long i) {
    if (i == 1) return max(max(a[0], a[1]), a[2]);
    long long sum = accumeven[i-1];
    for (j=1;j<i;j++) sum = max(accumeven[j-1] + accumodd[i-1] - accumodd[j-1], sum);
    sum = max(a[n]+calc(i-1), sum);
    return sum;
}

int main() {
    scanf(" %lld", &n);
    rep(0,n) {
        scanf(" %lld", &a[i]);
        if (i == 0) accumeven[i] = a[i];
        else if (i == 1) accumodd[i] = a[i];
        else if (i%2 == 0) accumeven[i] = accumeven[i-1] + a[i];
        else accumodd[i] = accumodd[i-1] + a[i];
    }
    if (n%2 == 0) {
        long long even = 0;
        long long odd = 0;
        rep(0, n/2) {
            even += a[2*i];
            odd += a[2*i+1];
        }
        printf("%lld\n", max(even, odd));
    } else {
        ans = calc(n);
        printf("%lld\n", ans);
    }
}

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 <bits/stdc++.h>
#ifdef HIRO
#define d(f_, ...) printf((f_), ##__VA_ARGS__)
#else
#define d(f_, ...)
#endif

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<long long, long long> pllll;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef vector< pair<int, int> > vii;
typedef vector< pair<long long, long long> > vllll;
typedef map<int, int> mii;
typedef map<long long, long long> mllll;
typedef queue<int> qi;
typedef queue< pair<int, int> > qp;
#define mp make_pair
#define pi 3.14159265358979323846
#define MAX max_element
#define MIN min_element
#define all(v) v.begin(), v.end()
#define gt(T) greater<T>()
#define sum(v) accumulate(v.begin(), v.end(), 0ll)
#define uni(v) do{ \
  sort(v.begin(), v.end()); \
  decltype(v)::iterator result = unique(v.begin(), v.end()); \
  v.erase(result, v.end()); \
}while(0)
#define fi(init, n) for(int i = init; i < n; ++i)
#define fj(init, n) for(int j = init; j < n; ++j)
#define fk(init, n) for(int k = init; k < n; ++k)
#define zero(x) memset(x, 0, sizeof(x))
#define negative(x) memset(x, ~0, sizeof(x))
#define bitsum(x) __builtin_popcount(x)
const ll MOD = 1e9 + 7;
const int INF = 1e9;
const int di[] = { 0, 1, 0, -1 };
const int dj[] = { 1, 0, -1, 0 };

template<typename T>
T gcd(T a, T b) {
	return b ? gcd(b, a % b) : a;
}
template<typename T>
T lcm(T a, T b) {
	return a / gcd(a, b) * b;
}
template<typename T>
int finder(vector<T> vec, T number) {
	auto itr = find(vec.begin(), vec.end(), number);
	size_t index = distance(vec.begin(), itr);
	if (index != vec.size()) return 1;
	else return 0;
}
ll frac(ll n){
	if (n == 0) return 1;
	return (n * frac(n - 1)) % MOD;
}
template<class T> inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template<class T> inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}

int main(int argc, char** argv) {
#ifdef HIRO
  string quiz(argv[1]);
  string id(argv[2]);
  string filename("input/" + quiz + "/" + id + ".txt");
  ifstream fin(filename);
  if (fin.peek() == ifstream::traits_type::eof()) {
    cout << "No input.";
    return 0;
  }
  ifstream cin(filename);
  std::cin.rdbuf(cin.rdbuf());
#endif
  ll ans = 0;
  ll n;
  cin >> n;
  // ll n, m;
  // cin >> n >> m;
  // ll n, m, k;
  // cin >> n >> m >> k;
  ll arr[n];
  ll odd = 0, even = 0;
  fi(0, n) {
    cin >> arr[i];
    if(i % 2)
      odd += arr[i];
    else
      even += arr[i];
  }
  if(n % 2) {
    if(n <= 5)
      ans = max(odd, max(even - arr[0], even - arr[n - 1]));
    else {
      fi(0, n) {
        if(i % 2) {
          ll x = even - arr[i - 1] - arr[i + 1];
          fj(i - 1, i + 2) {
            chmax(ans, x + arr[j]);
          }
        }
      }
    }
  }
  else {
    ans = max(odd, even);
  }
  cout << ans << endl;
  return 0;
}



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++

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

//先頭からのn個からk個選ぶ時の最大値
long long sum(long long n,long long k,vector<long long> &a){
    if(k==0) return 0;
    if(n==2*k-1) {
        long long x=0;
        for(int i=0;i<n;i+=2) x+=a.at(i);
        return x;
    }
    long long M;
    M=a.at(n-1)+sum(n-2,k-1,a);
    int h=2*(k-1);
    for(int i=n-2;i>=0;i--){
        if((i/2)<(k-1)) break;
        long long m=a.at(i)+sum(i-1,k-1,a);
        if(m>M) M=m;
    }
    return M;
}

int main() {

	int n,k;
    cin>>n;
    k=n/2;
    vector<int> a(n);
    for(auto &p:a) cin>>p;
    cout<<sum(n,k,a);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:19: error: invalid initialization of reference of type 'std::vector<long long int>&' from expression of type 'std::vector<int>'
   31 |     cout<<sum(n,k,a);
      |                   ^
a.cc:6:58: note: in passing argument 3 of 'long long int sum(long long int, long long int, std::vector<long long int>&)'
    6 | long long sum(long long n,long long k,vector<long long> &a){
      |                                       ~~~~~~~~~~~~~~~~~~~^
Language: C++

#include <iostream>
#include <algorithm>
#include <cstdlib>
using namespace std;
long long max (long long a, long long b) {if (a > b) return a; return b;}
 
int main()
{
    int N;
    int a[100005] = {0};
    long long dp1[100005] = {0};
    long long dp2[100005] = {0};
    long long dp3[100005] = {0};
    long long dp4[100005][3] = {0};
    long long sum = 0;
    cin >> N;
    for (int i = 0; i < N; ++i) cin >> a[i];
    for (int i = 0; i < N; i += 2) {
        sum += a[i];
        dp1[i] = sum;
    }
    sum = 0;
    for (int i = 1; i < N; i += 2) {
        sum += a[i];
        dp3[i] = sum;
    }
    sum = 0;
    for (int i = N - 1; i >= 0; i -= 2) {
        sum += a[i];
        dp2[i] = sum;
    }

    // for (int i = 0; i < N; ++i) {
    //     cout << dp1[i] << ' ';
    // }
    // cout << endl;
    // for (int i = 0; i < N; ++i) {
    //     cout << dp2[i] << ' ';
    // }
    // cout << endl;
    long long ans = 0;
    if (N % 2 == 0) {
        for (int i = 0; i < N; i += 2)
        {
            if (i + 3 < N) ans = max(ans, dp1[i] + dp2[i+3]);
            else ans = max(ans, dp1[i]);
        }
        for (int i = N-1; i >= 0; i -= 2)
        {
            if (i - 3 >= 0) ans = max(ans, dp2[i] + dp2[i-3]);
            else ans = max(ans, dp2[i]);
        }
        cout << ans << endl;
    } else {
        dp4[0][0] = a[0]; dp4[0][1] = INT_MIN;  dp4[0][2] = INT_MIN;
        dp4[1][1] = a[1]; 
        dp4[1][2] = INT_MIN; 
        dp4[1][0] = INT_MIN; 
        dp4[2][2] = a[2]; 
        for (int i = 2; i < N; i++) {
            dp4[i][0] = dp4[i-2][0] + a[i];
            dp4[i][1] = dp4[i-2][1]+a[i];
            if (i - 3 >= 0) dp4[i][1] = max(dp4[i][1], dp4[i-3][0] + a[i]); 
            dp4[i][2] = dp4[i-2][2]+a[i];
            if (i - 3 >= 0) dp4[i][2] = max(dp4[i][2], dp4[i-3][1] + a[i]); 
            if (i - 4 >= 0) dp4[i][2] = max(dp4[i][2], dp4[i-4][0] + a[i]); 
            ans = max(ans, dp4[i][0]);
            ans = max(ans, dp4[i][1]);
            ans = max(ans, dp4[i][2]);
        }
        cout << ans << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:55:39: error: 'INT_MIN' was not declared in this scope
   55 |         dp4[0][0] = a[0]; dp4[0][1] = INT_MIN;  dp4[0][2] = INT_MIN;
      |                                       ^~~~~~~
a.cc:4:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include <cstdlib>
  +++ |+#include <climits>
    4 | using namespace std;
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  long long A,B,C,D,H,K,L,M,N,T,W,X;
  string S;
  cin >> N;
  vector<long long> vec(N)
  long long dp[N][5];
  for (int i=0;i<N;i++) {cin >> vec.at(N);}
  
  A=0;
  
  if (N%2==0) {
    dp[1][0]=vec[0];
	dp[1][1]=vec[1];
	for (int j=2;j<N/2+1;j++) {
	  dp[j][0]=dp[j-1][0]+vec[j*2-1];
	  dp[j][1]=min(dp[j-1][0]+vec[j*2-2],dp[j-1][1]+vec[j*2-2]);
	}
	cout << min(dp[N/2][0],dp[N/2][1]) << endl;
	}
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: expected ',' or ';' before 'long'
    9 |   long long dp[N][5];
      |   ^~~~
a.cc:15:5: error: 'dp' was not declared in this scope; did you mean 'dup'?
   15 |     dp[1][0]=vec[0];
      |     ^~
      |     dup
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <assert.h>
#include <numeric>

using namespace std;

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

ll max_ll(ll a, ll b){
  if(a < b)[
    return b;
  ]
  else{
    return a;
  }
}

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

  ll ans = 0;
  if(N%2 == 0){
     for(int i=0;i<N/2;i++){
       ans += max_ll(A[2*i], A[2*i+1]);
     }
  }

  cout << ans << endl;
}


Compiler output:
a.cc: In function 'long long int max_ll(long long int, long long int)':
a.cc:18:5: error: expected identifier before 'return'
   18 |     return b;
      |     ^~~~~~
a.cc:18:13: error: expected ']' before ';' token
   18 |     return b;
      |             ^
      |             ]
a.cc: In lambda function:
a.cc:18:13: error: expected '{' before ';' token
a.cc: In function 'long long int max_ll(long long int, long long int)':
a.cc:19:3: error: expected primary-expression before ']' token
   19 |   ]
      |   ^
a.cc:23:1: warning: no return statement in function returning non-void [-Wreturn-type]
   23 | }
      | ^
Language: C++

#include <cstdio>
#include <iostream>
#include <algorithm>

using namespace std;

const int maxn = 2*1e5+5;
const int INF = 0x3f3f3f3f;
int n,sum;
long long f[maxn][maxn];
int a[maxn];

int main() {
	scanf("%d",&n);
	for (int i = 1; i <= n; i++) {
		scanf("%d",&a[i]);
	}
	
	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= i; j++) {
			f[i][j] = -INF;
		}
	}

	for (int i = 1; i <= n; i++) {
		f[i][0] = 0;
		f[0][i] = 0;
	}
	for (int i = 1; i <= n; i++) {
		for (int j = 1; j < i; j++) {
			if (i == 1) {
				f[i][j] = a[i];
			}
			f[i][j] = max(f[i-1][j],f[i-2][j-1]+a[i]);
			//cout << i << " " << j << endl;
		}
	}
	long long ans = -INF;
	for (int i = 1; i <= n; i++) {
		ans = max(ans,f[i][n/2]);
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
/tmp/ccrWN6wL.o: in function `main':
a.cc:(.text+0x3f): relocation truncated to fit: R_X86_64_PC32 against symbol `a' defined in .bss section in /tmp/ccrWN6wL.o
a.cc:(.text+0x142): relocation truncated to fit: R_X86_64_PC32 against symbol `a' defined in .bss section in /tmp/ccrWN6wL.o
a.cc:(.text+0x1b2): relocation truncated to fit: R_X86_64_PC32 against symbol `a' defined in .bss section in /tmp/ccrWN6wL.o
collect2: error: ld returned 1 exit status
Language: Java

import java.util.*;
import java.lang.Math;

public class scratch {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    // 整数の入力
    int n = sc.nextInt();
    List<Long> a = new ArrayList<>();
    for (int i = 0; i < n; i++) {
      a.add(sc.nextLong());
    }
    if (n % 2 == 0) {
      long even = 0;
      long odd = 0;
      for (int i = 0; i < n / 2; i++) {
        even += a.get(2 * i);
        odd += a.get(2 * i + 1);
      }
      if (even > odd) {
        System.out.println(even);
      } else {
        System.out.println(odd);
      }
      return;
    }
    System.out.println(Math.max(culc(a, n - 1, true, 2), culc(a, n - 1, false, 2));
  }

  static Map<Integer, Map<Boolean, Map<Integer, Long>>> map = new HashMap<>();

  static long culc(List<Long> list, int i, boolean choice, int remainBlank) {
    Map<Boolean, Map<Integer, Long>> booleanMapMap = map.get(i);
    if (booleanMapMap != null) {
      Map<Integer, Long> integerLongMap = booleanMapMap.get(choice);
      Long aLong = integerLongMap.get(remainBlank);
      if (aLong != null) {
        return aLong;
      }
    } else {
      booleanMapMap = new HashMap<>();
      booleanMapMap.put(true, new HashMap<>());
      booleanMapMap.put(false, new HashMap<>());
      map.put(i, booleanMapMap);
    }
    Map<Integer, Long> integerLongMap = booleanMapMap.get(choice);
    if (choice) {
      long t = list.get(i) + culc(list, i - 1, false, remainBlank);
      integerLongMap.put(remainBlank, t);
      return t;
    } else {
      long t = 0;
      if (remainBlank > 0) {
        t = Math.max(culc(list, i - 1, true, remainBlank), culc(list, i - 1, true, remainBlank - 1));
      } else {
        t = culc(list, i - 1, true, remainBlank);
      }
      integerLongMap.put(remainBlank, t);
      return t;
    }
  }
}


Compiler output:
Main.java:27: error: ')' or ',' expected
    System.out.println(Math.max(culc(a, n - 1, true, 2), culc(a, n - 1, false, 2));
                                                                                  ^
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  long long A,B,C,D,H,K,L,M,N,T,W,X;
  string S;
  cin >> N;
  vector<long long> vec(N)
  long long dp[N][5]
  for (int i=0;i<N;i++) {cin >> vec.at(N);}
  
  A=0;
  
  if (N%2==0) {
    dp[1][0]=vec[0];
	dp[1][1]=vec[1];
	for (int j=2;j<N/2+1;j++) {
	  dp[j][0]=dp[j-1][0]+vec[j*2-1];
	  dp[j][1]=min(dp[j-1][0]+vec[j*2-2],dp[j-1][1]+vec[j*2-2])
	}
	cout << min(dp[N/2][0],dp[N/2][1]) << endl;
	}
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: expected ',' or ';' before 'long'
    9 |   long long dp[N][5]
      |   ^~~~
a.cc:10:16: error: 'i' was not declared in this scope
   10 |   for (int i=0;i<N;i++) {cin >> vec.at(N);}
      |                ^
a.cc:15:5: error: 'dp' was not declared in this scope; did you mean 'dup'?
   15 |     dp[1][0]=vec[0];
      |     ^~
      |     dup
Language: C++

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

//先頭からのn個からk個選ぶ時の最大値
long long sum(long long n,long long k,vector<long long> &a){
    if(k==0) return 0;
    if(n==2*k-1) {
        long long x=0;
        for(int i=0;i<n;i+=2) x+=a.at(i);
        return x;
    }
    long long M;
    M=a.at(n-1)+sum(n-2,k-1,a);
    int h=2*(k-1);
    for(int i=n-2;i>=0;i--){
        if(i<h) break;
        long long m=a.at(i)+sum(i-1,k-1,a);
        if(m>M) M=m;
    }
    return M;
}

int main() {

	int n,k;
    cin>>n;
    k=n/2;
    vector<int> a(n);
    for(auto &p:a) cin>>p;
    cout<<sum(n,k,a);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:19: error: invalid initialization of reference of type 'std::vector<long long int>&' from expression of type 'std::vector<int>'
   31 |     cout<<sum(n,k,a);
      |                   ^
a.cc:6:58: note: in passing argument 3 of 'long long int sum(long long int, long long int, std::vector<long long int>&)'
    6 | long long sum(long long n,long long k,vector<long long> &a){
      |                                       ~~~~~~~~~~~~~~~~~~~^
Language: C

#include <bits/stdc++.h>

using namespace std;
using ll = long long;

void solve() {
    int n;
    cin >> n;
    vector<ll> a(n);
    for (auto& x : a) {
        cin >> x;
    }

    vector<ll> dp(n), dpeven(n);
    dp[0] = 0;
    dp[1] = max(a[0], a[1]);
    dpeven[0] = a[0];
    dpeven[1] = max(a[0], a[1]);
    for (int i = 2; i < n; ++i) {
        if (i % 2 == 0) {
            dpeven[i] = a[i] + dpeven[i - 2];
            dp[i] = max(a[i] + dp[i - 2], dp[i - 1]);
        } else {
            dpeven[i] = max(a[i] + dpeven[i - 2], a[i - 1] + dpeven[i - 3]);
            dp[i] = max(a[i] + dp[i - 2], a[i - 1] + dpeven[i - 3]);
        }
    }
    cout << dp[n - 1];
}

int main() {
    ios::sync_with_stdio(NULL), cin.tie(0), cout.tie(0);
    cout.setf(ios::fixed), cout.precision(20);

    solve();
}


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

public class Main
{ 
    int FindMaxSum(int arr[], int n) 
    { 
        int incl = arr[0]; 
        int excl = 0; 
        int excl_new; 
        int i; 
  
        for (i = 1; i < n; i++) 
        { 
            excl_new = (incl > excl) ? incl : excl; 
            incl = excl + arr[i]; 
            excl = excl_new; 
        } 
        return ((incl > excl) ? incl : excl); 
    }  
    public static void main(String[] args) 
    { 
        MaximumSum sum = new MaximumSum(); 
        int arr[] = new int[]{5, 5, 10, 100, 10, 5}; 
        System.out.println(sum.FindMaxSum(arr, arr.length)); 
    } 
} 

Compiler output:
Main.java:20: error: cannot find symbol
        MaximumSum sum = new MaximumSum(); 
        ^
  symbol:   class MaximumSum
  location: class Main
Main.java:20: error: cannot find symbol
        MaximumSum sum = new MaximumSum(); 
                             ^
  symbol:   class MaximumSum
  location: class Main
2 errors
Language: C++

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

/*long long findMaxi(long long* arr,long long n,long long k,long long** dp){

    for(long long i=0;i<=k;i++){
        dp[0][i]=INT_MIN;
    }

    for(long long i=0;i<=n;i++){
        dp[i][0]=0;
    }
    dp[0][0]=0;
    for(long long j=1;j<=k;j++){
        for(long long i=2*j;i<=n;i++){
            long long op1=INT_MIN;

            if(i>=2){
                op1=arr[i-1]+dp[i-2][j-1];
            }
            long long op2=dp[i-1][j];
            dp[i][j]=max(op1,op2);
        }
    }
    return dp[n][k];
}
*/
long long findMax(long long* arr,long long n,long long k,long long** dp){
    if(k==0){
        return 0;
    }
    if(n<=0){
        return INT_MIN;
    }
    if(dp[n][k]>0){
        return dp[n][k];
    }
    long long op1=arr[n-1]+findMax(arr,n-2,k-1,dp);
    long long op2=findMax(arr,n-1,k,dp);
    return dp[n][k]=max(op1,op2);
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    long long n;
    cin>>n;
    long long* arr=new long long[n];
    for(long long i=0;i<n;i++){
        cin>>arr[i];
    }

    long long k=n/2;
    long long** dp=new long long*[n+1];
    for(long long i=0;i<=n;i++){
        dp[i]=new long long[k+1];
    }
    cout<<findMaxi(arr,n,n/2,dp);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:58:11: error: 'findMaxi' was not declared in this scope; did you mean 'findMax'?
   58 |     cout<<findMaxi(arr,n,n/2,dp);
      |           ^~~~~~~~
      |           findMax
Language: C

n= int(input())
vals= input()
a= list(map(int,vals.split()))
count=0
a.sort()
if n%2==0:
    for i in range(0,int(n/2)):
        count=count+a[2*i+1]
elif n%2==1:
    for j in range(1,int((n+1)/2)):
        count=count+a[2*j]
print(count)


Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | n= int(input())
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
main.c:1:4: error: expected expression before 'int'
    1 | n= int(input())
      |    ^~~
Language: C

#include<iostream>

using namespace std;

int main() {
	long long n;
	cin >> n;
	long long* a = new long long[n];
	long long m;
	long long sum;

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

	m = 0;

	for (int i = 0;i < n / 2;i++) {
		m += a[2 * i];
	}


	if (n % 2 == 0) {
		for (int i = 0;i <= n / 2;i++) {
			sum = 0;
			for (int j = 0;j < n / 2;j++) {
				if (j >= i)sum += a[2*j + 1];
				else sum += a[2*j];
			}
			if (sum > m)m=sum;
		}
	}
	else {
		for (int i = 0;i <= n / 2;i++) {
			for (int j = i;j <= n / 2;j++) {
				sum = 0;
				for (int k = 0;k < n / 2;k++) {
					if (k >= j)sum += a[2 * k + 2];
					else if (k >= i)sum += a[2 * k + 1];
					else sum += a[2 * k];
				}
				if (sum > m)m=sum;
			}
		}
	
	}
	cout << m << "\n";
	return 0;




}

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

#include <algorithm>
#include <iostream>
#include <vector>
#include <string>
#include <map>
using namespace std;


typedef long long ll;

ll dp[200010][3][2];
ll INF = 10000000000;
// ll INF = 1000;

int main() {
  ll n; cin >> n;
  ll off = (n/2)*INF;
  for (int i = 0; i < n; ++i) { 
    ll a; cin >> a; a+=INF;
    if (dp[i+1][1][0] > 0) {
      dp[i+2][2][0] = dp[i+1][1][0];
    }
    if (dp[i+1][2][1] > 0) { 
      dp[i+2][2][0] = max(dp[i+2][2][0],dp[i+1][2][1]);
    }
    if (dp[i+1][2][0] > 0) {
      dp[i+2][2][1] = dp[i+1][2][0]+a;
    }
    if (dp[i+1][0][0] > 0) {
      dp[i+2][1][0] = dp[i+1][0][0];
    }
    if (dp[i+1][1][1] > 0) { 
      dp[i+2][1][0] = max(dp[i+2][1][0],dp[i+1][1][1]);
    }
    if (dp[i+1][1][0] > 0) {
      dp[i+2][1][1] = dp[i+1][1][0]+a;
    }
    if (dp[i+1][0][1] > 0) {
      dp[i+2][0][0] = dp[i+1][0][1];
    }
    if (dp[i+1][0][0] > 0) {
      dp[i+2][0][1] = dp[i+1][0][0]+a;
    }
    else {
      dp[i+2][0][1] = a;
    }
    // cerr << i << " " << dp[i+2][0][0] << endl;
    // cerr << i << " " << dp[i+2][1][0] << endl;
    // cerr << i << " " << dp[i+2][2][0] << endl;
    // cerr << i << " " << dp[i+2][0][1] << endl;
    // cerr << i << " " << dp[i+2][1][1] << endl;
    // cerr << i << " " << dp[i+2][2][1] << endl;
  }
  ll ans = 0;
  if (n == 5) {
    cout << 0 << endl;
    return 0;
  }
  if (n%2 == 0) { 
    for (int i = 0; i < 2; ++i) {
      for (int j = 0; j < 2; ++j) {
        ans = max(ans, dp[n+1][i][j]);
      }
    }
  }
  else {
    for (int i = 1; i < 3; ++i) {
      for (int j = 0; j < 2; ++j) {
        ans = max(ans, dp[n+1][i][j]);
      }
    }
  }
  cout << ans-off << endl;
}


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

#include <bits/stdc++.h>

using namespace std;
#define inf 1000000000
#define unvisited -1
#define visited 1
#define eps 1e-9
#define mp make_pair
#define pb push_back
#define pi acos(-1.0)
#define uint64 unsigned long long
#define FastSlowInput ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define debug if(true)
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;

int a[200001];
ll dp[200001][4];

int n;

ll maks;

ll solve(int idx, int rem) {
	if(idx == n){return 0;}
	if(rem == 0){return -inf;}
	if(idx == n-3 && rem == 3){return a[idx];}
	if(idx == n-2 && rem == 2){return a[idx];}
	if(idx == n-1 && rem == 1){return a[idx];}
	
	if(dp[idx][rem] != maks){return dp[idx][rem];}
	return dp[idx][rem] = max(a[idx] + solve(idx+2, rem), solve(idx+1, rem-1));
}

int main(){
	int i,j;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&a[i]);
	}

	if(n % 2 == 0){
		ll sum1 = 0;
		for(i=0;i<n;i+=2){
			sum1 += a[i];
		}
		ll sum2 = 0;
		for(i=1;i<n;i+=2){
			sum2 += a[i];
		}
		printf("%lld\n",max(sum1, sum2));
		return 0;
	}
	maks = (ll)inf*(ll)inf;
	for(i=0;i<=200000;i++){
		for(j=0;j<=3;j++){
			dp[i][j] = -maks
		}
	}
	// memset(dp, -1, sizeof dp);

	ll ans = solve(0, 3);
	printf("%lld\n",ans);

	return 0;
};

Compiler output:
a.cc: In function 'int main()':
a.cc:59:41: error: expected ';' before '}' token
   59 |                         dp[i][j] = -maks
      |                                         ^
      |                                         ;
   60 |                 }
      |                 ~
Language: C

# input()
# int(input())
# map(int, input().split())
# list(map(int, input().split()))
#二部探索

import numpy as np
n = int(input())
a = np.array(list(map(int, input().split())))
inda = np.argsort(-a)
lena = inda.size
judge = [True for i in range(lena+2)]
take = n//2
ans = 0
ind = 0
count = 0
while True:
    if judge[inda[ind]+2] and judge[inda[ind]]:
        ans += a[inda[ind]]
        count+=1
        judge[inda[ind] + 1] = False
        ind += 1
        if count==take:
            break
    else:
        ind+=1
print(ans)

Compiler output:
main.c:1:3: error: invalid preprocessing directive #input
    1 | # input()
      |   ^~~~~
main.c:2:3: error: invalid preprocessing directive #int
    2 | # int(input())
      |   ^~~
main.c:3:3: error: invalid preprocessing directive #map
    3 | # map(int, input().split())
      |   ^~~
main.c:4:3: error: invalid preprocessing directive #list
    4 | # list(map(int, input().split()))
      |   ^~~~
main.c:5:2: error: invalid preprocessing directive #\U00004e8c\U000090e8\U000063a2\U00007d22
    5 | #二部探索
      |  ^~~~~~~~
main.c:7:1: error: unknown type name 'import'
    7 | import numpy as np
      | ^~~~~~
main.c:7:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'as'
    7 | import numpy as np
      |              ^~
main.c:7:14: error: unknown type name 'as'
Language: C++

#include <cstdio>
#include <algorithm>

long long dp[200001][2][3];
long long

int main()
{
	int n;
	scanf("%d", &n);
	int a[200000];
	for (int i = 0; i < n; ++i)
	{
		scanf("%d", a + i);
	}
	if (n % 2 == 0)
	{
		long long p1 = 0;
		long long p2 = 0;
		for (int i = 0; i < n; i += 2)
		{
			p1 += (long long)a[i];
			p2 += (long long)a[i + 1];
		}
		printf("%lld\n", std::max(p1, p2));
		return 0;
	}

	dp[1][1][0] = a[0];
	dp[1][1][1] = -1e15;
	dp[1][1][2] = -1e15;

	dp[1][0][0] = -1e15;
	dp[1][0][1] = 0;
	dp[1][0][2] = -1e15;

	dp[2][1][0] = -1e15;
	dp[2][1][1] = a[1];
	dp[2][1][2] = -1e15;

	dp[2][0][0] = a[0];
	dp[2][0][1] = -1e15;
	dp[2][0][2] = 0;

	for (int i = 3; i <= n; ++i)
	{
		dp[i][1][0] = dp[i - 1][0][0];
		dp[i][1][1] = a[i - 1] + std::max(dp[i - 1][0][1], dp[i - 2][0][0]);
		dp[i][1][2] = a[i - 1] + std::max(dp[i - 1][0][2], dp[i - 2][0][1]);
		dp[i][0][0] = dp[i - 1][1][0];
		dp[i][0][1] = std::max(dp[i - 1][1][1], dp[i - 2][1][0]);
		dp[i][0][2] = std::max(dp[i - 1][1][2], dp[i - 2][1][1]);
	}
	long long ans = std::max(std::max(dp[n][1][1], dp[n][1][2]), std::max(dp[n][0][1], dp[n][0][2]));
	printf("%lld\n", ans);

	return 0;
}


Compiler output:
a.cc:7:1: error: '::main' must return 'int'
    7 | int main()
      | ^~~
Language: C

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

const int MOD=1000000007;
const int INF=0x3f3f3f3f;
const ll INFL=0x3f3f3f3f3f3f3f3f;

ll dp[300000][20][2];
ll a[300000];

int main(){
	int n;cin>>n;
	rep(i,n)scanf("%lld",&a[i]);
	if(n%2==0){
		ll s1=0,s2=0;
		rep(i,n){
			if(i%2==0)s1+=a[i];
			s2+=a[i];
		}
		cout<<max(s1,s2-s1)<<endl;
		return 0;
	}
	rep(i,n+1)rep(j,20)rep(k,2){
		dp[i][j][k]=-INFL;
	}
	dp[0][10][0]=0;
	rep(i,n)rep(j,20)rep(k,2){
		if(dp[i][j][k]==-INFL)continue;
		if(k==0&&j+1<20){
			dp[i+1][j+1][1]=max(dp[i+1][j+1][1],dp[i][j][k]+a[i]);
		}
		if(j-1>=0)dp[i+1][j-1][0]=max({dp[i+1][j-1][0],dp[i][j][k]});
	}
	cout<<max(dp[n][9][0],dp[n][9][1])<<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 <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(void){
    ll n,a[200001];
    cin>>n;
    for(int i=0;i<n;i++) cin>>a[i];
    ll ans=0;
    ll L[200001]={},R[200001]={};
    if(n%2==0){
        L[0]=a[0];
        for(int i=2;i<n;i+=2){
            L[i]=L[i-2]+a[i];
        }
        R[1]=a[1];
        for(int i=3;i<n;i+=2){
            R[i]=R[i-2]+a[i];
        }
        cout<<max(L[n-2],R[n-1]);
    }
    else{
        L[0]=a[0];
        for(int i=2;i<n;i+=2){
            L[i]=L[i-2]+a[i];
        }
        R[n-2]=a[n-2];
        for(int i=n-4;i>0;i-=2){
            R[i]=R[i+2]+a[i];
        }
        ans=R[1];
        for(int i=0;i<n;i+=2){
            ans=max(ans,L[n-1]-a[i]);
        }
        for(int i=0;i<n;i+=2){
            ans=max(ans,R[i]+L[n-2-2*i]);
        }
        ll Z[200001]={},X[200001]={};
        Z[1]=a[1];
        X[n-1]=a[n-1];
        for(int i=3;i<n;i+=2){
            Z[i]=Z[i-2]+a[i];
        }
        for(int i=n-1;i>=0;i-=2){
            X[i]=X[i+2]+a[i];
        }
        if(n>=5){
            for(int i=0;i<n-2;i+=2){
            ans=max(ans,Z[i+1]+X[4+2*i]);
                
            }
        }
        cout<<ans;
    }
}

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 <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define pb push_back
#define fi first
#define se second
#define sz(A) (int)(A.size())
#define all(x) (x).begin(),(x).end()
#define caset int ___T; cin>>___T; for(int cs=1;cs<=___T;cs++)
#define get(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
typedef long long ll;
typedef pair<int,int> PII;
typedef vector<int> VI;
const ll mod=1e9+7;
const int Max = 1e6+10;
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
void solve(){
	int n;
	cin>>n;
	VI a(n+1);
	rep(i,1,n+1){
		cin>>a[i];
	}
	vector<ll> dp(n+1,0);
	dp[1] = 0;
	vector<ll> prefix(n+1);
	prefix[1] = a[1];
	for(int i=3;i<=n;i+=2){
		prefix[i] = prefix[i-2]+a[i];
	}
	for(int i=2;i<=n;i++){
		if(i&1){
			dp[i]=max(dp[i-1],dp[i-2]+a[i]);
		}else{
			dp[i] = a[i] + dp[i-2];
			dp[i] = max(dp[i],prefix[i-1]);
		}
	}
	cout<<dp[n];
}
int main() {
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	//caset{
		solve();
	//}
  	return 0;
}






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<bits/stdc++.h>
#include<algorithm>
using namespace std;
int main()
{
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  long int n;
  long int *a=new long int[n];
  for(int i:a)cin>>a[i];
  for(int i =n-1 ;i>n/2;i=i-2)
  { 
    sum+=a[i];
  }
  

 cout<<c;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: 'begin' was not declared in this scope
   10 |   for(int i:a)cin>>a[i];
      |             ^
a.cc:10:13: note: suggested alternatives:
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166,
                 from a.cc:1:
/usr/include/c++/14/valarray:1238:5: note:   'std::begin'
 1238 |     begin(const valarray<_Tp>& __va) noexcept
      |     ^~~~~
In file included from /usr/include/c++/14/filesystem:53,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200:
/usr/include/c++/14/bits/fs_dir.h:608:3: note:   'std::filesystem::__cxx11::begin'
  608 |   begin(recursive_directory_iterator __iter) noexcept
      |   ^~~~~
a.cc:10:13: error: 'end' was not declared in this scope
   10 |   for(int i:a)cin>>a[i];
      |             ^
a.cc:10:13: note: suggested alternatives:
/usr/include/c++/14/valarray:1265:5: note:   'std::end'
 1265 |     end(const valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/bits/fs_dir.h:613:3: note:   'std::filesystem::__cxx11::end'
  613 |   end(recursive_directory_iterator) noexcept
      |   ^~~
a.cc:13:5: error: 'sum' was not declared in this scope
   13 |     sum+=a[i];
      |     ^~~
a.cc:17:8: error: 'c' was not declared in this scope
   17 |  cout<<c;
      |        ^
Language: C

### ----------------
### ここから
### ----------------

import sys
from io import StringIO
import unittest
import itertools

def yn(b):
    print("Yes" if b==1 else "No")
    return

def resolve():
    readline=sys.stdin.readline

    #n,m,k=map(int, readline().rstrip().split())
    #
    n=int(readline())
    aa=list(map(int, readline().rstrip().split()))
    #ss=readline().rstrip()
    #yn(1)
    c=n//2
    ans=0
    for cmb in itertools.combinations(list(range(n-c+1)),c):
        rui=0
        sm=0
        for i in range(len(cmb)):
            sm+=aa[cmb[i]+rui]
            rui+=1
        ans=max(ans,sm)
    print(ans)

    return

if 'doTest' not in globals():
    resolve()
    sys.exit()

### ----------------
### ここまで 
### ----------------


Compiler output:
main.c:1:1: error: stray '##' in program
    1 | ### ----------------
      | ^~
main.c:1:3: error: stray '#' in program
    1 | ### ----------------
      |   ^
main.c:1:5: error: expected identifier or '(' before '--' token
    1 | ### ----------------
      |     ^~
main.c:2:1: error: stray '##' in program
    2 | ### ここから
      | ^~
main.c:2:3: error: stray '#' in program
    2 | ### ここから
      |   ^
main.c:3:1: error: stray '##' in program
    3 | ### ----------------
      | ^~
main.c:3:3: error: stray '#' in program
    3 | ### ----------------
      |   ^
main.c:17:6: error: invalid preprocessing directive #n
   17 |     #n,m,k=map(int, readline().rstrip().split())
      |      ^
main.c:21:6: error: invalid preprocessing directive #ss
   21 |     #ss=readline().rstrip()
      |      ^~
main.c:22:6: error: invalid preprocessing directive #yn
   22 |     #yn(1)
      |      ^~
main.c:36:4: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes
   36 | if 'doTest' not in globals():
      |    ^~~~~~~~
main.c:40:1: error: stray '##' in program
   40 | ### ----------------
      | ^~
main.c:40:3: error: stray '#' in program
   40 | ### ----------------
      |   ^
main.c:41:1: error: stray '##' in program
   41 | ### ここまで
      | ^~
main.c:41:3: error: stray '#' in program
   41 | ### ここまで
      |   ^
main.c:42:1: error: stray '##' in program
   42 | ### ----------------
      | ^~
main.c:42:3: error: stray '#' in program
   42 | ### ----------------
      |   ^
Language: C

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

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

int N;
ll A[202020];

ll dp[202020][2][3];

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>N;
	
	FOR(i,N+1) FOR(x,2) FOR(y,3) dp[i][x][y]=-1LL<<60;
	dp[0][1][0]=0;
	
	FOR(i,N) {
		cin>>x;
		FOR(j,2) FOR(k,3) {
			// not take
			if(k+j<3) dp[i+1][1][k+j]=max(dp[i+1][1][k+j],dp[i][j][k]);
			// take
			if(j==1) dp[i+1][0][k]=max(dp[i+1][0][k],dp[i][j][k]+x);
		}
	}
	
	if(N%2==0) cout<<max(dp[N][1][0],dp[N][0][1])<<endl;
	else cout<<max(dp[N][0][2],dp[N][1][1])<<endl;
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}


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 <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep2(i, a, n) for(ll i = a; i < (ll)(n); i++)
#define memi cout << endl
#define kono(n) cout << fixed << setprecision(n)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define hina cout << ' '
#define in(n) cin >> n
#define in2(n, m) cin >> n >> m
#define in3(n, m, l) cin >> n >> m >> l
#define out(n) cout << n
const ll mei = (ll)1e9 + 7;

int main(){
  ll n, a, b;
  in(n);
  vector<ll> c(n), d(n / 2 + 1), e(n / 2);
  rep(i, n)
    in(c[i]);
  if(n % 2 == 0){
    a = 0;
    b = 0;
    rep(i, n / 2){
      a += c[2 * i];
      b += c[2 * i + 1];
    }
    out(max(a, b));
    memi;
    return 0;
  }
  ll k = n / 2;
  d[0] = c[0];
  rep(i, k)
    d[i + 1] = d[i] + c[2 * i + 2];
  e[0] = c[1];
  rep(i, k - 1)
    e[i + 1] = e[i] + c[2 * i + 3];
  

Compiler output:
a.cc: In function 'int main()':
a.cc:40:36: error: expected '}' at end of input
   40 |     e[i + 1] = e[i] + c[2 * i + 3];
      |                                    ^
a.cc:17:11: note: to match this '{'
   17 | int main(){
      |           ^
Language: C++

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

int main(){
	int n;
	cin>>n;
	int arr[n];
	for(int i=0;i<n;i++){
		cin>>arr[i];
	}
	long long incl=arr[0];
	long long excl=0;
	long long excl_new=0;
	for(int i=1;i<n;i++){
		excl_new = (incl > excl)? incl: excl;
		incl=excl+arr[i];
		excl=excl_new
	}
	if(incl>excl) cout<<incl<<"\n";
	else cout<<excl<<"\n";
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:30: error: expected ';' before '}' token
   17 |                 excl=excl_new
      |                              ^
      |                              ;
   18 |         }
      |         ~
Language: C

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

#define x first
#define y second
#define ndl '\n'
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define up_b upper_bound
#define low_b lower_bound
#define sz(x) (int)x.size()
#define bit __builtin_popcount
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()

using namespace std;
using namespace __gnu_pbds;

template<typename T> using indexed_set = tree <T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef long long ll;
typedef long double ld;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
typedef pair<int, ll> pil;
typedef pair<ll, int> pli;
typedef pair<int, ull> piu;
typedef vector<vector<int>> matrix;

const ll INF = 1e18 + 123;
const ld EPS = 1e-9;
const int inf = 1e9 + 123;
const int MOD = 1e9 + 7;
const int N = 5e5 + 123;
const int M = 1e6 + 123;
const double pi = acos(-1.0);
const int dx[] = {0, 0, 1, -1};
const int dy[] = {1, -1, 0, 0};

int a[N];

ll dp[N][3];

void relax(ll &a, ll b){
    a = max(a, b);
}

void solve(){
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++){
        cin >> a[i];
    }
    memset(dp, -0x3f, sizeof dp);
    dp[1][0] = a[1];
    for (int i = 2; i <= n; i++){
        relax(dp[i][0], dp[i-2][0] + a[i]);
        relax(dp[i][1], dp[i-2][1] + a[i]);
        relax(dp[i][2], dp[i-2][2] + a[i]);

        relax(dp[i][1], dp[i-1][0] + a[i]-a[i-1]);
        relax(dp[i][2], dp[i-1][1] + a[i]-a[i-1]);
    }
    cout << dp[n][1 + n%2];
}

int main(){
    #ifdef KAZAKH
        freopen("input.txt", "r", stdin);
    #endif
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int t = 1;
    //cin >> t;
    for (int i = 1; i <= t; i++){
        //cout << "case #" << i << ": ";
        solve();
    }
    return 0;
}


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 <string>
#include <cstring>
#include <algorithm>
#define ll long long int
using namespace std;

struct Data
{
	ll num;
	int index;
};

bool cmp(Data& a, Data& b)
{
	return a.num > b.num;
}

int main(void)
{
	int len = 0;
	cin >> len;
	data* a=new data[len];
	bool* vis=new bool[len];
	for (int i = 0; i < len; ++i) {
		cin >> a[i].num;
		a[i].index = i;
	}
	sort(a, a + len, cmp);
	memset(vis, true, sizeof(bool) * 300005);
	double res = 0;
	int amount=0;
	for (int i = 0; amount<len/2&&i<len; ++i) {
		if (vis[a[i].index]){
			res = res + a[i].num;
			if (a[i].index - 1 >= 0)
				vis[a[i].index - 1] = false;
			if (a[i].index + 1 < len)
				vis[a[i].index + 1] = false;
			vis[a[i].index] = false;
			++amount;
		}
	}
	cout << res;
	delete[] a;
	delete[] vis;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:15: error: 'a' was not declared in this scope
   23 |         data* a=new data[len];
      |               ^
a.cc:23:21: error: 'data' does not name a type; did you mean 'Data'?
   23 |         data* a=new data[len];
      |                     ^~~~
      |                     Data
a.cc:45:9: error: type '<type error>' argument given to 'delete', expected pointer
   45 |         delete[] a;
      |         ^~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
#define int long long
#define mod 1000000000000000000‬
#define for1(i, n) for(int i = 1; i <= (n);i++)
using namespace std;
int n, a[234567], dp[234567][5][5];//i,num,last
signed main() {
	cin >> n;
	dp[0][0][0] = 0;
	dp[0][0][1] = -mod;
	dp[0][1][0] = -mod;
	dp[0][1][1] = -mod;
	dp[0][2][0] = -mod;
	dp[0][2][1] = -mod;
	for1(i, n) {
		cin >> a[i];
		dp[i][0][0] = dp[i - 1][0][1];
		dp[i][0][1] = dp[i - 1][0][0] + a[i];
		dp[i][1][0] = max(dp[i - 1][0][0], dp[i - 1][1][1]);
		dp[i][1][1] = dp[i - 1][1][0] + a[i];
		dp[i][2][0] = max(dp[i - 1][1][0], dp[i - 1][2][1]);
		dp[i][2][1] = dp[i - 1][2][0] + a[i];
	}
	cout << max(dp[n][n%2+1][0], dp[n][n % 2 + 1][1]) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:13: error: unable to find numeric literal operator 'operator""\U0000202c'
    3 | #define mod 1000000000000000000‬
      |             ^~~~~~~~~~~~~~~~~~~
a.cc:10:24: note: in expansion of macro 'mod'
   10 |         dp[0][0][1] = -mod;
      |                        ^~~
a.cc:3:13: error: unable to find numeric literal operator 'operator""\U0000202c'
    3 | #define mod 1000000000000000000‬
      |             ^~~~~~~~~~~~~~~~~~~
a.cc:11:24: note: in expansion of macro 'mod'
   11 |         dp[0][1][0] = -mod;
      |                        ^~~
a.cc:3:13: error: unable to find numeric literal operator 'operator""\U0000202c'
    3 | #define mod 1000000000000000000‬
      |             ^~~~~~~~~~~~~~~~~~~
a.cc:12:24: note: in expansion of macro 'mod'
   12 |         dp[0][1][1] = -mod;
      |                        ^~~
a.cc:3:13: error: unable to find numeric literal operator 'operator""\U0000202c'
    3 | #define mod 1000000000000000000‬
      |             ^~~~~~~~~~~~~~~~~~~
a.cc:13:24: note: in expansion of macro 'mod'
   13 |         dp[0][2][0] = -mod;
      |                        ^~~
a.cc:3:13: error: unable to find numeric literal operator 'operator""\U0000202c'
    3 | #define mod 1000000000000000000‬
      |             ^~~~~~~~~~~~~~~~~~~
a.cc:14:24: note: in expansion of macro 'mod'
   14 |         dp[0][2][1] = -mod;
      |                        ^~~
Language: C

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using P = pair<ll,ll>;
const ll mod = 1e9+7;
#define ALL(x) (x).begin(),(x).end()
#define pow(x,y) modpow(x,y)
#define REP(i,n) for(ll (i)=0;(i)<(n);(i)++)
#define REPS(i,n) for(ll (i)=1;(i)<=(n);(i)++)
#define RREP(i,n) for(ll (i)=(n-1);(i)>=0;(i)--)
#define RREPS(i,n) for(ll (i)=(n);(i)>0;(i)--)
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define UNIQUE(v) v.erase(unique(ALL(v)),v.end());

template <class T = int>T in(){
    T x;
    cin >> x;
    return (x);
}

template<class T> inline void chmin(T& a, T b){
    if (a > b){
        a = b;
    }
}

template<class T> inline void chmax(T& a, T b){
    if (a < b){
        a = b;
    }
}

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout<<fixed<<setprecision(10);
    int N = in();
    vector<ll> eve(N+1/2+1);
    vector<ll> odd(N/2+1);//累積
    vector<ll> eves(N+1/2);
    vector<ll> odds(N/2);
    REP(i,N){
        if(i %2 == 0){
            int tmp = in();
            eve[i/2+1] = eve[i/2]+tmp;
            eves[i/2] = tmp;
        }else{
            int tmp = in();
            odd[i/2+1] = odd[i/2]+tmp;
            odds[i/2] = tmp;
        }
    }
    if(N %2 == 0){
        ll answer = 0;
        REP(i,N/2){
            chmax(answer,odd[N/2]-odd[i]+eve[i]);
        }
        cout << answer << "\n";
    }else{
        ll max0 = 0;
        ll max1 = 0;
        ll max2 = 0;
        REP(i,N/2){
            ll max0b = max0;
            ll max1b = max1;
            ll max2b = max2;
            max0 = max0b+eves[i];
            max1 = max(max1b + odds[i],max0b + odds[i]);
            max2 = max({max0b + eves[i+1],max1b + eves[i+1],max2b + eves[i+1]});
        }
        cout << max({max0,max1,max2}) << "\n";
    }
}

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 <bits/stdc++.h>
using namespace std;

int main()
{
    int n;
    cin>>n;
    long long int a[n];
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
    }
    long long int p=n/2,max=0,sum=0,c=0;
    for(int i=0;i<n;i+=2)
    {
        sum+=a[i];
        c++;
        if(c==p)break;
    }
    if(sum>max)max=-1000000005;
    sum=0;
    for(int i=1;i<n;i+=2)
    {
        sum+=a[i];
        c++;
        if(c==p)break;
    }
    if(sum>max)max=sum;
    sum=0;
    if(n%2)
    {
        for(int i=2;i<n;i+=2)
        {
            sum+=a[i];
            c++;
            if(c==p)break;
        }
        if(sum>max)max=sum;
    }
    cout<<max;
}

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