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

#include<stdio.h>

int main(){
	int n,l;
	int _n[200];
	int x;
	int goukei=0;
	int y=0;

	scanf("%d" "%d",&n,&l);
	for(x=1;<=n;x++){
	_n[x]=l+x-1;
	goukei=goukei+_n[x];
    }
	if(_n[1]+_n[n+1]==0){
	printf("%d\n",goukei);
    }
	else if((_n[1]<0)&&(-_n[1]<_n[n+1]))
    {
    goukei=goukei-_n[1];
	printf("%d\n",goukei);
    }
	else
    {
	goukei=goukei-_n[n+1];
	printf("%d\n",goukei);
    }
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:17: error: expected expression before '<=' token
   11 |         for(x=1;<=n;x++){
      |                 ^~
Language: C

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>

using namespace std;

#define REP(i,n) for(int i=0;i<n;i++)
#define all(x) (x).begin(),(x).end()
#define pb(a) push_back(a)
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

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

int main(){
  int n,l;
  cin >> n >> l;
  int aji[n];
  int sum = 0;
  REP(i,n){
    aji[i] = l+i;
    sum += aji[i];
    cout << aji[i] << " ";
  }
  cout << endl;
  int res;
  if(l>=0){
    res = sum-aji[0];
  }else if(n>-l){
    res = sum;
  }else{
    res = sum-aji[n-1];
  }

  cout << res << endl;
  return 0;

}


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

#include <bits/stdc++.h>
#include<algorithm>
#include<math.h>
#include<string>
#include<iostream>
#include <vector>
#include <cstdlib>
using namespace std;
 
template <class T> using V = vector<T>;

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

const long long INF = 1LL << 60;
 
using ll = long long;
using db = double;
using st = string;
using ch = char;
using bl = bool;
using vll = V<ll>;
using vpll =V<pair<ll,ll>>;
using vst = V<st>;
using vdb = V<db>;
using vch = V<ch>;
using vbl = V<bl>;
 
 
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define rFOR(i,a,b) for(ll i=(a);i>(b);i--)
#define oFOR(i,a,b) for(ll i=(a);i<(b);i+=2)
#define bgn begin()
#define en end()
#define SORT(a) sort((a).bgn,(a).en)
#define REV(a) reverse((a).bgn,(a).en)
#define M(a,b) max(a,b)
#define rM(a,b) min(a,b)
#define fi first
#define se second
#define sz size()
#define gcd(a,b) __gcd(a,b)
#define co(a) cout<<a<<endl;
#define ci(a) cin>>a;
 
 
ll sum(ll n) {
  ll m=0;
  FOR(i,0,20){
    m+=n%10;
    n/=10;
    if(n==0){
      break;
    }
  }
  return m;
}
 
 
ll combi(ll n,ll m) {
  ll ans=1;
  rFOR(i,n,n-m){
    ans*=i;
  }
  FOR(i,1,m+1){
    ans/=i;
  }
  return ans;
}
 
 
ll lcm(ll a,ll b){
  ll n;
  n=a/gcd(a,b)*b;
  return n;
}
 
 
/****************************************\
| Thank you for viewing my code:)        |
| Written by RedSpica a.k.a. RanseMirage |
| Twitter:@asakaakasaka                  | 
\****************************************/
 
 
signed main() {
  ll n,l;
  ci(n>>l);
  vll A(n);
  ll pi=0;
  FOR(i,0,n){
    A[i]=i+l;
    pi+=A[i];
  }
  if(0<=l) co(pi-A[0])
    else if(l<-n) co(pi-A[n-1])
      else(pi)
}

Compiler output:
a.cc: In function 'int main()':
a.cc:109:15: error: expected ';' before '}' token
  109 |       else(pi)
      |               ^
      |               ;
  110 | }
      | ~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a=0,b,i,N,L;
  	scanf("%d %d",&N,&L);
  	int b=0;
  	for(i=L;i<L+N;i++)
    {
		a+=i;
      	b+=i;
    }
  	for(i=L;i<L+N;i++)
    {
		if(a-i<=a-b)
        {
			b=i;
        }
    }
  	printf("%d",a);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:13: error: redeclaration of 'int b'
    7 |         int b=0;
      |             ^
a.cc:5:17: note: 'int b' previously declared here
    5 |         int a=0,b,i,N,L;
      |                 ^
Language: C++

#include<stdio.h>

int main(){
	int N = 0;
	int i;
	int L = 0;
	int sum = 0;
	for( ; ;)
	scanf("%d",&N);
	if(1 < N && N < 201)
		break;
	
	for(i = 0; i < N - 1; i++){
		for( ; ;)
			scanf("%d",&L);
			if(-101 < L && L < 101){
				break;}
		sum += L + i - 1;
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: break statement not within loop or switch
   11 |                 break;
      |                 ^~~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: expected ',' or ';' before 'if'
    7 |   if (L < 0 && (N + L) > 0){
      |   ^~
a.cc:12:3: error: 'else' without a previous 'if'
   12 |   else if (L < 0 && (N + L) <= 0){
      |   ^~~~
Language: C++

// #include <algorithm>
// #include <cctype>
// #include <climits>
// #include <cmath>
// #include <cstdio>
// #include <iostream>
// #include <locale>
// #include <numeric>
// #include <queue>
// #include <stack>
// #include <string>
// #include <unordered_map>
// #include <utility>
// #include <vector>
// #include <numeric>
// #include <limits>
 
// using namespace std;

// long gcd(long c, long d){
//     if(c < d){
//         long tem = c;
//         c = d;
//         d = tem;
//     }
//     long r = c % d;

//     while(!r){
//         d = c;
//         c = r;
//         r = c % d;
//     }
//     cout<<d<<endl;
//     return d;
// }

// long lcm(long c, long d){
//     return c*d / gcd(c,d);
// }

// int main(){
//     long long A;cin>>A;
//     long long B;cin>>B;
//     long C;cin>>C;
//     long D;cin>>D;

//     long x = A/ C;
//     if(A % C != 0 )x++;

//     long xEnd = B/C;
//     xEnd++;

//     long y = A/D;
//     if(A%D != 0)y++;

//     long yEnd = B/D;
//     yEnd++;

//     long temp = lcm(C,D);

//     long z= A/(temp);
//     if(A%(temp != 0))z++;

//     long zEnd = B/(temp);
//     zEnd++;

//     cout<<B - A - ( x - xEnd + y - yEnd - (z - zEnd))<<endl;


// }

#include <algorithm>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <locale>
#include <numeric>
#include <queue>
#include <stack>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>
 
using namespace std;

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

    vector<int> apple(N);
    int sum = L;
    apple[0] = L;
    bool flag = false;
    for(int i =1;i < N; i++){
        apple[i] = L + i;
        // if(apple[i] == 0)flag = true;
        sum += apple[i];
    }
    int pi = INT_MAX;
    int ans ;
    for(int i = 0; i < M; i++){
        if(abs(apple[i]) <  pi){
            pi = abs(apple[i]);
            ans = sum - apple[i];
        }
    }
    cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:104:24: error: 'M' was not declared in this scope
  104 |     for(int i = 0; i < M; i++){
      |                        ^
Language: C++

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

int main() {
  string str = "Good";
  int n, l, result;
  cin >> n >> l;
  if(l > 0){
    result = n * (l + 1 + l + n - 1) / 2;
  }else if(l < 0 && l + n - 1 > 0){
    result = n * (l + l + n - 1) / 2;
  }else{
    result = n * (l + l + n - 2) / 2;
  cout << result << endl;
}

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

#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repr(i, n) for(int i = n; i >= 0; i++)
#define REP(i, m, n) for(int i = m; i < n; i++)
#define SORT(v) sort((v).begin(), (v).end())
#define REV(v) sort((v).begin(), (v).end(), greater<int>())
typedef long long ll;
int gcd(int a,int b){return b?gcd(b,a%b):a;};
int lcm(int a,int b){return a * b / gcd(a, b);};

int main() {
  int n, l;
  cin >> n >> l;
  int a = 20000000;
  long long su = 0;
  for(int i = 0; i < n; i++) {
    su += i + n;
    if(a > abs(i + l)) a = abs(i + l);
  }
  // if(l > 0) cout << su - l << endl;
  // else {
  //   if(abs(l) <= n) cout << 0 << endl;
  //   else cout << su + (l - n + 1) << endl;
  // }
  if(l >= 0) cout << su - l << endl;
  else {
    if(n < abs(l)) cout << su + (abs(l) - n + 1) << endl;;
    else cout << su << endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:5: error: 'else' without a previous 'if'
   30 |     else cout << su << endl;
      |     ^~~~
Language: C++

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

int main() {
   int N,L;
  cin>>N>>L;
  int sum=0;
  int answer=L;
  for(int i=1;i<N+1;i++){
    sum+=L+i-1;
  }
  for(int i=2;i<N+1;i++){
    if(abs(answer)>abs(L+i-1)){
      answer=L+i-1;
    }
  }
  int ans=sum-answer
    cout<<ans<<endl;
}
  
    


Compiler output:
a.cc: In function 'int main()':
a.cc:18:5: error: expected ',' or ';' before 'cout'
   18 |     cout<<ans<<endl;
      |     ^~~~
Language: C++

#include<iostream>
using namespace std;
int minn(int sum, int a){
	return sum - a;
}
int main(){
	int N;
	int L;
	int s = 0;
	cin >> N;
	cin >> L;
	int a[N] = {0};
	int k;
	int minn = 10000;
	int maxn = -10000;
	for(int i = 1; i <= N; i++){
		a[i] = L + i - 1;//-101
		s += a[i];//0
	}
	k = s - a[1];
	for(int i = 1; i <= N - 1; i++){
		if(minn(s, a[i]) > minn(s,a[i+1]))
		    k = minn(s,a[i+1]);
	}
	cout << s - k;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:24: error: 'minn' cannot be used as a function
   22 |                 if(minn(s, a[i]) > minn(s,a[i+1]))
      |                    ~~~~^~~~~~~~~
a.cc:22:40: error: 'minn' cannot be used as a function
   22 |                 if(minn(s, a[i]) > minn(s,a[i+1]))
      |                                    ~~~~^~~~~~~~~~
a.cc:23:29: error: 'minn' cannot be used as a function
   23 |                     k = minn(s,a[i+1]);
      |                         ~~~~^~~~~~~~~~
Language: C++

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

int main() {
   int N,L;
  cin>>N>>L;
  int sum=0;
  int answer=L+i-1;
  for(int i=1;i<N+1;i++){
    sum+=L+i-1;
  }
  for(int i=2;i<N+1;i++){
    if(abs(answer)>abs(L+i-1)){
      answer=L+i-1;
    }
  }
}
  
    


Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: 'i' was not declared in this scope
    8 |   int answer=L+i-1;
      |                ^
Language: Java

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);

        int n = stdIn.nextInt();
        int l = stdIn.nextInt();
        int[] t = new int[n]; // 味
        int sum = 0;
        int total = 0;
        for (int i = 0; i < n; i++) {
            total += t[i];
        }
        for (int i = 0; i < n; i++) {
            t[i] = l + i;
        }
        int flag = t[0];
        if (t[0] < 0) {
            for (int i = 1; i < n; i++) {
                sum += t[i];
                if (flag <= sum) {
                    System.out.println(total - t[i]);
                } else
                    flag += t[i];
            }
        } else {
            System.out.println(total - t[0]);
        }
        if (t[n - 1] <= 0) {
            System.out.pritnln(total - t[n - 1]);
        }
    }
}

Compiler output:
Main.java:31: error: cannot find symbol
            System.out.pritnln(total - t[n - 1]);
                      ^
  symbol:   method pritnln(int)
  location: variable out of type PrintStream
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repr(i, n) for(int i = n; i >= 0; i++)
#define REP(i, m, n) for(int i = m; i < n; i++)
#define SORT(v) sort((v).begin(), (v).end())
#define REV(v) sort((v).begin(), (v).end(), greater<int>())
typedef long long ll;
int gcd(int a,int b){return b?gcd(b,a%b):a;};
int lcm(int a,int b){return a * b / gcd(a, b);};

int main() {
  int n, l;
  cin >> n >> l;
  int a = 20000000;
  long long su = l * n;
  for(int i = 0; i < n; i++) {
    su += i;
    if(a > abs(i + l)) a = abs(i + l);
  }
  // if(l > 0) cout << su - l << endl;
  // else {
  //   if(abs(l) <= n) cout << 0 << endl;
  //   else cout << su + (l - n + 1) << endl;
  // }
  if(l > 0) cout << su - l << endl;
  else {
    if(n >= abs(l)) cout << su - (abs(l) - n);
    else cot << su << endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:10: error: 'cot' was not declared in this scope; did you mean 'cos'?
   30 |     else cot << su << endl;
      |          ^~~
      |          cos
Language: C++

#include<iostream>
using namespace std;

int main(){
    int N,L,b,c;
    cin>>N>>L;
    int a[N];
    for(int i=0;i<N;i++){
        a[i]=L+i-1;
    }
    for(int j=0;j<N;j++){
        if(abs(a[j])<abs(a[j+1])
        b=j;
    }
    for(int l=0;l<N;l++){
        c+=a[l];
    }
    cout<<c-a[b]<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:33: error: expected ';' before 'b'
   12 |         if(abs(a[j])<abs(a[j+1])
      |                                 ^
      |                                 ;
   13 |         b=j;
      |         ~                        
a.cc:14:5: error: expected primary-expression before '}' token
   14 |     }
      |     ^
a.cc:13:13: error: expected ')' before '}' token
   13 |         b=j;
      |             ^
      |             )
   14 |     }
      |     ~        
a.cc:12:11: note: to match this '('
   12 |         if(abs(a[j])<abs(a[j+1])
      |           ^
a.cc:14:5: error: expected primary-expression before '}' token
   14 |     }
      |     ^
Language: C++

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

int main() {
  int N, L;
  cin >> N >> L;
  vector<int> a(N);
  for(int i = 0; i < N; i++) {
    a[i] = L + i;
  }
  vector<int> b(N);
  for(int i = 0; i < N; i++) {
    b[i] = abs(a[i]);
  }
  int min = 1000;
  for(int i = 0; i < N; i++) {
    if(min > b[i]) min = b[i];
  }
  if(a[i] < 0) min *= -1;
  int ans = 0;
  for(int i = 0; i < N; i++) {
    ans += a[i];
  }
  cout << ans - min << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:8: error: 'i' was not declared in this scope
   19 |   if(a[i] < 0) min *= -1;
      |        ^
Language: C++

#include <bits/stdc++.h>
#include<algorithm>
#include<math.h>
#include<string>
#include<iostream>
#include <vector>
#include <cstdlib>
using namespace std;
 
template <class T> using V = vector<T>;

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

const long long INF = 1LL << 60;
 
using ll = long long;
using db = double;
using st = string;
using ch = char;
using bl = bool;
using vll = V<ll>;
using vpll =V<pair<ll,ll>>;
using vst = V<st>;
using vdb = V<db>;
using vch = V<ch>;
using vbl = V<bl>;
 
 
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define rFOR(i,a,b) for(ll i=(a);i>(b);i--)
#define oFOR(i,a,b) for(ll i=(a);i<(b);i+=2)
#define bgn begin()
#define en end()
#define SORT(a) sort((a).bgn,(a).en)
#define REV(a) reverse((a).bgn,(a).en)
#define M(a,b) max(a,b)
#define rM(a,b) min(a,b)
#define fi first
#define se second
#define sz size()
#define gcd(a,b) __gcd(a,b)
#define co(a) cout<<a<<endl;
#define ci(a) cin>>a;
 
 
ll sum(ll n) {
  ll m=0;
  FOR(i,0,20){
    m+=n%10;
    n/=10;
    if(n==0){
      break;
    }
  }
  return m;
}
 
 
ll combi(ll n,ll m) {
  ll ans=1;
  rFOR(i,n,n-m){
    ans*=i;
  }
  FOR(i,1,m+1){
    ans/=i;
  }
  return ans;
}
 
 
ll lcm(ll a,ll b){
  ll n;
  n=a/gcd(a,b)*b;
  return n;
}
 
 
/****************************************\
| Thank you for viewing my code:)        |
| Written by RedSpica a.k.a. RanseMirage |
| Twitter:@asakaakasaka                  | 
\****************************************/
 
 
signed main() {
  ll n,l;
  ci(n>>l);
  vll A(n);
  ll pi=0;
  FOR(i,0,n){
    A[i]=i+l;
    pi+=A[i];
    A[i]=abs(A[i]);
  }
  SORT(A);
  co(min(pi-A[i],pi+A[i]))
}

Compiler output:
a.cc: In function 'int main()':
a.cc:109:15: error: 'i' was not declared in this scope; did you mean 'pi'?
  109 |   co(min(pi-A[i],pi+A[i]))
      |               ^
a.cc:55:21: note: in definition of macro 'co'
   55 | #define co(a) cout<<a<<endl;
      |                     ^
Language: C++

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

int arr[202];

int main()
{
    int N,L;
    cin >> N >> L;
    int originalSum = 0;
    for (int i=1;i<=N;i++)
    {
        arr[i] = L+i-1;
        originalSum += arr[i];
    }
    int minDiff = INT_MAX;
    int minSum = 0;
    for (int i=1;i<=N;i++)
    {
        int calcSum = 0;
        for (int j=1;j<=N;j++)
        {
            if (i == j)
                continue;
            calcSum += arr[j];
            if (abs(calcSum - originalSum) < minDiff)
            {
                minDiff = abs(calcSum - originalSum);
                minSum = calcSum;
            }
        }
    }
    cout << minSum << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:19: error: 'INT_MAX' was not declared in this scope
   18 |     int minDiff = 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 | using namespace std;
Language: C

#include<stdio.h>
int main (void){
int N,L,i=0,j,sum=0;
scanf("%d",&N);
scanf("%d",&L);
int taste[N+1];
for(j=0;j<N;j++){
taste[i]=L+N-1
}
if(L<=0&&0<=L+N-1){
for(i=0;i<N;i++){
sum+=taste[i];
}
}
if(L>0){
for(i=1;i<N;i++){
sum+=taste[i];
}
}else{
for(i=0;i<N-1;i++){
sum+=taste[i];
}
}
printf("%d",sum);
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:15: error: expected ';' before '}' token
    8 | taste[i]=L+N-1
      |               ^
      |               ;
    9 | }
      | ~
Language: C++

#include<iostream>
using namespace std;

int main(){
    int a[],N,L,b,c;
    cin>>N>>L;
    for(int i=0;i<N;i++){
        a[i]=L+i-1;
    }
    for(int j=0;j<N-1;j++){
        if(a[j]<a[j+1])
        b=j;
    }
    for(int l=0;l<N;l++){
        c+=a[l];
    }
    cout<<c-a[b]<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: storage size of 'a' isn't known
    5 |     int a[],N,L,b,c;
      |         ^
Language: C++

#include<iostream>
using namespace std;

int main(){
    int a[N],L,b,c;
    cin>>N>>L;
    for(int i=0;i<N;i++){
        a[i]=L+i-1;
    }
    for(int j=0;j<N-1;j++){
        if(a[j]<a[j+1])
        b=j;
    }
    for(int l=0;l<N;l++){
        c+=a[l];
    }
    cout<<c-a[b]<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:11: error: 'N' was not declared in this scope
    5 |     int a[N],L,b,c;
      |           ^
a.cc:8:9: error: 'a' was not declared in this scope
    8 |         a[i]=L+i-1;
      |         ^
a.cc:11:12: error: 'a' was not declared in this scope
   11 |         if(a[j]<a[j+1])
      |            ^
a.cc:15:12: error: 'a' was not declared in this scope
   15 |         c+=a[l];
      |            ^
a.cc:17:13: error: 'a' was not declared in this scope
   17 |     cout<<c-a[b]<<endl;
      |             ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:27: error: unable to find numeric literal operator 'operator""b'
   10 |                 cout << ((2b + a - 1) * a / 2) - b << endl;
      |                           ^~
a.cc:13:27: error: unable to find numeric literal operator 'operator""b'
   13 |                 cout << ((2b + a - 1) * a / 2) - (a + b - 1) << endl;
      |                           ^~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:27: error: unable to find numeric literal operator 'operator""b'
   10 |                 cout << ((2b + a - 1) * a / 2) - b << endl;
      |                           ^~
a.cc:13:27: error: unable to find numeric literal operator 'operator""b'
   13 |                 cout << ((2b + a - 1) * a / 2) - (a + b - 1) << endl;
      |                           ^~
a.cc:17:2: error: expected '}' at end of input
   17 | }
      |  ^
a.cc:6:1: note: to match this '{'
    6 | {
      | ^
Language: C

#include<stdio.h>

int Solve(int n, int l) {
	int mintas=0;
	int minnum=0;
	int taste, ans = 0;

	for (int i = 1;i <= n;i++) {
		taste = l + i - 1;
		if (taste < 0)
			taste = -taste;
		if (i == 1)
			mintas = taste;
		if (taste <= mintas)
			minnum = i;
	}
	for (int i = 1;i <= n;i++) {
		if (i != minnum)
			ans += l + i - 1;
	}

	return ans;
}
int main() {
	int n, l;
	scanf_s("%d%d", &n, &l);
	printf("%d", Solve(n,l));
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:26:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
   26 |         scanf_s("%d%d", &n, &l);
      |         ^~~~~~~
      |         scanf
Language: Java

import java.util.Scanner;

public class Main　{
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = Integer.parseInt(sc.next());
    int K = Integer.parseInt(sc.next());
    int ans = 0;

    if(K >= 0) {
    	ans = (N-1) * (K + 1) + (N - 2) * (N - 1) / 2;
    }
    else if( K < 0 && N > Math.abs(K)) {
    	ans = N * K + (N - 1) * N / 2;
    }
    else if(K < 0 && N <= Math.abs(K)) {
    	ans = (N-1) * K + (N - 2) * (N - 1) / 2;
    }

    System.out.println(ans);
  }
}

Compiler output:
Main.java:3: error: illegal character: '\u3000'
public class Main?{
                 ^
1 error
Language: C++

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


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

int main()
{

	int N = 0;
	int L = 0;
	cin >> N;
	cin >> L;

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

	int tsumamiIndex = 0;
	if (L >= 1)
	{
		tsumamiIndex = 1;
	}
	else if (L <= -N)
	{
		tsumamiIndex = N;
	}
	else
	{
		tsumamiIndex = 1 - L;
	}

	auto aji = tsumamiIndex - 1 + L;
	sum -= aji;

	cout << sum;
	cin >> aji;
	return 0;
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope
    6 |         cin >> N;
      |         ^~~
a.cc:33:9: error: 'cout' was not declared in this scope
   33 |         cout << sum;
      |         ^~~~
Language: C++

#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <stdio.h>
#include <numeric>
#include <cmath>

using namespace std;

int main(){

    int N, L, sum;

    cin >> N >> L;


    vector<int> taste,taste_a;

    for (int i=0;i<N;i++) {
        taste.push_back(L + i);
    }

    vector<size_t> indices(taste.size());
    iota(indices.begin(), indices.end(), 0);

    for (auto j:taste) {
        taste_a.push_back(abs(j));
    }

    sort(indices.begin(), indices.end(), [&taste_a](size_t i1, size_t i2) {
        return taste_a[i1] < taste_a[i2];
    });


    sum = accumulate(taste.begin(), taste.end(), 0);
    cout << (sum - taste[indices[0]]) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   31 |     sort(indices.begin(), indices.end(), [&taste_a](size_t i1, size_t i2) {
      |     ^~~~
      |     sqrt
Language: C++

#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <stdio.h>
#include <numeric>
#include <cmath>

using namespace std;

int main(){

    int N, L, sum;

    cin >> N >> L;


    vector<int> taste,taste_a;

    for (int i=0;i<N;i++) {
        taste.push_back(L + i);
        cout << "::" << taste[i] << endl;
    }

    vector<size_t> indices(taste.size());
    iota(indices.begin(), indices.end(), 0);

    for (auto j:taste) {
        taste_a.push_back(abs(j));
    }

    sort(indices.begin(), indices.end(), [&taste_a](size_t i1, size_t i2) {
        return taste_a[i1] < taste_a[i2];
    });


    sum = accumulate(taste.begin(), taste.end(), 0);
    cout << (sum - taste[indices[0]]) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   32 |     sort(indices.begin(), indices.end(), [&taste_a](size_t i1, size_t i2) {
      |     ^~~~
      |     sqrt
Language: C++

#include<cstdio>
#include<algorithm>
#include<iostream>
#include<string>
#include<vector>
#include<stack>
#include<bitset>
#include<cstdlib>
#include<cmath>
#include<set>
#include<list>
#include<deque>
#include<map>
#include<queue>
using namespace std;
typedef long long ll;
const double PI = acos(-1.0);
const double eps = 1e-6;
const int mod = 1e9+7;
const int maxn = 200005;
int T,n,m;
ll a[maxn];
int main() {
	for(int i=0;i<=1000;i++)
		a[i] = i;
	int N,L;
	cin>>N>>L;
	int flag = 0;
	for(int i=1;i<=N;i++){
		a[i]=a[i]+L-1;
		//cout<<a[i]<<endl;
		if(a[i]==0){
			flag = 1;
		}
	}
	
	ll sum=0;
	if(flag){
		for(int i=0;i<N;i++)
			sum+=ap[i];
		cout<<sum<<endl;
		return 0;
	}
	if(L>=0)
	for(int i=2;i<=N;i++){
		sum+=a[i];
	}
	else {
		for(int i=1;i<N;i++){
		sum+=a[i];
		}
	}
	cout<<sum<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:30: error: 'ap' was not declared in this scope; did you mean 'a'?
   40 |                         sum+=ap[i];
      |                              ^~
      |                              a
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:12: error: expected initializer before '+=' token
    7 |     int sum+=l;
      |            ^~
a.cc:12:9: error: 'sum' was not declared in this scope
   12 |         sum+=l+i-1;
      |         ^~~
a.cc:14:11: error: 'sum' was not declared in this scope
   14 |     cout<<sum-min<<endl;
      |           ^~~
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
        int l = sc.nextInt();
        int sum = 0;
        int[] azi = new int[n];
        for(int i=0; i<n; i++){
            azi[i] = l+i;
          
        }
      
      if(l<0&&n+l>0||l=0){ 
        for(int i=0; i<n; i++){
            sum = sum + azi[i];
//          System.out.println(azi[i]);
        }
      }else if(l>0){
        for(int i=1; i<n; i++){
            sum = sum + azi[i];
//          System.out.println(azi[i]);
        }
      }else{
          for(int i=0; i<n-1; i++){
            sum = sum + azi[i];
//            System.out.println(azi[i]);
        }
      } 
        System.out.println(sum);
	}
}


Compiler output:
Main.java:14: error: bad operand types for binary operator '||'
      if(l<0&&n+l>0||l=0){ 
                   ^
  first type:  boolean
  second type: int
1 error
Language: C++


#include<bits/stdc++.h>
#define ll  long long
#define ff first
#define ss second
#define pb push_back
#define mp make_pair

using namespace std;
ll ma=1000000007;
ll power(ll p,ll t){
if(t==0)
    return 1;
ll y=power(p,t/2);
y=(y*y)%ma;
if(t%2==1)
    y=(y*p)%ma;
return y;
}


int mod(int a){
if(a>=0)
    return a;
else return -a;
}



 int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n,l;
cin>>n>>l;
int a[n+1];

int x=0;int ma=mod(l);
int k=1;
for(int i=1;i<=n;i++){
    a[i]=l+i-1;
    x+=a[i];
    if(ma>mod(a[i])){
        ma=mod(a[i]);
        k=i;
    }


}
cout<<x-a[i]<<endl;

}











Compiler output:
a.cc: In function 'int main()':
a.cc:49:11: error: 'i' was not declared in this scope
   49 | cout<<x-a[i]<<endl;
      |           ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:22: error: expression cannot be used as a function
    9 |     ans = (l+1+l+n-1)(n-1)/2;
      |           ~~~~~~~~~~~^~~~~
Language: C++

// おまじない
#include <bits/stdc++.h>
using namespace std;
 
int main() {
int n,l;
  cin>>n>>l;
  int sum=n*(2*l+n-1)/2
  if(l<=0 && l+n-1>=0){
    cout<<sum<<endl;}
  else if(l>0){
    cout<<sum<<endl;}
  else{
    cout<<sum -(l+n-1)<<endl;}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: expected ',' or ';' before 'if'
    9 |   if(l<=0 && l+n-1>=0){
      |   ^~
a.cc:11:3: error: 'else' without a previous 'if'
   11 |   else if(l>0){
      |   ^~~~
Language: C

#include<stdio.h>

int Solve(int n, int l) {
	int min = 1000000;
	int taste, ans = 0;

	for (int i = 1;i <= n;i++) {
		taste = l + i - 1;
		if (taste < 0)
			taste = -taste;
		if (taste < min)
			min = i;
	}

	for (int i = 1;i <= n;i++) {
		if (i != min)
			ans += l + i - 1;
	}

	return ans;
}
int main() {
	int n, l;
	scanf_s("%d%d", &n, &l);
	printf("%d", Solve(n,l));
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:24:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
   24 |         scanf_s("%d%d", &n, &l);
      |         ^~~~~~~
      |         scanf
Language: Java

import java.util.*;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        int L = sc.nextInt();
        int[] ap = new int[N];
        int[] aji = new int[N];
        int sumall = 0;
        int sumsub = 0


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

        Arrays.sort(aji);
        for(int i = 0;i < N;i++){
            sumall += aji[i];
            sumsub += aji[i];
        }
        sumsub -= aji[0];
        System.out.println(sumsub);
    }
}

Compiler output:
Main.java:12: error: ';' expected
        int sumsub = 0
                      ^
1 error
Language: C++

#include<iostream>
using namespace std;
int main(){
  int a=0;
  int b=0;
  int q=0;
  cin >> a >> b;
  for (int i =0;i<a;a++){
  if (b+i-1==0){
    for(int p=0;p<a;p++){
      q=q+b+p-1;
    }
    int w =i;
  }
  }
  cout << q-w << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:13: error: 'w' was not declared in this scope
   16 |   cout << q-w << endl;
      |             ^
Language: C

#include<stdio.h>
#include<stdlib.h>
int main(void){
  int n,l,min1;
  scanf("%d %d",&n,&l);
  int i=0;
  int l1[n];
  int cnt=0;
  int min=10000;
  for(i=0;i<n;i++){

    l1[i]=l+i;
    //printf("%d",l1[i]);
  }
  for(i=0;i<n;i++){
    cnt+=l1[i];
  }
  for(i=0;i<n;i++){
    if(abs(l1[i])<min){
      min=abs(l1[i]);
      min1=i;
    }
  }
  printf("%d",cnt-l[min1]);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:24:20: error: subscripted value is neither array nor pointer nor vector
   24 |   printf("%d",cnt-l[min1]);
      |                    ^
Language: C++

/*
ID: Nipun Paul
LANG: C++
PROB: God knows
*/

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

int main()
{
    int a,b,sum=0,flag=0;
    cin>>a>>b;
    for(int i=b; i<=a+b-1; i++)
    {
        if(i<=0)
        {
            flag=1;
        }
        sum=sum+i;
        //cout<<i<<endl;
    }
    if(flag==1 && a+b-1=>0)
    {
        cout<<sum<<endl;
    }
    else if(flag==1 && a+b-1<0)
    {
        cout<<sum-(a+b-1)<<endl;
    }
    else
    {
        cout<<sum-b<<endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:25: error: expected primary-expression before '>' token
   23 |     if(flag==1 && a+b-1=>0)
      |                         ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:24: error: expression cannot be used as a function
    9 |     ans = (l+1)*(l+n-1)(n-1)/2;
      |                 ~~~~~~~^~~~~
a.cc:10:20: error: 'ebdl' was not declared in this scope
   10 |     cout << ans << ebdl;
      |                    ^~~~
a.cc:15:9: error: expected ';' before 'cout'
   15 |     cout
      |         ^
      |         ;
   16 |     cout << ans << endl;
      |     ~~~~
Language: C++

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

int main() {
  std::vector<int> v;
  int n, l;

  std::cin >> n >> l;

  v.resize(n);
  std::iota(v.begin(), v.end(), l);

  if (l > 0) {
    v.erase(v.begin());
  } else if (l <= 0 && (n + l) > 0) {    
    v.erase(std::find(v.begin(), v.end(), 0));
  } else {
    v.pop_back();
  }

  std::cout << accumulate(v.begin(), v.end(), 0) << std::endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:22: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int)'
   17 |     v.erase(std::find(v.begin(), v.end(), 0));
      |             ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:17:22: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   17 |     v.erase(std::find(v.begin(), v.end(), 0));
      |             ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
Language: C

#include<stdio.h>

int main() {
	int n, l;
	scanf_s("%d%d", &n, &l);
	printf("%d", Solve(n,l));
	return 0;
}
int Solve(int n, int l) {
	int min=0;
	int taste,ans=0;

	for (int i = 0;i < n;i++) {
		taste = l + i - 1;
		if (taste < 0)
			taste = taste * -1;
		if (taste < min)
			min = i;
	}

	for (int i = 0;i < n;i++) {
		if (i != min)
			ans += l + i - 1;
	}

	return ans;
}


Compiler output:
main.c: In function 'main':
main.c:5:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    5 |         scanf_s("%d%d", &n, &l);
      |         ^~~~~~~
      |         scanf
main.c:6:22: error: implicit declaration of function 'Solve' [-Wimplicit-function-declaration]
    6 |         printf("%d", Solve(n,l));
      |                      ^~~~~
Language: C++

#include <iostream>
#include <limits>

using namespace std;

int main(int argc, char *argv[])
{
	int N, L;
	int a[205];

	cin >> N >> L;
	int s1 = 0;
	for (int i = 0; i < N; i++) {
		a[i] = L + (i + 1) - 1;
		s1 += a[i];
	}
	int ans = 0, t = INT_MAX;
	for (int i = 0; i < N; i++) {
		int s2 = 0;
		for (int j = 0; j < N; j++) {
			if (i != j) {
				s2 += a[j];
			} 
		}
		int b = abs(s1 - s2);
		if (b < t) {
			t = b;
			ans = s2;
		}
	}

	cout << ans << "\n";
	return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:17:26: error: 'INT_MAX' was not declared in this scope
   17 |         int ans = 0, t = INT_MAX;
      |                          ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    2 | #include <limits>
  +++ |+#include <climits>
    3 |
Language: C++

#include <algorithm>
#include <iostream>
#include <string>using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, l;
  cin >> n >> l;
  int sum = n * l + ((0 + (n - 1)) * n / 2);
  int mint = 100000;
  int mini = 0;
  for (int i = 0; i < n; i++) {
    if (mint > abs(l + i)) {
      mint = abs(l + i);
      mini = i;
    }
  }
  cout << sum - (l + mini) << endl;
}

Compiler output:
a.cc:3:24: warning: extra tokens at end of #include directive
    3 | #include <string>using namespace std;
      |                        ^~~~~~~~~
a.cc:3:10: fatal error: string>usin: No such file or directory
    3 | #include <string>using namespace std;
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>
int main(void){
  int n,l;
  scanf("%d %d",&n,&l);
  int i=0;
  int l1[n];
  int cnt=0;
  for(i=0;i<n;i++){
    l[i]=l+i-1;
  }
  for(i=1;i<n;i++){
    cnt+=l[i];
  }
  printf("%d",cnt);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:9:6: error: subscripted value is neither array nor pointer nor vector
    9 |     l[i]=l+i-1;
      |      ^
main.c:12:11: error: subscripted value is neither array nor pointer nor vector
   12 |     cnt+=l[i];
      |           ^
Language: C++

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

int main()
{
	int n,l;
	cin>>n>>l;
    int a[n];
	int sum=0;  
	for(i=0;i<n;i++)
    {
		a[i]=l+(i+1)-1;
        sum+=a[i];
    }
    sort(a,a+n);
  
    cout<<sum-a[0];
}

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

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

int main() {
  using namespace std;

  vector<int> v;
  int n, l;

  cin >> n >> l;

  v.resize(n);
  iota(v.begin(), v.end(), l);

  if (l > 0) {
    v.erase(v.begin());
  } else if (l <= 0 && (n + l) > 0) {    
    v.erase(find(v.begin(), v.end(), 0));
  } else {
    v.pop_back();
  }

  cout << accumulate(v.begin(), v.end(), 0) << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:17: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int)'
   19 |     v.erase(find(v.begin(), v.end(), 0));
      |             ~~~~^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:19:17: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   19 |     v.erase(find(v.begin(), v.end(), 0));
      |             ~~~~^~~~~~~~~~~~~~~~~~~~~~~
Language: C++

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

int main(){
	int n,l,c=0,sum=0;
  	cin >> n >> l;
  
  vector<int> rd(n);
  int m;
  
  for(int i=0;i<n;i++){
	rd[i]=l+i;
  }
  for(int i=0;i<n-1;i++){
    m=min(fabs(rd[i]),fabs(rd[i+1]))
  }
  for(int i=0;i<n;i++){
    if(rd[i]==m && c==0){
      sum+=rd[i];
      c=1;
    }else{ sum+=rd[i];
         }
    
    cout << sum << endl;
    return 0;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:16:37: error: expected ';' before '}' token
   16 |     m=min(fabs(rd[i]),fabs(rd[i+1]))
      |                                     ^
      |                                     ;
   17 |   }
      |   ~                                  
a.cc:27:4: error: expected '}' at end of input
   27 |   }
      |    ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

#include<iostream> 
#include<string>
#include<bits/stdc++.h>
using namespace std;
int main(){	
    int N,L;
    cin>>N>>L;
    int f[N];
    int sum=0;
    for(int i=0;i<N;i++){
    	f[i]=L+i-1;
    	sum=sum+f[i];
    }
    int cnt[2]={0,0}
    for(int i=0;i<N;i++){
    	if(f[i]>0){
    		cnt[0]++;
    	}
    	else if(f[i]==0){
    		cout<<sum<<endl;
    		return 0;
    	}
    	else if(f[i]<0){
    		cnt[1]++;
    	}
    }
    if(cnt[0]==N){
    	cout<<sum-f[0];
    	return 0;
    }
    else if(cnt[1]==N){
    	cout<<sum-f[N];
    	return 0;
    }
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:15:5: error: expected ',' or ';' before 'for'
   15 |     for(int i=0;i<N;i++){
      |     ^~~
a.cc:15:17: error: 'i' was not declared in this scope
   15 |     for(int i=0;i<N;i++){
      |                 ^
Language: C++

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

int main() {
	/*freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);*/

	int n, l;
	cin >> n >> l;

	vector<int> apples;
	for (int i = 0; i < n; i++) 
		apples.push_back(l + i);

	int min_val = INT_MAX;
	int pos = 0;
	for (int i = 0; i < n; i++) {
		if (abs(apples[i]) < min_val) {
			min_val = abs(apples[i]);
			pos = i;
		}
	}
	apples[pos] = 0;
	int ans = 0;
	for (int i = 0; i < n; i++)
		ans += apples[i];
	cout << ans;
}

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

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

int main() {
  int N,L,count=0;
  cin >> N >> L;
  vector<int> AP(N);
  for(int i=0;i<N;i++){
  	int aa=L+i;
    AP.at(i)=abs(aa);
    count+=aa;if()
  }int min=42332,atai=0;
  for(int i=0;i<N;i++){
  	if(abs(AP.at(i))<min){
      min=AP.at(i);
      atai=i;
    }
  }
  cout << count-AP.at(atai) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:18: error: expected primary-expression before ')' token
   11 |     count+=aa;if()
      |                  ^
a.cc:12:3: error: expected primary-expression before '}' token
   12 |   }int min=42332,atai=0;
      |   ^
Language: C++


#include <iostream>
#include <string>
#include <vector>
#include <cstdio>
#include <algorithm>
#include <array>
#include <cmath>

using namespace std;

using ll = long long int;

// GCDを計算します
template <typename NumType>
NumType calcGCD(NumType a, NumType b) {
    if (a < b) {
        NumType tmp = a;
        a = b;
        b = tmp; 
    }

    NumType r = a % b;
    while (r != 0) {
        a = b;
        b = r;
        r = a % b;
    }

    return b;
}

// 約数を数えます
template <typename NumType>
NumType cntDivisor(const NumType & num) {
    NumType cnt = 0;
    for(NumType i = 1; i * i <= num; ++i) {
        if(num % i == 0) {
            cnt++;
            if(i * i != num) cnt++;
        }
    }

    return cnt;
}

// [beg, end)の範囲を，添え字indexでループするfor文に置換します
#define FOR_RANGE(index, beg, end)     for (ll index = beg; index < N; ++index)

#define DEBUG(x)     std::cout << #x << " : " << x << "\n"

int main() {
    int N, L;

    cin >> N >> L;
    int sum = 0;
    int min = INT_MAX;
    for (int i = 0; i < N; i++) {
        sum += L + i;
        if (abs(L + i) < min) min = abs(L + i);
    }

    if (sum >= 0)
        cout << sum - min;
    else
        cout << sum + min;

    return 0;
}



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

#include <iostream>
using namespace std;
int main(){
  int N,L;
  cin >> N >> L;
  sum = (2*L+N-1)*N/2;
  if(L <= 0 && 0 < L+N-1){
    cout << sum << endl;
  }else if(0 < L){
    cout << sum-L << endl;
  }else{
    cout << sum-(L+N-1) << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'sum' was not declared in this scope
    6 |   sum = (2*L+N-1)*N/2;
      |   ^~~
Language: C++

apple = []
min = 100
flag = 0
n, l = map(int, input().split())
for i in range(n):
        apple.append(l+i)
for i in apple:
        if abs(i) <= min:
                if i >= 0:
                        flag = 0
                else:
                        flag = 1
                min = abs(i)
if flag == 0:
        print(sum(apple) - min)
else:
        print(sum(apple) + min)

Compiler output:
a.cc:1:1: error: 'apple' does not name a type
    1 | apple = []
      | ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define pb push_back
#define mp make_pair

int N, L;

void solve()
{
	vector<int> fla;
	for(int i=1;i<=N;++i)fla.pb(L+i-1);
	ll sum = accumulate(fla.begin(),fla.end(),0LL);
	ll ans = -1, best = INF;
	for(int i=0;i<N;++i){
		ll cur = sum - fla[i];
		if(abs(sum-cur)<best){
			best = abs(sum-cur);
			ans = cur;
		}
	}
	cout << ans << endl;
}

int main()
{
	ios::sync_with_stdio(false);
	cin >> N >> L;
	solve();
	return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:14:29: error: 'INF' was not declared in this scope
   14 |         ll ans = -1, best = INF;
      |                             ^~~
Language: C++

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

int main(){
  int N,L,s=0;
  cin >> N >> L;
  for(int i=0; i<N; i++){
    s+=L+i
  }
  if(L>=0){
    s-=L;
  }
  else if(L<=(-1)*N){
    s-=L+N-1;
  }
  cout << s << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: expected ';' before '}' token
    8 |     s+=L+i
      |           ^
      |           ;
    9 |   }
      |   ~
Language: C++

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


int main() {
	int N, L;

	cin >> N >> L;

	int min_val = 0;
	int min_idx = 0;
	int total = 0;
	for(int i=0; i<N; i++){
		int tmp_abs = abs(L+i);
		total += L+i;
		if (tmp_abs < min_abs) {
			min_val = L+i;
			min_idx = i;
		}
	}

	cout << total - min_val;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:31: error: 'min_abs' was not declared in this scope
   20 |                 if (tmp_abs < min_abs) {
      |                               ^~~~~~~