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

#include <iostream>
#include <cmath>
using namespace std;

typedef long long ll;
int N,K;
ll A[100010] = {0},S[100010] = {0},T[100010] = {0};

int main(){
	cin >> N >> K;
	for(int i=1;i<=N;i++){
		cin >> A[i];
		S[i] = S[i-1] + A[i];
		T[i] = T[i-1] + max(0,A[i]);
	}
	ll ans = 0;
	for(int i=1;i<=N-K+1;i++){
		ans = max(ans,max(T[i-1] + S[i+K-1]-S[i-1] + T[N]-T[i+K-1],
			T[i-1] + T[N]-T[i+K-1]));
	}
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:36: error: no matching function for call to 'max(int, ll&)'
   14 |                 T[i] = T[i-1] + max(0,A[i]);
      |                                 ~~~^~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:14:36: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   14 |                 T[i] = T[i-1] + max(0,A[i]);
      |                                 ~~~^~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
Language: C++

#include<iostream>
#include<algorithm>
#include<string>
#define LL long long
int N, K;
LL ans;
LL a[100010];
bool D[100010];
int main() {
	std::cin >> N >> K;
	for (int i = 0; i < N; i++) {
		std::cin >> a[i];
	}
	for (int i = 0; i < N - K; i++) {
		if (a[i] > 0) {
			ans += a[i];
		}
	}
	LL add = 0;
	LL bdd = 0;
	for (int i = N - K; i < N; i++) {
		if (D[i])add += a[i];
		bdd += a[i];
	}
	ans += std::max(add, bdd, 0);
	std::cout << ans << std::endl;
}

Compiler output:
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare) [with _Tp = long long int; _Compare = int]':
a.cc:25:17:   required from here
   25 |         ans += std::max(add, bdd, 0);
      |                ~~~~~~~~^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:306:17: error: '__comp' cannot be used as a function
  306 |       if (__comp(__a, __b))
      |           ~~~~~~^~~~~~~~~~
Language: C++

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

#define fi first
#define se second
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define each(itr,v) for(auto itr:v)
#define pb(s) push_back(s)
#define mp(a,b) make_pair(a,b)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define maxch(x,y) x=max(x,y)
#define minch(x,y) x=min(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt(x) bitset<32>(x).count()

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
typedef pair<P, int> PPI;
typedef pair<ll, ll> PL;
typedef pair<P, ll> PPL;

#define INF INT_MAX/3

#define MAX_N 1000

ll n,k;
ll a[111111];
ll sum[111111];
ll psum[111111];

int main(){
  cin.sync_with_stdio(false);
  cin>>n>>k;
  rep(i,n)cin>>a[i];
  rep(i,n){
    sum[i+1]=sum[i]+a[i];
    psum[i+1]=psum[i]+max(0LL,a[i]);
  }
  ll res=0;
  rep(i,n-k+1){
    maxch(res,max(0LL,sum[i]+sum[n]-sum[i+k]);
  }
  cout<<res<<endl;
  return 0;
}


Compiler output:
a.cc:49:2: error: unterminated argument list invoking macro "maxch"
   49 | }
      |  ^
