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

#include <iostream>
using namespace std;
int main(void)
{
  int n,l;
  cin >> n >> l;
  
  int l2 = l;
  int ans = 0;
  for(int i=0;i<n;i++){
    l2++;
    ans += l2;
  }
  
  if(l=>0)
    ans -= l;
  
  else if(l2 => 0)
    ans;
  
  else if(l2 < 0)
    ans -= l2;
  
  cout << ans << endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:8: error: expected primary-expression before '>' token
   15 |   if(l=>0)
      |        ^
a.cc:18:15: error: expected primary-expression before '>' token
   18 |   else if(l2 => 0)
      |               ^
Language: C++

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

using namespace std;
const int maxn=200000+5;

int n,l,j,o,k;
long long sum;
long long sum1[maxn];
bool ok[maxn];
bool op;

int main (){
	scanf ("%d%d",&n,&l);
	for (int i=l;i<=l+n-1;i++){
		sum+=i;
		sum1[o]+=i;
		o++;
	}
	for (int i=0;i<o;i++){
		if (sum1[i]==0){
			op=true;
			break;
		}
	}
	if (op==true) printf("%lld",sum);
	else
	printf("%lld",sum-sum1[o-1]<<endl);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:36: error: invalid operands of types 'long long int' and '<unresolved overloaded function type>' to binary 'operator<<'
   29 |         printf("%lld",sum-sum1[o-1]<<endl);
      |                       ~~~~~~~~~~~~~^~~~~~
Language: C++

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

using namespace std;

int N,L,ans=0;
int a[210]={0};

int main()
{
	cin>>N>>L;
	for(int i=1;i<=N;i++)
		a[i]=L+i-1;
	sort(a+N,a+N+1,cmp);
	for(int i=2;i<=N;i++)
		ans+=a[i];
	cout<<ans<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:24: error: 'cmp' was not declared in this scope
   16 |         sort(a+N,a+N+1,cmp);
      |                        ^~~
Language: Java

import java.util.*;
class Main {
  Scanner sc = new Scanner(System.in);
  int n = Integer.parseInt(sc.next());
  int l = Integer.parseInt(sc.next());
  
  public static int appleToEat(int n, int l){
    int sum = 0;
    if (l > n) {
      for (int i = 1; i < n; i++) {
        sum += (l + i);
      }
      return sum;
    } else if (l*-1 > n) {
      for (int i = 0; i < n-1; i++) {
        sum += (l + i);
      }
      return sum;
    } else {
      for (int i = 0; i < n; i++) {
        sum += (l + i);
      }
      return sum;
    }
  }
  
  public static void main(String args[]) {
    int result = appleToEat(n, l);
    System.out.println(result);
    
  }
  
}

Compiler output:
Main.java:28: error: non-static variable n cannot be referenced from a static context
    int result = appleToEat(n, l);
                            ^
Main.java:28: error: non-static variable l cannot be referenced from a static context
    int result = appleToEat(n, l);
                               ^
2 errors
Language: Java

import java.util.*;
class Main {
  Scanner sc = new Scanner(System.in);
  int n = Integer.parseInt(sc.next());
  int l = Integer.parseInt(sc.next());
  
  public static int appleToEat(int n, int l){
    int sum = 0;
    if (l > n) {
      for (int i = 1; i < n; i++) {
        sum += (l + i);
      }
      return sum;
    } else if (l*-1 > n) {
      for (int i = 0; i < n-1; i++) {
        sum += (l + i);
      }
      return sum;
    } else {
      for (int i = 0; i < n; i++) {
        sum += (l + i);
      }
      return sum;
    }
  
  public static void main(String args[]) {
    int result = appleToEat(n, l);
    System.out.println(result);
    
  }
  
}

Compiler output:
Main.java:26: error: illegal start of expression
  public static void main(String args[]) {
  ^
1 error
Language: Java

import java.util.*;
class Main {
  Scanner sc = new Scanner(System.in);
  int n = Integer.parseInt(sc.next());
  int l = Integer.parseInt(sc.next());
  
  public static int appleToEat(int n, int l){
    int sum = 0;
    if (l > n) {
      for (int i = 1; i < n; i++) {
        sum += (l + i);
      }
      return sum;
    } else if (l*-1 > n) {
      for (int i = 0; i < n-1; i++) {
        sum += (l + i);
      }
      return sum;
    } else {
      for (int i = 0; i < n; i++) {
        sum += (l + i);
      }
      return sum;
    }
  
  public static void main(String args[]) {
    
  }
  
}

Compiler output:
Main.java:26: error: illegal start of expression
  public static void main(String args[]) {
  ^
1 error
Language: C++

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

int main() {
	int N, L;
	cin >> N >> L;
	vector<int>p(1000);
	int sum = 0;

	for (int i = 0; i < N; i++) {
		p.at(i) = L + i;
		sum += p.at(i);
	}
		int eat = p.at(0)
	
	int ans = 0;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'vector' was not declared in this scope
    8 |         vector<int>p(1000);
      |         ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    2 | #include<algorithm>
  +++ |+#include <vector>
    3 | using namespace std;
a.cc:8:16: error: expected primary-expression before 'int'
    8 |         vector<int>p(1000);
      |                ^~~
a.cc:12:17: error: 'p' was not declared in this scope
   12 |                 p.at(i) = L + i;
      |                 ^
a.cc:15:27: error: 'p' was not declared in this scope
   15 |                 int eat = p.at(0)
      |                           ^
Language: C++

#include<iostream>
using namespace std;
int main(){
	int n,l,g,i,t=0;
	cin>>n>>l;
	g=l+n-1;
	for(i=0;i<n;i++)t+=l+i;
	if(l*g<=0){
		cout<<t;
	}else{
		if(l>0){
			cout<<t-l;
		}else{
			cout<<t-g;
		}
	}
}​

Compiler output:
a.cc:17:2: error: '\U0000200b' does not name a type
   17 | }​
      |
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
#define repf(i,a,b) for (int i = (a); i < (b); i++)
#define repi(i,a,b) for (int i = (a); i <= (b); i++)
#define repr(i,a,b) for (int i = (a); i >= (b); i--)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define debug(x)  cout << #x << " = " << (x) << endl;
#define SORT(x) sort(all(x));
#define RSORT(x) sort(rall(x));
using namespace std;
using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
using vvi = vector<vi>;
using vd = vector<double>;
using vb = vector<bool>;
using pii = pair<int, int>;
using vc = vector<char>;
using vvc = vector<vc>;
using vs = vector<string>;
using tiii = tuple<int, int, int>;
const ll inf = 1ll<<29;
const ll mod = 1000000007;
const double eps = 1e-9;
const int dx[4] = {1,0,-1,0};
const int dy[4] = {0,1,0,-1};

int main() {
  int N, L; cin >> N >> L;

  vi apple(N);
  rep(i,N) {
    apple.at(i) = L+i;
  }
  if(0<L) 
    eat = L;
  else if(0<L+N-1)
    eat = 0;
  else
    eat = L+N-1;
    
  int sum = accumulate(all(apple),0);
  cout << sum - eat << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:5: error: 'eat' was not declared in this scope
   37 |     eat = L;
      |     ^~~
a.cc:39:5: error: 'eat' was not declared in this scope
   39 |     eat = 0;
      |     ^~~
a.cc:41:5: error: 'eat' was not declared in this scope
   41 |     eat = L+N-1;
      |     ^~~
a.cc:44:17: error: 'eat' was not declared in this scope
   44 |   cout << sum - eat << endl;
      |                 ^~~
Language: C++

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

int main(){
    int n,l;
    cin>>n>>l;
    int s=n*l+n*(n-1)/2,min;
    if(l>0) min=s-l;
    else if(n+l<=0) min=-s+l+n-1
    else min=0;
    cout<<min<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:33: error: expected ';' before 'else'
    9 |     else if(n+l<=0) min=-s+l+n-1
      |                                 ^
      |                                 ;
   10 |     else min=0;
      |     ~~~~
Language: C++

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

int main(){
    int n,l;
    cin>>n>>l;
    int s,t,min=fabs(n*(n+l));
    for(int i=1;i<=n;i++){
        s=(n-2)*l+n(n+1)/2-2*i+2;
        if(min<fabs(s)){
            min=fabs(s);
            t=s+i-1;
        }
    }
    cout<<t<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:20: error: 'n' cannot be used as a function
    9 |         s=(n-2)*l+n(n+1)/2-2*i+2;
      |                   ~^~~~~
Language: Java

public class BiteEatting{
  public static void main(String[] args){
    int n = args[0];
    int l = args[1];
    int taste = 0;
    int souwa = n * l + {n * (n + 1) / 2} - n;
        for(int i = 1; i < n; i++){
            if(Math.abs(l + i - 1) < Math.abs(l + i)){
              min = l + i - 1;
            }
        }
    taste = souwa - min;
    System.out.print(taste);

Compiler output:
Main.java:6: error: illegal start of expression
    int souwa = n * l + {n * (n + 1) / 2} - n;
                        ^
Main.java:6: error: not a statement
    int souwa = n * l + {n * (n + 1) / 2} - n;
                                     ^
Main.java:6: error: ';' expected
    int souwa = n * l + {n * (n + 1) / 2} - n;
                                        ^
Main.java:6: error: not a statement
    int souwa = n * l + {n * (n + 1) / 2} - n;
                                          ^
Main.java:13: error: reached end of file while parsing
    System.out.print(taste);
                            ^
5 errors
Language: C++

def calc(n, l):
    list1 = []
    for i in range(1, n+1):
        list1.append(l + i - 1)
    if min(list1) > 0:
        return sum(list1) - list1[0]
    elif max(list1) < 0:
        return sum(list1) - list1[n-1]
    else:
        return sum(list1) - list1[list1.index(0)]

Compiler output:
a.cc:1:1: error: 'def' does not name a type
    1 | def calc(n, l):
      | ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,l;
  cin>>n>>l;
  int ans=0;
  if(l<=0){
    for(int i=l;i<n;i++){
      ans+=i;
    }
  }else{
    ans(int i=l+1;i<n;i++){
      ans+=i;
    }
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: expected primary-expression before 'int'
   12 |     ans(int i=l+1;i<n;i++){
      |         ^~~
a.cc:12:19: error: 'i' was not declared in this scope
   12 |     ans(int i=l+1;i<n;i++){
      |                   ^
Language: C++

#include<iostream>
using namespace std;

int main()
{
  int n, l;
  cin >> n >> l;
  int ans = INT_MAX;
  for (int i = 0; i < n; ++i)
    ans = min(ans, abs(l + (n * (n-1)) / 2 - i));
  cout << ans << '\n';
  return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: 'INT_MAX' was not declared in this scope
    8 |   int ans = INT_MAX;
      |             ^~~~~~~
a.cc:2:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    1 | #include<iostream>
  +++ |+#include <climits>
    2 | using namespace std;
Language: C++

#include<iostream>
#include <fstream>
#include <vector>
#include <map>
#include <cmath>
#include <algorithm>

#define LOCAL  1
#define UPLOAD 2

using namespace std;

int main()
{
#if ENVIRONMENT == LOCAL
    std::ifstream in("input.txt");
    std::cin.rdbuf(in.rdbuf());
#endif

    int N, L;
    cin >> N >> L;

    int min = INT_MAX;
    int sum = 0;
    int minAji = INT_MAX;
    for(int i=0;i<N;i++){
        int aji = L + i;
        if(abs(aji) < min){
            min = abs(aji);
            minAji = aji;
        }
        sum += aji;
    }
    cout << sum-minAji << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:15: error: 'INT_MAX' was not declared in this scope
   23 |     int min = INT_MAX;
      |               ^~~~~~~
a.cc:7:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    6 | #include <algorithm>
  +++ |+#include <climits>
    7 |
Language: C

#include<stdio.h>

int main(){
  int N,L;
  int apple,sum;
  scanf("%d %d", &N, &L);
  if(L >= 0){
    apple = L;
  } else if (L+N-1 >= 0){
    apple = 0;
  } else{
    apple = L+N-1;
  }
  
  for(int j=1; j<=N; j++){
   sum += L+i-1;
  }

  sum -= apple;
  printf("%d", sum);
  return 0;

}


Compiler output:
main.c: In function 'main':
main.c:16:13: error: 'i' undeclared (first use in this function)
   16 |    sum += L+i-1;
      |             ^
main.c:16:13: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

int main(){
  int N,L;
  int apple;
  scanf("%d %d", &N, &L);
  if(L >= 0){
    apple = L;
  } else if (L+N-1 >= 0){
    apple = 0;
  } else{
    apple = L+N-1;
  }
  
  for(int j=1; j<=N; j++){
  int sum += L+i-1;
  }

  sum -= apple;
  printf("%d", sum);
  return 0;

}


Compiler output:
main.c: In function 'main':
main.c:16:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '+=' token
   16 |   int sum += L+i-1;
      |           ^~
main.c:16:11: error: expected expression before '+=' token
main.c:19:3: error: 'sum' undeclared (first use in this function)
   19 |   sum -= apple;
      |   ^~~
main.c:19:3: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

int main(){
  int N,L;
  int apple;
  scanf("%d %d", &N, &L);
  if(L => 0){
    apple = L;
  } else if (L+N-1 >= 0){
    apple = 0;
  } else{
    apple = L+N-1;
  }
  
  for(int j=1; j<=N; j++){
  int sum += L+i-1;
  }

  sum -= apple;
  printf("%d", sum);
  return 0;

}

Compiler output:
main.c: In function 'main':
main.c:7:9: error: expected expression before '>' token
    7 |   if(L => 0){
      |         ^
main.c:16:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '+=' token
   16 |   int sum += L+i-1;
      |           ^~
main.c:16:11: error: expected expression before '+=' token
main.c:19:3: error: 'sum' undeclared (first use in this function)
   19 |   sum -= apple;
      |   ^~~
main.c:19:3: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <climits>
using namespace std;

int main(){
  	int N,L;cin>>N>>L;
  	int dif = INT_MAX;
  	int inde;
  	for(int i=1; i<N+1; i++){
    	int tmp = abs(L + i - 1);
      	if(ans > tmp){
          	ans = tmp;
          	inde = i;
        }
    }
  	
  	cout << L + inde - inde << endl; 
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:12: error: 'ans' was not declared in this scope; did you mean 'abs'?
   14 |         if(ans > tmp){
      |            ^~~
      |            abs
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <climits>
using namespace std;

int main(){
  	int N,L;cin>>N>>L;
  	int dif = INT_MAX;
  	int inde;
  	for(int i=1; i<N+1; i++){
    	int tmp = abs(L + i - 1);
      	if(ans > tmp){
          	ans = tmp;
          	inde = i;
        }
    }
  	
  	cout << L + inde - i << endl; 
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:12: error: 'ans' was not declared in this scope; did you mean 'abs'?
   14 |         if(ans > tmp){
      |            ^~~
      |            abs
a.cc:20:28: error: 'i' was not declared in this scope
   20 |         cout << L + inde - i << endl;
      |                            ^
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <climits>
using namespace std;

int main(){
  	int N,L;cin>>N>>L;
  	int dif = INT_MAX;
  	int inde;
  	for(int i=1; i<N+1; i++){
    	int tmp = abs(L + i - 1);
      	if(ans > tmp){
          	ans = tmp;
          	inde = i
        }
    }
  	
  	cout << L + inde - i << endl; 
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:12: error: 'ans' was not declared in this scope; did you mean 'abs'?
   14 |         if(ans > tmp){
      |            ^~~
      |            abs
a.cc:16:25: error: expected ';' before '}' token
   16 |                 inde = i
      |                         ^
      |                         ;
   17 |         }
      |         ~                
a.cc:20:28: error: 'i' was not declared in this scope
   20 |         cout << L + inde - i << endl;
      |                            ^
Language: C++

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

int main()
{
  int N, L, a, sum = 0, e = 10000;
  cin >> N >> L;

  for(int i = 1, i <= N; i++){
    a = L + i - 1;
    sum += a;
    if(abs(a) < abs(e))
      e = a;
  }
  cout << sum - e << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:19: error: expected ';' before '<=' token
    9 |   for(int i = 1, i <= N; i++){
      |                   ^~~
      |                   ;
a.cc:9:20: error: expected primary-expression before '<=' token
    9 |   for(int i = 1, i <= N; i++){
      |                    ^~
Language: C++

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

vector<unsigned long long> next_p_mod(unsigned N, long long mod) { //next_permutation
  vector<unsigned long long> Next_p(N);
  unsigned long long Next_p_buff = 1;
  for (int i = 0; i < N; i++)
  {
    Next_p_buff *= (i + 1) % mod;
    Next_p.at(i) = Next_p_buff % mod;
  }
  return Next_p;
}
unsigned long long modpow(unsigned long long a, unsigned long long n, unsigned long long mod) {
   unsigned long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
void comb(vector<vector <long long int> > &v,unsigned long long mod) {
  //vector<入れたい型> v(配列の個数(x),vector<入れたい型> (配列の個数,初期値));
  for (int i = 0; i < v.size(); i++) {
    v[i][0] = 1;
    v[i][i] = 1;
  }
  for (int k = 1; k < v.size(); k++) {
    for (int j = 1; j < k; j++) {
      v[k][j] = (v[k - 1][j - 1] + v[k - 1][j])%mod;
    }
  }
}
// a^{-1} mod を計算する
unsigned long long modinv(unsigned long long a, unsigned long long mod) {
    return modpow(a, mod - 2, mod);
}


int main() {
  long long N,L;
  bool flag=0;
  cin >> N>>L;
    long long L_sum=L;
  vector<long long> Li(N);
  for(int i=0;i<N;i++){
    Li.at(i)=L+i;
    L_sum+=i;
  }
  sort(Li.begin(),Li.end());
  cout<<L_sum-  Li.at(Li.size/2)<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:52:26: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = long long int; _Alloc = std::allocator<long long int>; size_type = long unsigned int]' (did you forget the '()' ?)
   52 |   cout<<L_sum-  Li.at(Li.size/2)<<endl;
      |                       ~~~^~~~
      |                              ()
Language: C++

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

vector<unsigned long long> next_p_mod(unsigned N, long long mod) { //next_permutation
  vector<unsigned long long> Next_p(N);
  unsigned long long Next_p_buff = 1;
  for (int i = 0; i < N; i++)
  {
    Next_p_buff *= (i + 1) % mod;
    Next_p.at(i) = Next_p_buff % mod;
  }
  return Next_p;
}
unsigned long long modpow(unsigned long long a, unsigned long long n, unsigned long long mod) {
   unsigned long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
void comb(vector<vector <long long int> > &v,unsigned long long mod) {
  //vector<入れたい型> v(配列の個数(x),vector<入れたい型> (配列の個数,初期値));
  for (int i = 0; i < v.size(); i++) {
    v[i][0] = 1;
    v[i][i] = 1;
  }
  for (int k = 1; k < v.size(); k++) {
    for (int j = 1; j < k; j++) {
      v[k][j] = (v[k - 1][j - 1] + v[k - 1][j])%mod;
    }
  }
}
// a^{-1} mod を計算する
unsigned long long modinv(unsigned long long a, unsigned long long mod) {
    return modpow(a, mod - 2, mod);
}


int main() {
  long long N,L;
  bool flag=0;
  cin >> N>>L;
    long long L_sum=L;
  vector<long long> Li(N);
  for(int i=0;i<N;i++){
    Li(i)=L+i;
    L_sum+=i;
  }
  sort(Li.begin(),Li.end());
  cout<<L_sum-  Li.at(Li.size/2)<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:48:7: error: no match for call to '(std::vector<long long int>) (int&)'
   48 |     Li(i)=L+i;
      |     ~~^~~
a.cc:52:26: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = long long int; _Alloc = std::allocator<long long int>; size_type = long unsigned int]' (did you forget the '()' ?)
   52 |   cout<<L_sum-  Li.at(Li.size/2)<<endl;
      |                       ~~~^~~~
      |                              ()
Language: C++

    #include <iostream>
    #include <vector>
    #include <cmath>
    #include <string>
    using namespace std;
    int main(){
        int N,L;
        cin >> N >> L;
        int last = L + N -1
        int first = L;
        int taste = L*N + N*(N + 1)/2;

        if (first >= 0){
            cout << taste - first << endl;
        }else if (last <= 0){
            cout << taste - last << endl;
        }else{
            cout << taste << endl;
        }
        return 0;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: expected ',' or ';' before 'int'
   10 |         int first = L;
      |         ^~~
a.cc:13:13: error: 'first' was not declared in this scope
   13 |         if (first >= 0){
      |             ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
  int N,L;
  cin >> N >> L;
  vector<int> vec(N);
  int taste = 0;
  
  for (int i = 1; i <= N; i++){
    vec[i] = L + i - 1;
    taste += vec[i];
  }
  
  if (vec[1] => 0){
    cout << taste - vec[1] << endl;
  }
  
  else if (vec[N] <= 0){
    cout << taste - vec[N] << endl;
  }
  
  else {
    cout << taste << endl;
  }
  
    
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:15: error: expected primary-expression before '>' token
   15 |   if (vec[1] => 0){
      |               ^
Language: Java

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class abc131_b {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        List<Integer> t = new ArrayList<>();
        for (int i = 1; i <= n; i++) {
            t.add(l + i - 1);
        }
        int absMinimum = Integer.MAX_VALUE;
        int minimum = Integer.MAX_VALUE;
        int sum = 0;
        for (Integer num : t) {
            sum += num;
            if (Math.abs(num) < absMinimum) {
                absMinimum = Math.abs(num);
                minimum = num;
            }
        }
        System.out.println(sum - minimum);
    }
}


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

#include <bits/stdc++.h>
using namespace std;
int main()
{
  int N,L;
  cin >> N >> L;
  vector<int> vec(N);
  int taste = 0;
  
  for (int i = 0; i < N; i++){
    vec[i] = L + i - 1;
    taste += vec[1];
  }
  
  for (int i = 0; i < N; i++){
    if(vec[i] < 0){
      vec[i] = -vec[i];
    }
  }
  
  sort(vec.begin(),vec.end())
    
    if ( taste > 0 ){
      cout << taste - vec.[0] << endl;
    }
  
  if ( taste = 0 ){
      cout << taste << endl;
    }
  
  if ( taste < 0 ){
      cout << taste + vec.[0] << endl;
    }
 
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:30: error: expected ';' before 'if'
   21 |   sort(vec.begin(),vec.end())
      |                              ^
      |                              ;
   22 | 
   23 |     if ( taste > 0 ){
      |     ~~                        
a.cc:32:27: error: expected unqualified-id before '[' token
   32 |       cout << taste + vec.[0] << endl;
      |                           ^
Language: C

#include <stdio.h>
int main (){
  int a,b;
  scanf ("%d",&a,&b);
  for (int i=0;i<a;i++){
  sum=sum+b+i;
  }
  if (b>-1){
  sum=sum-b;
  }
  else if (b<0 && b+a>0){
  sum=sum;
  }
  else{
  sum=sum-(b+a-1);
  }
 printf ("%d",sum);
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:3: error: 'sum' undeclared (first use in this function)
    6 |   sum=sum+b+i;
      |   ^~~
main.c:6:3: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

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


int main() {
  int n,l;
  cin >> n >> l;
  vector<int> a(n);
  rep(i,n) {
    a[i] = l+i;
  }

  int s = 0;
  rep(i,n) s += a[i];
  int ans = 1e9;
  rep (i,n) {
    int t = s - a[i];
    if (abs(t-s) < abs(ans-s)) ans = t;
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:2:14: error: 'i' was not declared in this scope
    2 | #define rep (i,n) for (int i=0; i<(n), i++)
      |              ^
a.cc:10:3: note: in expansion of macro 'rep'
   10 |   rep(i,n) {
      |   ^~~
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#define REP(i,n) for(int i=0;i<n;i++)
using namespace std;
typedef long long ll;

void init(){
	cin.tie(0);
   	ios::sync_with_stdio(false);
}

int main() 
{
    init();
    int N, L;
    cin >> N >> L;

    int natural_sum = (1 + N) * N / 2;
    int buff = N * (L - 1);
    int consumed = INT_MAX;
    REP(i, N) {
        if(abs(i + L) < abs(consumed)) {
            consumed = i + L;
        }
    }

    int result = natural_sum + buff - consumed;
    cout << result << "\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:20: error: 'INT_MAX' was not declared in this scope
   23 |     int consumed = INT_MAX;
      |                    ^~~~~~~
a.cc:6:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    5 | #include <algorithm>
  +++ |+#include <climits>
    6 | #define REP(i,n) for(int i=0;i<n;i++)
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int a,b;
  cin>>a>>b;
  cout<<gcd__(a,b);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'gcd__' was not declared in this scope
    7 |   cout<<gcd__(a,b);
      |         ^~~~~
Language: C++

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

int main () {

    int N, L;
    cin >> N >> L;

    int original = 0;
    for (int i = 1; i <= N; i++) {
        original += L + i - 1;
    }

    int min_diff = INT_MAX;
    int ans;

    for (int i = 1; i <= N; i++) {

        int real = original - (L + i - 1);
        int diff = abs(original - real);
        if (diff < min_diff) {
            min_diff = diff;
            ans = real;
        }
    }
    cout << ans << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:20: error: 'INT_MAX' was not declared in this scope
   16 |     int min_diff = INT_MAX;
      |                    ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include <limits>
  +++ |+#include <climits>
    4 | using namespace std;
Language: C++

#include<iostream>
int main()
{
  int i,N,L,hitL,hitN,buff,sumL;
  std::cin	>>N	>>L	;
  hit=256;
  for(i=0;i<N;i++)
  {
    buff=L+i-1;
    if(buff<0)	buff=buff*-1;
    if(hitL>buff) hitN=i;
  }
  for(i=0;i<N;i++)
    if(i!=hitN)
      sumL=sumL+L+i-1;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'hit' was not declared in this scope; did you mean 'hitN'?
    6 |   hit=256;
      |   ^~~
      |   hitN
Language: C++

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

int main(){
	int n, l, sum, kak;
   int io = 10000;
    cin >> n >> l;
    vector<int> ap;
    for(int i ; i < n ; i++){
      ap = i + l - 1;
    }
   for(int i = 0; i < n; i++){
     sum = sum + ap.at(i);
   }
   for(int i = 0; i < n; i++){
     kak = sum - ap.at(i);
     if (sum - kak < io){
       io = i;
     }
   }
cout << sum - ap.at(io) << endl;
}
  
  


Compiler output:
a.cc: In function 'int main()':
a.cc:10:20: error: no match for 'operator=' (operand types are 'std::vector<int>' and 'int')
   10 |       ap = i + l - 1;
      |                    ^
In file included from /usr/include/c++/14/vector:72,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/vector.tcc:210:5: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = int; _Alloc = std::allocator<int>]'
  210 |     vector<_Tp, _Alloc>::
      |     ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:211:42: note:   no known conversion for argument 1 from 'int' to 'const std::vector<int>&'
  211 |     operator=(const vector<_Tp, _Alloc>& __x)
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
In file included from /usr/include/c++/14/vector:66:
/usr/include/c++/14/bits/stl_vector.h:766:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = int; _Alloc = std::allocator<int>]'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:766:26: note:   no known conversion for argument 1 from 'int' to 'std::vector<int>&&'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |                 ~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:788:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = int; _Alloc = std::allocator<int>]'
  788 |       operator=(initializer_list<value_type> __l)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:788:46: note:   no known conversion for argument 1 from 'int' to 'std::initializer_list<int>'
  788 |       operator=(initializer_list<value_type> __l)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
Language: C++

#include<iostream>
using namespace std;

int main(){
	int n, l, sum, kak;
   int io = 10000;
    cin >> n >> l;
    vector<int> ap;
    for(int i ; i < n ; i++){
      ap = i + l - 1;
    }
   for(int i = 0; i < n; i++){
     sum = sum + ap.at(i);
   }
   for(int i = 0; i < n; i++){
     kak = sum - ap.at(i);
     if (sum - kak < io){
       io = i;
     }
   }
cout << sum - ap.at(io) << endl;
}
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'vector' was not declared in this scope
    8 |     vector<int> ap;
      |     ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:8:12: error: expected primary-expression before 'int'
    8 |     vector<int> ap;
      |            ^~~
a.cc:10:7: error: 'ap' was not declared in this scope
   10 |       ap = i + l - 1;
      |       ^~
a.cc:13:18: error: 'ap' was not declared in this scope
   13 |      sum = sum + ap.at(i);
      |                  ^~
a.cc:16:18: error: 'ap' was not declared in this scope
   16 |      kak = sum - ap.at(i);
      |                  ^~
a.cc:21:15: error: 'ap' was not declared in this scope
   21 | cout << sum - ap.at(io) << endl;
      |               ^~
Language: C++

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

int main() {
    ll n,l;
    cin >> n >> l;
    vector <ll> arr(n);
    ll sum = 0;
    for (int z=1;z<=n;z++){
        arr[z-1] = l+z-1;
        sum += arr[z-1];
    }
    ll mini = LLONG_MAX;
    ll ans = 0;
    for (int z=0;z<n;z++){
        ll temp = sum-arr[z];
        if (abs(temp-sum) < mini){
            mini = abs(temp-sum);
            ans = temp;
        }
    }
    cout << ans << endl;
}
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;

int main() {
    ll n,l;
    cin >> n >> l;
    vector <ll> arr(n);
    ll sum = 0;
    for (int z=1;z<=n;z++){
        arr[z-1] = l+z-1;
        sum += arr[z-1];
    }
    ll mini = LLONG_MAX;
    ll ans = 0;
    for (int z=0;z<n;z++){
        ll temp = sum-arr[z];
        if (abs(temp-sum) < mini){
            mini = abs(temp-sum);
            ans = temp;
        }
    }
    cout << ans << endl;
}


Compiler output:
a.cc:31:5: error: redefinition of 'int main()'
   31 | int main() {
      |     ^~~~
a.cc:6:5: note: 'int main()' previously defined here
    6 | int main() {
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(void){
    
    int N,L;
    cin >> N >> L;
    
    vector<int> data(N);
    for(int i = 0; i < N; i++){
        data[i] = L + N - 1;
    }
    
    if(L > 0){
        int sum = 0;
        data[0] = 0;
        for(int i = 0; i < N; i++){
            sum += data[i];
        }
        cout << sum << endl;
    }
    
    else if(L < 0 && L * -1 > N){
        int sum = 0;
        data[N-1] - 0;
        for(int i = 0; i < N; i++){
            sum += data[i];
        }
        cout << sum << endl;
    }
    
    else
        int sum = 0;
        data[0] = 0;
        for(int i = 0; i < N; i++){
            sum += data[i];
        }
        cout << sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:13: error: 'sum' was not declared in this scope
   35 |             sum += data[i];
      |             ^~~
a.cc:37:17: error: 'sum' was not declared in this scope
   37 |         cout << sum << endl;
      |                 ^~~
Language: C++

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

using namespace std;

int main()
{
  vector<int> v;
  bool positive = false, negative = false, zero = false;
  int n,l,sum = 0;
 	
  cin>>n>>l;
  for(int i=1;i<=n;i++)
  {
    int k = l+i-1;
    sum += k;
  	v.push_back[k];
  }
  if((positive && negative) || zero)
    cout<<sum<<endl;
  else if(positive)
  {
    int min = 9999;
    for(int i=0;i<n;i++)
    {
      if(v[i] < min)
        min = v[i];
    }
    cout<<sum-min<<endl;
  }
  else
  {
    int max = -9999;
    for(int i=0i<n;i++)
    {
      if(v[i]>max)
        max = v[i];
    }
    cout<<sum-max<<endl;
  }
    
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:20: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   18 |         v.push_back[k];
      |                    ^
a.cc:35:17: error: invalid operands of types '__complex__ int' and 'int' to binary 'operator<'
   35 |     for(int i=0i<n;i++)
a.cc:35:23: error: expected ';' before ')' token
   35 |     for(int i=0i<n;i++)
      |                       ^
      |                       ;
Language: C++

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

using namespace std;

int main()
{
  int N,L,MAX=9999,MIN=-9999;
  cin>>N>>L;
  int sum = 0;
  int *ar = new int[N];
  for(int i=0;i<N;i++)
  {
    int k = L+i-1;
    ar[i] = k;
  	sum += k;
  }
  
  int res;
  if(L>0)
  {
  	int min = MAX;
  	for(int i=0;i<N;i++)
  	{
    	if(ar[i]<min)
      	min = ar[i];
  	}
    res = sum-min;
  }
  else
  {
    int max = MIN;
  	for(int i=0;i<N;i++)
    {
      if(ar[i]>MIN)
        max = ar[i];
    }
    res = sum-max;
  }
    cout<<sum-min<<endl;
    
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:14: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator-'
   41 |     cout<<sum-min<<endl;
      |           ~~~^~~~
Language: C++

#include<stdio.h>
#include<math.h>
int main(){
  int N,L,i; scanf("%d %d",&N,&L);
  int apple[N];
  for(i=0;i<N;++i)apple[i]=L+i;
  int sum=0;
  for(i=0;i<N;++i)sum+=apple[i];

  int MIN=1000;
  for(i=0;i<N;++i){
    if(abs(apple[i])<abs(MIN)MIN=apple[i]
  }

  printf("%d\n",sum-MIN);

}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:30: error: expected ')' before 'MIN'
   12 |     if(abs(apple[i])<abs(MIN)MIN=apple[i]
      |       ~                      ^~~
      |                              )
a.cc:13:3: error: expected primary-expression before '}' token
   13 |   }
      |   ^
Language: C++

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

using namespace std;

int main()
{
  int N,L;
  cin>>N>>L;
  int sum = 0;
  int *ar = new int[N];
  for(int i=0;i<N;i++)
  {
    int k = L+i-1;
    ar[i] = k;
  	sum += k;
  }
  
  int min = INT_MAX;
  for(int i=0;i<N;i++)
  {
    if(ar[i]<min)
      min = ar[i];
  }
  cout<<sum-min<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:13: error: 'INT_MAX' was not declared in this scope
   20 |   int min = INT_MAX;
      |             ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include <vector>
  +++ |+#include <climits>
    4 |
Language: C++

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

using namespace std;

int main()
{
  int N,L;
  cin>>N>>L;
  int sum = 0;
  int *ar = new int[N];
  for(int i=0;i<N;i++)
  {
    int k = L+i-1;
    ar[i] = k;
  	sum += k;
  }
  
  cout<<sum-min_element(ar,ar+N)<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:12: error: invalid operands of types 'int' and 'int*' to binary 'operator-'
   20 |   cout<<sum-min_element(ar,ar+N)<<endl;
      |         ~~~^~~~~~~~~~~~~~~~~~~~~
      |         |              |
      |         int            int*
Language: C++

#include<iostream>
using namesoace std;

int main(){
	int N,A;
	cin>>N>>A;
	
	int L=A;
	int R=A+N-1;
	
	int eat;
	if(R<=0)eat=R;
	else if(L>=0)eat=L;
	else eat=0;
	
	int answer=(R+L)*(R-L+1)/2-eat;
	cout<<answer<<endl;
}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namesoace'
    2 | using namesoace std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |         cin>>N>>A;
      |         ^~~
      |         std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:17:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   17 |         cout<<answer<<endl;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:17:23: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   17 |         cout<<answer<<endl;
      |                       ^~~~
      |                       std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

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

int main() {
  int a, b;
  cin >> a >> b;
  
  int c = a + b - 1;
  int sum = ( b + c ) * a / 2
  if ( c < 0 ) {
    sum -= c;
  } else if ( 0 < b ) {
    sum -= b;
  }
  cout << sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: expected ',' or ';' before 'if'
   10 |   if ( c < 0 ) {
      |   ^~
a.cc:12:5: error: 'else' without a previous 'if'
   12 |   } else if ( 0 < b ) {
      |     ^~~~
Language: C++

#include<iostream>
#include <math.h>
#include <algorithm>
#include<queue>
// #include <bits/stdc++.h>


using namespace std;

#define FOR(i,a,b) for(int i=(a),i##formax=(b);i<i##formax;i++)

main(){
    int N, L, dif;
    int taste = 0;
    vector<int> a;
    cin >> N >> L;

    FOR(i,0,N){
        taste += L+i;
        dif = abs(L+i);
        a.push_back(dif);
    }
#include<iostream>
#include <math.h>
#include <algorithm>
#include<queue>
// #include <bits/stdc++.h>


using namespace std;

#define FOR(i,a,b) for(int i=(a),i##formax=(b);i<i##formax;i++)

main(){
    int N, L, dif;
    int taste = 0;
    vector<int> a;
    cin >> N >> L;

    FOR(i,0,N){
        taste += L+i;
        dif = abs(L+i);
        a.push_back(dif);
    }

    sort(a.begin(),a.end());
    if(taste >= 0){taste -= a[0];}
    else{taste += a[0];}
    cout << taste << endl;  

}
    sort(a.begin(),a.end());
    taste -= a[0];
    cout << taste << endl;  

}

Compiler output:
a.cc:12:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   12 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:34:7: error: expected ';' before '{' token
   34 | main(){
      |       ^
      |       ;
Language: C

#include <stdio.h>
#include <stdlib.h>

int main(void){
    int n, l, i, j, taste_bef = 0, taste_aft[200] = {},ans=10000;
    scanf("%d %d", &n, &l);
    for(i=1;i<n+1;i++){
        taste_bef += l + i - 1;
        for(j=1;j<n+1;j++){
            if(i!=j){
                taste_aft[i] += l + j - 1;
            }
        }
    }
    for(i=1;i<n+1;i++){
        if(abs(taste_bef-taste_aft[i])<ans){
            ans = abs(taste_bef-taste_aft[i];
        }
    }
    printf("%d",ans);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:17:45: error: expected ')' before ';' token
   17 |             ans = abs(taste_bef-taste_aft[i];
      |                      ~                      ^
      |                                             )
main.c:17:46: error: expected ';' before '}' token
   17 |             ans = abs(taste_bef-taste_aft[i];
      |                                              ^
      |                                              ;
   18 |         }
      |         ~
Language: C

#include <stdio.h>
#include <stdlib.h>

int main(void){
    int n, l, i, j, taste_bef = 0, taste_aft[200] = {},ans=10000;
    scanf("%d %d", n, l);
    for(i=1;i<n+1;i++){
        taste_bef += l + i - 1;
        for(j=1;j<n+1;j++){
            if(i!=j){
                taste_aft[i] += l + j - 1;
            }
        }
    }
    for(i=1;i<n+1;i++){
        if(abs(taste_bef-taste_aft[i])<ans){
            ans = abs(taste_bef-taste_aft[i];
        }
    }
    printf("%d",ans);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:17:45: error: expected ')' before ';' token
   17 |             ans = abs(taste_bef-taste_aft[i];
      |                      ~                      ^
      |                                             )
main.c:17:46: error: expected ';' before '}' token
   17 |             ans = abs(taste_bef-taste_aft[i];
      |                                              ^
      |                                              ;
   18 |         }
      |         ~
Language: C++

#include <iostream>

using namespace std;
int abs(int n){
  if(n < 0) n = -n;
  return n;
}
int main(){
  int N,L;
  cin >> N >> L;
  int minabs = abs(L);
  int minapple = L;
  int apple_fl = L;
  int apple_pie = L;
  for(int i = 1; i < n; i++){
	appple_fl++;
    apple_pie += apple_fl;
    if(abs(apple_fl) < minabs) {
      minabs = abs(apple_fl);
      minapple = apple_fl;
    }
  }
  cout << (apple_pue - minapple) << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:22: error: 'n' was not declared in this scope
   15 |   for(int i = 1; i < n; i++){
      |                      ^
a.cc:16:9: error: 'appple_fl' was not declared in this scope; did you mean 'apple_fl'?
   16 |         appple_fl++;
      |         ^~~~~~~~~
      |         apple_fl
a.cc:23:12: error: 'apple_pue' was not declared in this scope; did you mean 'apple_pie'?
   23 |   cout << (apple_pue - minapple) << endl;
      |            ^~~~~~~~~
      |            apple_pie
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
   int a,b;
   cin>>a>>b;
   int sum = float(a/2)*(2*b+(a-1));
   if(sum==0)
     cout<<"0"
  else
    cout<<sum-b;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:15: error: expected ';' before 'else'
    9 |      cout<<"0"
      |               ^
      |               ;
   10 |   else
      |   ~~~~
Language: C++

#include,bits/stdc++.h>
using namespace std;
int main()
{
   int n,l;
   cin>>n>>l;
  
     int arr[n+1],sum=0;
    for(int i=1;i<=n;i++)
    {
       arr[i]=l+i-1;
       sum+=arr[i];
    }
  
    long int c;
  
     for(int i=1;i<=n;i++)
     {
         long int diff,sum1=0;
         for(int j=1;j<=n;j++)
         {
             if(i!=j)
               sum1+=arr[j];
         }
          
            if(i==1)
              diff=abs(sum-sum1);
       
             else if(diff > abs(sum-sum1))
             {
                c=sum1;
                diff=abs(sum-sum1);
             }
     }
}
  
     

Compiler output:
a.cc:1:9: error: #include expects "FILENAME" or <FILENAME>
    1 | #include,bits/stdc++.h>
      |         ^
a.cc: In function 'int main()':
a.cc:6:4: error: 'cin' was not declared in this scope
    6 |    cin>>n>>l;
      |    ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #include,bits/stdc++.h>
a.cc:27:20: error: 'abs' was not declared in this scope
   27 |               diff=abs(sum-sum1);
      |                    ^~~
a.cc:29:29: error: 'abs' was not declared in this scope
   29 |              else if(diff > abs(sum-sum1))
      |                             ^~~
Language: C++

#include<iostream>
using namespace std;

int main()
{
  int A,B,i; int count=0;
  cin>>A>>B;
  int something[A];
  for(i=0;i<=A;i++)
    something[i]=A+B-1;
  if(B>=0)
  {  for(i=1;i<A;i++)
    	count+=something[i];
  }
  else if(A+B<0)
  {for(i=0;i<A-1;i++)
	count+=something[i];
  }
  else
  {
    for(i=0;i<=A;i++)
    {if(something[i]!=0)
      count+=something;
    }
  }
  cout<<count<<endl;return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:12: error: invalid conversion from 'int*' to 'int' [-fpermissive]
   23 |       count+=something;
      |       ~~~~~^~~~~~~~~~~
      |            |
      |            int*
Language: C++

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

int main(){
  int n,l;
  cin >> n >> l;
  int L = l;
  int R = l+n-1;
  int sum = n*(L+R)/2
  int eat;
  if(L > 0) eat = L;
  else if(R < 0) eat = R;
  else eat = 0;
  cout << sum - eat << endl;	  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: expected ',' or ';' before 'int'
   10 |   int eat;
      |   ^~~
a.cc:11:13: error: 'eat' was not declared in this scope
   11 |   if(L > 0) eat = L;
      |             ^~~
a.cc:12:18: error: 'eat' was not declared in this scope
   12 |   else if(R < 0) eat = R;
      |                  ^~~
a.cc:13:8: error: 'eat' was not declared in this scope
   13 |   else eat = 0;
      |        ^~~
a.cc:14:17: error: 'eat' was not declared in this scope
   14 |   cout << sum - eat << endl;
      |                 ^~~
Language: C++

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

int main(){
  int N,L;
  cin >> N >> L;
  vector<int> p(N);
  int goukei=0;
  
  for (int i=0;i<N;i++){
    p[i] = L+i-1+1;
    goukei +=p[i];
  }
  int t = 1e9;
  for (int i=0;i<N;i++){
    int t = goukei - p[i];
    if(abs(t-goukei)<abs(ans-goukei))ans = t;
  }
  cout << t << endl;
}
    
  
 
  


Compiler output:
a.cc: In function 'int main()':
a.cc:18:26: error: 'ans' was not declared in this scope; did you mean 'abs'?
   18 |     if(abs(t-goukei)<abs(ans-goukei))ans = t;
      |                          ^~~
      |                          abs
Language: C++

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

int main(){
  int N,L;
  cin >> N >> L;
  vector<int> p(N);
  int goukei=0;
  
  for (int i=0;i<N;i++){
    p[i] = L+i-1+1;
    goukei +=p[i];
  }
  int ans = 1e9;
  for (int i=0;i<N;i++){
    int t = goukei - p[i];
    if(abs(t-goukei)<abs(ans-goukei))ans = t;
  }
  cout << t << endl;
}
    
  
 
  


Compiler output:
a.cc: In function 'int main()':
a.cc:20:11: error: 't' was not declared in this scope
   20 |   cout << t << endl;
      |           ^