a.cc: In function 'int main()':
a.cc:45:5: error: 'maxch' was not declared in this scope
   45 |     maxch(res,max(0LL,sum[i]+sum[n]-sum[i+k]);
      |     ^~~~~
a.cc:45:10: error: expected '}' at end of input
   45 |     maxch(res,max(0LL,sum[i]+sum[n]-sum[i+k]);
      |          ^
a.cc:44:15: note: to match this '{'
   44 |   rep(i,n-k+1){
      |               ^
a.cc:45:10: error: expected '}' at end of input
   45 |     maxch(res,max(0LL,sum[i]+sum[n]-sum[i+k]);
      |          ^
a.cc:35:11: note: to match this '{'
   35 | int main(){
      |           ^
Language: C++

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

int main()
{
	int N, K;
	cin >> N >> K;
	vector<ll> a(N), sum(N + 1), good(N + 1);
	for (int i = 0; i < N; i++) {
		cin >> a[i];
		sum[i + 1] = sum[i] + a[i];
		good[i + 1] = good[i] + max(a[i], 0);
	}
	ll res = 0;
	for (int i = 0; i <= N - K; i++) {
		res = max(res, good[N] - good[i + K] + good[i] - good[0]);
		res = max(res, good[N] - good[i + K] + good[i] - good[0] + sum[i + K] - sum[i]);
	}
	cout << res << endl;
	return 0;
}


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

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stdio.h>
#include <string.h>
#include <math.h>
using namespace std;

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

    int n, k;
    cin >> n >> k;

    vector<int64_t> s(n + 1), t(n + 1);
    for (int i = 0; i < n; i++) {
        int a;
        cin >> a;
        s[i + 1] = s[i] + a;
        t[i + 1] = t[i] + (a < 0 ? 0 : a);
    }

    int64_t r = 0;
    for (int i = 0; i <= n - k; i++) {
        int64_t u = max(s[i + k] - s[i], 0LL);
        u += t[i] - t[0];
        u += t[n] - t[i + k];
        r = max(r, u);
    }

    cout << r << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:24: error: no matching function for call to 'max(__gnu_cxx::__alloc_traits<std::allocator<long int>, long int>::value_type, long long int)'
   27 |         int64_t u = max(s[i + k] - s[i], 0LL);
      |                     ~~~^~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:27:24: note:   deduced conflicting types for parameter 'const _Tp' ('long int' and 'long long int')
   27 |         int64_t u = max(s[i + k] - s[i], 0LL);
      |                     ~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:4:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:27:24: note:   mismatched types 'std::initializer_list<_Tp>' and 'long int'
   27 |         int64_t u = max(s[i + k] - s[i], 0LL);
      |                     ~~~^~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
int main(){
	int n,k;
	scanf("%d%d",&n,&k);
	if(n<k){
		printf("0");
		return 0;
	}
	lli qsp[n+1],qsn[n+1],a;
	for(int i=1;i<=n;++i){
		scanf("%lld",&a);
		qsp[i]=qsp[i-1];
		qsn[i]=qsn[i-1];
		if(a>0)
			qsp[i]+=a;
		else
			qsn[i]+=a;
	}
	lli min=qsp[k],max=qsp[k]+qsn[k],maxidx=k;
	for(int i=k;i<=n;++i){
		if(qsp[i]-qsp[i-k]<min)
			min=qsp[i]-qsp[i-k];
		if(max<qsp[i]-qsp[i-k]+qsn[i]-qsn[i-k]){
			max=qsp[i]-qsp[i-k]+qsn[i]-qsn[i-k];
			maxidx=i;
		}
	}
	if(max<0)
		printf("%lld",qs[n]-min);
	else
		printf("%lld",qs[n]+qsn[maxidx]-qsn[maxidx-k]);

}
/*

10 5
5 -4 -5 -8 -4 7 2 -4 0 7

*/

Compiler output:
a.cc: In function 'int main()':
a.cc:31:31: error: 'qs' was not declared in this scope; did you mean 'qsn'?
   31 |                 printf("%lld",qs[n]-min);
      |                               ^~
      |                               qsn
a.cc:33:31: error: 'qs' was not declared in this scope; did you mean 'qsn'?
   33 |                 printf("%lld",qs[n]+qsn[maxidx]-qsn[maxidx-k]);
      |                               ^~
      |                               qsn
Language: C++

#include<bits/stdc++.h>

using namespace std;

long long qsum[100010];

long long best[100010];

int main()  {
    int n,k;
    long long a;
    cin >> n >> k;
    for ( int c=1 ; c<=n ; c++ )
    {
        cin >> a;
        qsum[c] = qsum[c-1] + a;
        if ( a > 0 )    best[c] = best[c-1] + a;
        else    best[c] = best[c-1];
    }
    long long ans = 0;
    for ( int i=1 ; i<=n-k+1 ; i++)
    {
        long long other = best[i-1] + best[n] - best[i+k-1];
        //cout << other << endl;
        if ( qsum[i+k-1] - qsum[i-1] > 0 )  other += qsum[i+k-1] - qsum[i-1];
        ans = max ( ans , other);
    }
    cout << ans;
}
#include<bits/stdc++.h>

using namespace std;

long long qsum[100010];

long long best[100010];

int main()  {
    int n,k;
    long long a;
    cin >> n >> k;
    for ( int c=1 ; c<=n ; c++ )
    {
        cin >> a;
        qsum[c] = qsum[c-1] + a;
        if ( a > 0 )    best[c] = best[c-1] + a;
        else    best[c] = best[c-1];
    }
    long long ans = 0;
    for ( int i=1 ; i<=n-k+1 ; i++)
    {
        long long other = best[i-1] + best[n] - best[i+k-1];
        //cout << other << endl;
        if ( qsum[i+k-1] - qsum[i-1] > 0 )  other += qsum[i+k-1] - qsum[i-1];
        ans = max ( ans , other);
    }
    cout << ans;
}


Compiler output:
a.cc:34:11: error: redefinition of 'long long int qsum [100010]'
   34 | long long qsum[100010];
      |           ^~~~
a.cc:5:11: note: 'long long int qsum [100010]' previously declared here
    5 | long long qsum[100010];
      |           ^~~~
a.cc:36:11: error: redefinition of 'long long int best [100010]'
   36 | long long best[100010];
      |           ^~~~
a.cc:7:11: note: 'long long int best [100010]' previously declared here
    7 | long long best[100010];
      |           ^~~~
a.cc:38:5: error: redefinition of 'int main()'
   38 | int main()  {
      |     ^~~~
a.cc:9:5: note: 'int main()' previously defined here
    9 | int main()  {
      |     ^~~~
Language: C++

#include <iostream>
#include <cstring>
#include <algorithm>

#define MAX_N  100000

using namespace std;

#define debug(x) cout << #x << "==" << x << endl;
//入力
int K;
int N;
int a[MAX_N + 1];

typedef long long ll;


int main() {

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


  ll cumsum[MAX_N + 1];
  ll cumsum_pos[MAX_N + 1];
  cumsum[0] = 0;
  cumsum_pos[0] = 0;
  for(int i = 1; i < N+1; i++) {
    cumsum[i] = cumsum[i-1] + a[i-1];
    cumsum_pos[i] = cumsum_pos[i-1] + max(0, a[i-1]);
  }

  ll mx = 0;
  for(int i = 0; i < N - K + 1; i++) {

    ll all_black = cumsum[i+K] - cumsum[i];
    ll all_white = 0;

    ll other = cumsum_pos[i] +  (cumsum_pos[N] - cumsum_pos[i+K]) ;

    mx = max(mx, other + max(black, white));

  }

  cout << mx << endl;

  return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:43:30: error: 'black' was not declared in this scope
   43 |     mx = max(mx, other + max(black, white));
      |                              ^~~~~
a.cc:43:37: error: 'white' was not declared in this scope; did you mean 'fwrite'?
   43 |     mx = max(mx, other + max(black, white));
      |                                     ^~~~~
      |                                     fwrite
Language: C++

#include <iostream>
#include <cstring>
#include <algorithm>

#define MAX_N  100000

using namespace std;

#define debug(x) cout << #x << "==" << x << endl;
//入力
int K;
int N;
int a[MAX_N + 1];

typedef long long ll;


int main() {

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


  ll cumsum[MAX_N + 1];
  ll cumsum_pos[MAX_N + 1];
  cumsum[0] = 0;
  cumsum_pos[0] = 0;
  for(int i = 1; i <= N; i++) {
    cumsum[i] = cumsum[i-1] + a[i-1];
    cumsum_pos[i] = cumsum_pos[i-1] + max(0, a[i-1]);
  }

  ll mx = 0;
  for(int i = 0; i <= N - K; i++) {

    ll black = cumsum[i+K] - cumsum[i];
    ll white = 0;

    ll other = (cumsum_pos[N-k] - cumsum_pos[i+K-1]) + cumsum_pos[i-1];

    mx = max(mx, other + max(black, white));

  }

  cout << mx << endl;

  return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:30: error: 'k' was not declared in this scope
   41 |     ll other = (cumsum_pos[N-k] - cumsum_pos[i+K-1]) + cumsum_pos[i-1];
      |                              ^
Language: C++

#include<cstdio>
#include<algorithm>
using std::max;
const int N=1e5+3;
int i,n,k,a[N];
long long x,r,l[N],s[N];
int main()
{
	scanf("%d%d",&n,&k);
	for(i=1;i<=n;++i)
	{
		scanf("%d",a+i);
		s[i]=s[i-1]+a[i];
		l[i]=l[i-1]+max(0,a[i]);
	}
	for(i=n;i>=k;x+=max(0,a[i--]))
		r=max(r,x+l[i-k]+max(0ll,s[i]-s[i-k]));
	for(i=0;i<20000;++i)for(j=0;j<i;++j);
	printf("%lld",r);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:33: error: 'j' was not declared in this scope
   18 |         for(i=0;i<20000;++i)for(j=0;j<i;++j);
      |                                 ^
Language: C++

#include<cstdio>
#include<algorithm>
using std::max;
const int N=1e5+3;
int i,n,k,a[N];
long long x,r,l[N],s[N];
int main()
{
	scanf("%d%d",&n,&k);
	for(i=1;i<=n;++i)
	{
		scanf("%d",a+i);
		s[i]=s[i-1]+a[i];
		l[i]=l[i-1]+max(0,a[i]);
	}
	for(i=n;i>=k;x+=max(0,a[i--]))
		r=max(r,x+l[i-k]+max(0,s[i]-s[i-k]));
	printf("%d",r);
}

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

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lim 10000007
#define mod 1000000007
#define mp make_pair
#define sd(n) scanf("%lld",&n)
#define pb push_back
#define FIO() freopen("in.txt","r",stdin)
#define F first
#define S second
#define db double
#define INF 1e12
#define pd(n) printf("%lld\n",n)
#define pdd(n) printf("%.20lf\n",n)
#define pii pair<ll,ll>

int main()
{
    //FIO();
   ll n,k;
   ll ans=0;
   cin>>n>>k;
   ll sum=0;
   while(n--)
   {
    cin>>x;
    sum+=max(0LL,x);
   }
   cout<<sum<<endl;

    

    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:10: error: 'x' was not declared in this scope
   27 |     cin>>x;
      |          ^
Language: C++

#include <iostream>
#include <vector>
using namespace std;

typedef long long int ll;

int main(void){
    // Here your code !
    int n,k;
    cin >> n >> k;
    
    vector<ll> a(n+10);
    vector<ll> rui(n+10);
    vector<ll> rui2(n+10);
    
    for(int i = 1; i <= n; i++){
        cin >> a[i];
        rui[i] = rui[i-1] + a[i];
        if(a[i] > 0)
        rui2[i] = rui2[i-1] + a[i];
        else
        rui2[i] = rui2[i-1];
    }
    
    
    ll res = 0;
    
    for(int i = k; i <= n; i++){
        int tmp = rui[i] - rui[i-k];
        
        if(tmp < 0) tmp = 0;
        
        tmp += rui2[i-k] + rui2[n] - rui2[i];
        
        res = max(tmp,res);
        
    }
    
    cout << res << endl;
    
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:18: error: no matching function for call to 'max(int&, ll&)'
   35 |         res = max(tmp,res);
      |               ~~~^~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:35:18: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   35 |         res = max(tmp,res);
      |               ~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
Language: C++

#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <queue>
#include <algorithm>
#include <utility>
#include <cmath>

#define INF_LL 9000000000000000000
#define INF 2000000000

#define REP(i, n) for(int i = 0;i < (n);i++)
#define FOR(i, a, b) for(int i = (a);i < (b);i++)

using namespace std;

typedef long long ll;
typedef pair<int, int> PII;

class Union_find{
private:
	vector<int> par;
	vector<int> rank;
	int n;

public:
	Union_find(int a){
		n = a;
		for(int i = 0;i < n;i++){
			par.push_back(i);
			rank.push_back(0);
		}
	}

	int find(int x){
		if(par[x] == x){
			return x;
		}else{
			return par[x] = find(par[x]);
		}
	}

	void unite(int x, int y){
		x = find(x);
		y = find(y);
		if(x == y) return;

		if(rank[x] < rank[y]){
			par[x] = y;
		}else{
			par[y] = x;
			if(rank[x] == rank[y]) rank[x]++;
		}
	}

	bool same(int x, int y){
		return find(x) == find(y);
	}
};

int main(void){
	int n, k;
	int a[100000];
	int sum_k[100000];
	int res = 0;
	cin >> n >> k;

	memset(sum_k, 0, sizeof(sum_k));
	REP(i, n){
		cin >> a[i];
		for(int j = max(0, i-k+1);j <= i;j++){
			sum_k[j] += a[i];
		}
	}

	REP(i, n-k+1){
		int tmp = max(0, sum_k[i]);
		REP(j, i){
			if(a[j] > 0) tmp+= a[j];
		}
		for(int j = i+k;j < n;j++){
			if(a[j] > 0) tmp += a[j];
		}
		res = max(res, tmp);
	}
	cout << res << endl;
}


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

#include <iostream>
#include <vector>
#include <numeric>
#include <limits>
#define int long long

signed main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(nullptr);
  int n, k;
  std::cin >> n >> k;
  std::vector<int> pts(n), positive(n);
  for (int i = 0; i < n; i++) {
    std::cin >> pts[i];
    positive[i] = std::max(0ll, pts[i]);
  }
  std::vector<int> accum = {0}, pos_accum = {0};
  std::partial_sum(std::begin(pts), std::end(pts), std::back_inserter(accum));
  std::partial_sum(std::begin(positive), std::end(positive), std::back_inserter(pos_accum));
  int result = std::numeric_limits<int>::min() / 2;
  for (int i = 0; i < n - k + 1; i++) {
    int range_sum = accum[i + k] - accum[i],
        other_sum = pos_accum[n] - pos_accum[i + k] + pos_accum[i];
    result = std::max({result, range_sum + other_sum, other_sum});
  }
  std::cout << result << std::endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:22: error: no matching function for call to 'max(<brace-enclosed initializer list>)'
   24 |     result = std::max({result, range_sum + other_sum, other_sum});
      |              ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 1 provided
Language: C++

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

int main(){
	int n,k;
	long long int a[100000];
	cin >> n >> k;
	for(int i = 0;i < n;i++) cin >> a[i];
	sort(a,a + n,greater<long long int>());
	long long int res = 0;
	for(int i = 0;i < n;i++){
		if(a[i] >= 0) res += a[i];
		else{
			if(k % 2 == 1) res += a[i];
			break;
		}
	}
	cout << max(0,res) << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:20: error: no matching function for call to 'max(int, long long int&)'
   19 |         cout << max(0,res) << endl;
      |                 ~~~^~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:19:20: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   19 |         cout << max(0,res) << endl;
      |                 ~~~^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:19:20: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   19 |         cout << max(0,res) << endl;
      |                 ~~~^~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int N = 2e5+7;
int ans[N];

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

    long long I, O, J, L, temp;
    cin>>I>>O>>temp>>J>>L>>temp>>temp;

    long long ans = O + (I/2)*2 + (J/2)*2 + (L/2)*2;
    if (I && J && L) {
        I--, J--, L--;
        ans = min( O + (I/2)*2 + (J/2)*2 + (L/2)*2 + 3);
    }
    cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:18: error: no matching function for call to 'min(long long int)'
   16 |         ans = min( O + (I/2)*2 + (J/2)*2 + (L/2)*2 + 3);
      |               ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   template argument deduction/substitution failed:
a.cc:16:18: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   16 |         ans = min( O + (I/2)*2 + (J/2)*2 + (L/2)*2 + 3);
      |               ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   candidate expects 2 arguments, 1 provided
Language: C

#include <bits/stdc++.h>

using namespace std;

int ai, ao, at, al, aj, as, az, k;

int main() {
    cin >> ai >> ao >> at >> al >> aj >> as >> az;

    k += ao;

    k += ai - ai % 2;
    ai = ai % 2;

    k += min(min(al, aj), ai) * 3;

    int minn = min(min(al, aj), ai);
    al -= minn;
    aj -= minn;
    ai -= minn;

    k += aj / 2 * 2;

    k += al / 2 * 2;

    cout << k;
    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>

using namespace std;

int ai, ao, at, al, aj, as, az, k;

int main() {
    cin >> ai >> ao >> at >> al >> aj >> as >> az;

    k += ao;

    k += ai - ai % 2;
    ai = ai % 2;

    k += min(min(al, aj), ai) * 3;

    int minn = min(min(al, aj), ai);
    al -= minn;
    aj -= minn;
    ai -= minn;

    k += aj / 2 * 2;

    k += al / 2 * 2;

    cout << k;
    return 0;
}


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

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

#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807LL
#define I64_MAX2 1223372036854775807LL
#define INF I64_MAX2
#define MOD 1000000007
// #define MOD 998244353 
#define MEM_SIZE 101010
#define DEBUG_OUT true
#define ALL(x) (x).begin(), (x).end()


template<typename T> void DEBUG(T e){if(DEBUG_OUT == false)return; std::cout << e <<" ";}
template<typename T> void DEBUG(const std::vector<T>& v){if(DEBUG_OUT == false)return;for(const auto& e : v){std::cout<< e << " "; } std::cout << std::endl;}
template<typename T> void DEBUG(const std::vector<std::vector<T> >& vv){if(DEBUG_OUT == false)return;for(const auto& v : vv){ DEBUG(v); } }
template<class T,class... Ts> void DEBUG(T d, Ts... e){if(DEBUG_OUT == false)return;DEBUG(d);DEBUG(e...);}
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; abort();}}
template< typename T1, typename T2 > inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template< typename T1, typename T2 > inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }

void solve(void)
{
  int n = 7;
  vector<int> vec (n,0);
  for (int i = 0; i < n; i++)
  {
     cin>>vec[i];
  }
  int res1 = 0;
  res1 += vec[0]/2*2;
  res1 += vec[1];
  res1 += vec[3]/2*2;
  res1 += vec[4]/2*2;
  int res = 0;
  if(vec[0] >= 1 and vec[3] >= 1 and vec[4] >= 1)
  {
    res += 3;
    vec[0] --;
    vec[3] --;
    vec[4] --;
  }
  res += vec[0]/2*2:
  res += vec[1];
  res += vec[3]/2*2;
  res += vec[4]/2*2;

  // res += min(vec[2],min(vec[5],vec[6]))*
  cout<<max(res1,res)<<endl;
  return;
}

int32_t main(int32_t argc, const char *argv[])
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  std::cout << std::fixed;
  std::cout << std::setprecision(11);
  solve();

  return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:46:20: error: expected ';' before ':' token
   46 |   res += vec[0]/2*2:
      |                    ^
      |                    ;
Language: C++

v#include <bits/stdc++.h>
using namespace std;
int main(){
  long long I, O, T, J, L, S, Z;
  cin >> I >> O >> T >> J >> L >> S >> Z;
  long long ans = I / 2 * 2 + O + J / 2 * 2 + L / 2 * 2;
  if (I % 2 == 1 (J >= 2 || L >= 2)){
    ans++;
  }
  cout << ans << endl;
}

Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | v#include <bits/stdc++.h>
      |  ^
a.cc:1:1: error: 'v' does not name a type
    1 | v#include <bits/stdc++.h>
      | ^
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin >> I >> O >> T >> J >> L >> S >> Z;
      |   ^~~
a.cc:7:18: error: expression cannot be used as a function
    7 |   if (I % 2 == 1 (J >= 2 || L >= 2)){
      |                ~~^~~~~~~~~~~~~~~~~~
a.cc:10:3: error: 'cout' was not declared in this scope
   10 |   cout << ans << endl;
      |   ^~~~
a.cc:10:18: error: 'endl' was not declared in this scope
   10 |   cout << ans << endl;
      |                  ^~~~
Language: C++

#include<cmath>
#include<stdio.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<utility>
#include<map>
#include<set>
#include<queue>
#include<functional>
#define INF 1e16
#define N (1000000007)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<ll,P> Q;


ll a[7];
int main(void){
    for(int i=0;i<7;i++)cin>>a[i];
    ll ans=0
    ll k = min(a[0],min(a[3],a[4]));
    ll cnt=0;
    if(a[0]%2==1)cnt++;
    if(a[3]%2==1)cnt++;
    if(a[4]%2==1)cnt++;
    if(k%2==0){
      ans+=3*k;
      ans+=((a[0]-k)/2)*2;
      ans+=a[1];
      ans+=((a[3]-k)/2)*2;
      ans+=((a[4]-k)/2)*2;
      cout<<ans<<endl;
    }
    else{
      if(cnt==3)ans+=a[0]+a[3]+a[4];
      if(cnt==2)ans+=a[0]+a[3]+a[4]-1;
      if(cnt==1)ans+=a[0]+a[3]+a[4]-1;
      cout<<ans<<endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:5: error: expected ',' or ';' before 'll'
   23 |     ll k = min(a[0],min(a[3],a[4]));
      |     ^~
a.cc:28:8: error: 'k' was not declared in this scope
   28 |     if(k%2==0){
      |        ^
Language: C++

#include<cmath>
#include<stdio.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<utility>
#include<map>
#include<set>
#include<queue>
#include<functional>
#define INF 1e16
#define N (1000000007)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<ll,P> Q;


ll a[7];
int main(void){
    for(int i=0;i<7;i++)cin>>a[i];
    ll ans=0
    ll k = min(a[0],min(a[3],a[4]));
    ll cnt=0;
    if(a[0]%2==1)cnt++;
    if(a[1]%2==1)cnt++;
    if(a[2]%2==1)cnt++;
    if(k%2==0){
      ans+=3*k;
      ans+=((a[0]-k)/2)*2;
      ans+=a[1];
      ans+=((a[3]-k)/2)*2;
      ans+=((a[4]-k)/2)*2;
      cout<<ans<<endl;
    }
    else{
      if(cnt==3)ans+=a[0]+a[3]+a[4];
      if(cnt==2)ans+=a[0]+a[3]+a[4]-1;
      if(cnt==1)ans+=a[0]+a[3]+a[4]-1;
      cout<<ans<<endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:5: error: expected ',' or ';' before 'll'
   23 |     ll k = min(a[0],min(a[3],a[4]));
      |     ^~
a.cc:28:8: error: 'k' was not declared in this scope
   28 |     if(k%2==0){
      |        ^
Language: C++

#include<cmath>
#include<stdio.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<utility>
#include<map>
#include<set>
#include<queue>
#include<functional>
#define INF 1e16
#define N (1000000007)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<ll,P> Q;


ll a[7];
int main(void){
    for(int i=0;i<7;i++)cin>>a[i];
    ll ans=0
    ll k = min(a[0],min(a[3],a[4]));
    ans+=3*k;
    ans+=((a[0]-k)/2)*2;
    ans+=a[1];
    ans+=((a[3]-k)/2)*2;
    ans+=((a[4]-k)/2)*2;
    cout<<ans<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:5: error: expected ',' or ';' before 'll'
   23 |     ll k = min(a[0],min(a[3],a[4]));
      |     ^~
a.cc:24:12: error: 'k' was not declared in this scope
   24 |     ans+=3*k;
      |            ^
Language: C++

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

long long a, b, c, d, e, f, g;

int main() {
  cin >> a >> b >> c >> d >> e >> f;
  long long res = b;
  for (int i = 0; i <= min({a, d, e, 4}); ++i)
    res = max(res, 3 * i + 2 * ((a - i) / 2 + (d - i) / 2 + (e - i) / 2) + b);
  cout << res << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:27: error: no matching function for call to 'min(<brace-enclosed initializer list>)'
    9 |   for (int i = 0; i <= min({a, d, e, 4}); ++i)
      |                        ~~~^~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   template argument deduction/substitution failed:
a.cc:9:27: note:   deduced conflicting types for parameter '_Tp' ('long long int' and 'int')
    9 |   for (int i = 0; i <= min({a, d, e, 4}); ++i)
      |                        ~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   candidate expects 2 arguments, 1 provided
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define int long long
//0oooo0
//000000
signed main() {
    int I,O,T,J,L,S,Z;
    cin >> I >> O >> T >> J >> L >> S >> Z;
    int ans = I/2*4+O*2+J/2*4+L/2*4)/2;
    int cnt = I%2+J%2+L%2;
    if(cnt == 3) {
        ans+=6;
    }
    if(cnt == 2) {
        ans+=2;
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:36: error: expected ',' or ';' before ')' token
    9 |     int ans = I/2*4+O*2+J/2*4+L/2*4)/2;
      |                                    ^
Language: C++

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

int i, o, t, j, l, s, z;
long long ans;

int main() {
	cin >> i >> o >> t >> j >> l >> s >> z;
	ans = o;
	ans += i / 2 * 2;
	ans += j / 2 * 2;
	ans += l / 2 * 2;
	ans += max(((i & 1) + (j & 1) + (l & 1)) * 2 - 3, 0)
	cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:61: error: expected ';' before 'cout'
   13 |         ans += max(((i & 1) + (j & 1) + (l & 1)) * 2 - 3, 0)
      |                                                             ^
      |                                                             ;
   14 |         cout << ans << endl;
      |         ~~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <iomanip>
#include <utility>
#include <tuple>
#include <functional>
#include <bitset>
#include <cassert>
#include <complex>
#include <time.h>
#define ll long long
#define double long double
#define itn int
#define endl '\n'
#define co(ans) cout<<ans<<endl
#define COYE cout<<"YES"<<endl
#define COYe cout<<"Yes"<<endl
#define COye cout<<"yes"<<endl
#define CONO cout<<"NO"<<endl
#define CONo cout<<"No"<<endl
#define COno cout<<"no"<<endl
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n)  FFOR(i,1,n)
#define ALL(V) (V).begin(),(V).end()
#define SORT(V) sort((V).begin(),(V).end())
#define REVERSE(V) reverse((V).begin(),(V).end())
#define INF ((1LL<<62)-(1LL<<31))
#define EPS 1e-10
#define PI 3.141592653589793238
#define MOD 1000000007
#define MAX 5100000
template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return 1;}return 0;}
template<class T>bool chmin(T &a,const T &b){if(b<a){a=b;return 1;}return 0;}
const int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
bool CAN=true;
using namespace std;

int main(){
  ll A[7],ans=0LL,cnt=0LL;
  REP(i,7) cin>>A[i];
  
  ans+=A[1];
  ans+=A[0]-A[0]%2;
  ans+=A[3]-B[3]%2;
  ans+=A[4]-B[4]%2;
  
  if(A[0]*A[3]*A[4]>0){
    cnt+=A[1];
    cnt+=(A[0]-1)-(A[0]-1)%2;
    cnt+=(A[3]-1)-(A[3]-1)%2;
    cnt+=(A[4]-1)-(A[4]-1)%2;
    cnt+=3LL;
  }
  
  cout<<chmax(ans,cnt)<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:55:13: error: 'B' was not declared in this scope
   55 |   ans+=A[3]-B[3]%2;
      |             ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <fstream>
#include <set>
#include <cmath>
#include <array>
#include <iomanip>
#include <cassert>

using namespace std;

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

    int64_t answer = 0;

    int64_t a_i;
    cin >> a_i;


    int64_t a_o;
    cin >> a_o;

    int x;
    cin >> x;

    int64_t y_1, y_2;
    cin >> y_1;
    cin >> y_2;


    answer += a_o * 2;

    auto try_this = [=](int sub) {
        int64_t mag = min({a_i, y_1, y_2}) - sub;

        if (mag < 0) {
            return 0LL;
        }

        return 6 * mag + ((a_i - mag) / 2) * 4 + ((y_1 - mag) / 2) * 4 + ((y_2 - mag) / 2) * 4;
    };
    cout << (answer + std::max(try_this(0), try_this(1))) / 2;
}


Compiler output:
a.cc: In lambda function:
a.cc:45:72: error: inconsistent types 'long long int' and 'long int' deduced for lambda return type
   45 |         return 6 * mag + ((a_i - mag) / 2) * 4 + ((y_1 - mag) / 2) * 4 + ((y_2 - mag) / 2) * 4;
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,x,y) for(int i=x;i<y;i++)
#define print(A,x,n) rep(I,0,n){cout<<(I ? " ":"")<<A[I]x;}cout<<endl;
#define pprint(A,y,m,n) rep(J,0,m){print(A[J],y,n);}
const long mod=1e9+7;
const int size=1e5;
const int inf=1e9;
int main(){
	long A[7];
	rep(i,0,7) cin>>A[i];
	long a = A[0]/2*2 + A[1] + A[3]/2*2 + A[4]/2*2
	long b = (A[0]-1)/2*2 + A[1] + (A[3]-1)/2*2 + (A[4]-1)/2*2 + 4
	if(A[0] == 0 || A[3] == 0 || A[4] == 0) b = A[1];
	cout<<max(a, b)<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: expected ',' or ';' before 'long'
   13 |         long b = (A[0]-1)/2*2 + A[1] + (A[3]-1)/2*2 + (A[4]-1)/2*2 + 4
      |         ^~~~
a.cc:15:22: error: 'b' was not declared in this scope
   15 |         cout<<max(a, b)<<endl;
      |                      ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
long long ai, ao, at, aj, al, as, az;
int main(int argc, char const *argv[]) {
    cin >> ai >> ao >> at >> aj >> al >> as >> az;
    long long ans = ao;
    if(!ai||!aj||!al){
        long long ans += ai/2*2+aj/2*2+al/2*2;
    }
    else{
        ans += ai + aj + al;
        if(ai%2==aj%2&&aj%2==al%2);else ans--;
    }
    cout << ans;
    return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:8:23: error: expected initializer before '+=' token
    8 |         long long ans += ai/2*2+aj/2*2+al/2*2;
      |                       ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int ans;
  int I,O,T,J,L,S,Z;
  cin >> I >> O >> T >> J >> L >> S >> Z;
  if(!((T!=0)||(S!=0)||(Z!=0)||(I%2==1)||(J%2==1)||(L%2==1)))
    ans += O + I + J + L;
  }
  cout << ans << endl;

}


Compiler output:
a.cc:10:3: error: 'cout' does not name a type
   10 |   cout << ans << endl;
      |   ^~~~
a.cc:12:1: error: expected declaration before '}' token
   12 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int I,O,T,J,L,S,Z;
  cin >> I >> O >> T >> J >> L >> S >> Z;
  if((T!=0)||(S!=0)||(Z!=0)||(I%2==1)||(J%2==1)||(L%2==1))
    const int ans = 0;
  else{
    int ans = 0;
    ans += O + I + J + L;
  }
  cout << ans << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   12 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int I,O,T,J,L,S,Z;
  cin >> I >> O >> T >> J >> L >> S >> Z;
  if((T!=0)||(S!=0)||(Z!=0)||(I%2==1)||(J%2==1)||(L%2==1))
    const int ans = 0;
  else{
    int ans = 0;
    ans += O + I + J + L;
  }
  cout << and << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:15: error: expected identifier before '<<' token
   12 |   cout << and << endl;
      |               ^~
Language: C

#include <bits/stdc++.h>
using namespace std;
int main(){
  int I,O,T,J,L,S,Z;
  cin >> I >> O >> T >> J >> L >> S >> Z;
  if((T!=0)||(S!=0)||(Z!=0)||(I%2==1)||(J%2==1)||(L%2==1))
    const int ans = 0;
  else{
    int ans = 0;
    ans += O + I + J + L;
  }
  cout << and << endl;

}

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