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

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

int main(void){
  int n,a;
  unsigned long long sum= 0,ans=0;
  int s;

  cin>>n;

  cin>>sum;
  if(sum>0)
    s = 1;
  else
    s = -1;

  for(int i=1;i<n;i++){
    cin>>a;
    sum+=a;
    if(sum*s>0){
      ans+=abs(sum)+1;
      sum = -s;
    }
    if(sum>0)
      s = 1;
    else
      s = -1;
  }

  if(sum==0) ans++;

  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:15: error: call of overloaded 'abs(long long unsigned int&)' is ambiguous
   22 |       ans+=abs(sum)+1;
      |            ~~~^~~~~
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/stdlib.h:980:12: note: candidate: 'int abs(int)'
  980 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
      |            ^~~
In file included from /usr/include/c++/14/cstdlib:81:
/usr/include/c++/14/bits/std_abs.h:137:3: note: candidate: 'constexpr __float128 std::abs(__float128)'
  137 |   abs(__float128 __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:85:3: note: candidate: 'constexpr __int128 std::abs(__int128)'
   85 |   abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; }
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)'
   79 |   abs(long double __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)'
   75 |   abs(float __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)'
   71 |   abs(double __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)'
   61 |   abs(long long __x) { return __builtin_llabs (__x); }
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)'
   56 |   abs(long __i) { return __builtin_labs(__i); }
      |   ^~~
Language: C++

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

int main(){
  bool ch = false;//falseの時は和が一個前で負
  long long N,i;
  long long ans=0,count=0;
  cin >> N;
  long long a[N];
  cin >> a[0];
  ans+=a;
  if(ans>0)ch = true;
  else ch = false;
  for(i=1;i<N;i++){
    cin >> a[i];
    if(ch/*ans > 0*/){
      if(ans>=-a[i]){
        count += ans+a[i]+1;
        ans = -1;
      }
      else ans += a[i];
      ch = false;
    }else /*if(ans < 0)*/{
      if(ans<=-a[i]){
        count += -ans-a[i]+1;
        ans = 1;
      }
      else ans += a[i];
      ch = true;
    }
    //else if(ans == 0)ans=a;
    //cout << ans << " " << count << endl;
  }
  long long con=0;
  if(a[0]>0){
    ans = -1;
    ch = false;
  }
  else {
    ans = 1;
    ch = true;
  }
  con = a[0]+1;
  for(i=1;i<N;i++){
    if(ch/*ans > 0*/){
      if(ans>=-a[i]){
        count += ans+a[i]+1;
        ans = -1;
      }
      else ans += a[i];
      ch = false;
    }else /*if(ans < 0)*/{
      if(ans<=-a[i]){
        count += -ans-a[i]+1;
        ans = 1;
      }
      else ans += a[i];
      ch = true;
    }
    //else if(ans == 0)ans=a;
    //cout << ans << " " << count << endl;
  }
  cout << min(count,con) << endl;
  return 0;
}


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

#include <iostream>
#include <cassert>
#include <queue>

#define INF 922337203685477580
typedef long long ll;

using namespace std;

int main() {
  int n;
  cin >> n;

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

  ll op = 0LL;
  ll sum = 0LL;
  sum = a[i];
  for (int i = 1; i < n; i++) {
    ll a;
    cin >> a;

    if (!(sum * (sum + a) < 0)) {
      ll tmp_a = sum < 0 ? abs(sum) + 1 : -1 *(abs(sum) + 1);
      op += abs(tmp_a - a);
      sum = sum + tmp_a;
    } else {
      sum += a;
    }
  }

  ll op_m = op;
  if (a[0] > 0) {
    sum = -1;
    op = a[0] + 1;
  } else {
    sum = 1;
    op = -1 * a[0] + 1;
  }
  for (int i = 1; i < n; i++) {
    ll a;
    cin >> a;

    if (!(sum * (sum + a) < 0)) {
      ll tmp_a = sum < 0 ? abs(sum) + 1 : -1 *(abs(sum) + 1);
      op += abs(tmp_a - a);
      sum = sum + tmp_a;
    } else {
      sum += a;
    }
  }
  op = min(op, op_m);

  cout << op << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:11: error: 'i' was not declared in this scope
   21 |   sum = a[i];
      |           ^
Language: C++

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

int main(){
    int n,i,c=0;
    cin >> n;
    int a[n],s[2];
//入力
    for (i=0;i<n;i++){
        cin >> a[i];
    }
//操作
    s[0] = a[0],s[1]=0;
    for (i=1;i<n;i++){
      s[1] = s[0]+a[i];
        if (s[0]*s[1] >=0){//符号一致(または0)していたら符号を一致させない方向へ動かす
            for (;s[0]*s[1]>=0;){
                if (s[0]>0) s[1] -=1;
                else s[1] +=1;
            c += 1;//カウントを増やす
        }
    }
        s[0] = s[1];
       // cout <<"Sum=" <<s[0]<<endl;
    }
    cout <<c<<;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:15: error: expected primary-expression before ';' token
   27 |     cout <<c<<;
      |               ^
Language: Java

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


public class ABC {
	 public static void main(String args[]){
			Scanner sc = new Scanner(System.in);
			// 整数の入力
			int n = sc.nextInt();
			int a[] = new int[n];
			for(int i = 0;i<a.length;i++)
			{
				a[i] = sc.nextInt();
			}
			int b[] = new int[n];
			b[0] = a[0];
			int count = 0;
			for(int i = 0;i<a.length-1;i++)
			{
				b[i+1] = b[i] + a[i+1]; 
				if(b[i+1]*b[i]>0)
				{
					count += Math.abs(b[i+1])+1;
					if(b[i+1]>0) b[i+1]=-1;
					else b[i+1] = 1;
				}
				else if(b[i+1] == 0)
				{
					if(b[i]>0) b[i+1]=-1;
					else b[i+1] = 1;
					count++;
				}
			}
			System.out.println(count);
			
		  }

}


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

#include <vector>
#include <iostream>
#include <utility>
#include <algorithm>
#include <string>
#include <deque>
#include <queue>
#include <tuple>
#include <queue>
#include <functional>
#include <cmath>
#include <iomanip>
#include <map>
#include <set>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#include <complex>
#include <iterator>
#include <array>
#include <memory>
#include <stack>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
#define MAX 9999999
using namespace std;
typedef pair<int, int> pii;
typedef pair<double,double>pdd;
typedef pair<ll,ll>pll;
#define int ll
signed main(){
    int n; cin>>n;
    vi v(n);
    bool flag = false;
    rep(i,n)cin>>v[i];
    vi sum(n);
    int ans=0;
    rep(i,n)sum[i]=v[i];
    rep(i,n){
        if(!i){
            if(sum[0]>0)flag=true;
            else if(sum[0]<0)flag=false;
            else {
                sum[0]=1;
                ans++;
                flag=true;
            }
            continue;
        }
        sum[i]+=sum[i-1];
        
        if(flag){
            if(sum[i]<0)flag=false;a
            else{
                ans+=(abs(sum[i])+1);
                sum[i]= -1;
                flag=false;
            }
        }else{
            if(sum[i]>0)flag=true;
            else {
                ans+=(abs(sum[i])+1);
                sum[i]= 1;
                flag=true;
            }
        }
        
    }
    //rep(i,n)cout<<sum[i]<<" ";
    //cout<<endl;
    cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:67:36: error: 'a' was not declared in this scope
   67 |             if(sum[i]<0)flag=false;a
      |                                    ^
Language: C++

#include <cstdio>
#include <cstring>
#include <string>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <stdlib.h>
#include <list>
#include <queue>
#include <map>
#include <stack>
#include <set>
#define inf 0x3f3f3f3f
#define PI acos(double(-1))
using namespace std;

typedef long long ll;
const int maxn=1e5+10;
int a[maxn];

int main()
{
    int n;
    ll sum,num=1e18;
    scanf("%d",&n);
    for(int i=0;i<n;i++)
        scanf("%d",&a[i]);
    sum=a[0];
    ll cnt=0;
    if(sum==0)
    {
        int i=1;
        while(a[i]==0&&i<n)
            i++;
        if(i==n)
        {
            cnt=(n-1)*2+1;
            printf("%lld\n",cnt);
            return 0;
        }
        for(int i=1;i<n;i++)
    {
        sum=1;
       // scanf("%d",&a[i]);
        if(sum>0)
        {
            ll t=sum+a[i];
            if(t<0)
                sum=t;
            else
            {
                ll b=abs(t+1);
                cnt+=b;
                sum=-1;
            }
        }
        else if(sum<0)
        {
            ll t=sum+a[i];
            if(t>0)
                sum=t;
            else
            {
                ll b=abs(1-t);
                cnt+=b;
                sum=1;
            }
        }
        num=min(num,cnt);
    }
    for(int i=1;i<n;i++)
    {
        sum=-1;
       // scanf("%d",&a[i]);
        if(sum>0)
        {
            ll t=sum+a[i];
            if(t<0)
                sum=t;
            else
            {
                ll b=abs(t+1);
                cnt+=b;
                sum=-1;
            }
        }
        else if(sum<0)
        {
            ll t=sum+a[i];
            if(t>0)
                sum=t;
            else
            {
                ll b=abs(1-t);
                cnt+=b;
                sum=1;
            }
        }
        num=min(num,cnt)
    }
    printf("%lld\n",num);
    return 0;
    }
    for(int i=1;i<n;i++)
    {
       // scanf("%d",&a[i]);
        if(sum>0)
        {
            ll t=sum+a[i];
            if(t<0)
                sum=t;
            else
            {
                ll b=abs(t+1);
                cnt+=b;
                sum=-1;
            }
        }
        else if(sum<0)
        {
            ll t=sum+a[i];
            if(t>0)
                sum=t;
            else
            {
                ll b=abs(1-t);
                cnt+=b;
                sum=1;
            }
        }
    }
    printf("%lld\n",cnt);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:100:25: error: expected ';' before '}' token
  100 |         num=min(num,cnt)
      |                         ^
      |                         ;
  101 |     }
      |     ~
Language: C++

#include <stdio.h>
#include<math.h>
int main(void) {
	// your code goes here
	long int a[100000];
	int n,count= 0;
	scanf("%d",&n);
	int i;
	for(i = 0;i<n;i++)
	{
		scanf("%ld",&a[i]);
		};
		int new = a[0]+a[1];
		int pos;
		if(new <0)
             pos= 0;
        else
            pos = 1;
	for(i = 2;i<n;i++)
	{
		new = a[i]+new;
	//	printf("%d",new);
        pos = !pos;
		if(new>0&& pos==0)
		{count+=abs(new)+1;
		new= -1;}
		else if(new<0 && pos )
          {count+=abs(new)+1;
          new = 1;
          }
        else if(new ==0)
        {
            count++;
            if(pos==0)
            new = -1;
            else
                new = 1;
        }
	}
	printf("%d",count);
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:21: error: expected unqualified-id before 'new'
   13 |                 int new = a[0]+a[1];
      |                     ^~~
a.cc:15:24: error: expected type-specifier before '<' token
   15 |                 if(new <0)
      |                        ^
a.cc:21:21: error: expected type-specifier before '=' token
   21 |                 new = a[i]+new;
      |                     ^
a.cc:21:31: error: expected type-specifier before ';' token
   21 |                 new = a[i]+new;
      |                               ^
a.cc:24:23: error: expected type-specifier before '>' token
   24 |                 if(new>0&& pos==0)
      |                       ^
a.cc:25:32: error: expected type-specifier before ')' token
   25 |                 {count+=abs(new)+1;
      |                                ^
a.cc:26:20: error: expected type-specifier before '=' token
   26 |                 new= -1;}
      |                    ^
a.cc:27:28: error: expected type-specifier before '<' token
   27 |                 else if(new<0 && pos )
      |                            ^
a.cc:28:26: error: expected type-specifier before ')' token
   28 |           {count+=abs(new)+1;
      |                          ^
a.cc:29:15: error: expected type-specifier before '=' token
   29 |           new = 1;
      |               ^
a.cc:31:21: error: expected type-specifier before '==' token
   31 |         else if(new ==0)
      |                     ^~
a.cc:35:17: error: expected type-specifier before '=' token
   35 |             new = -1;
      |                 ^
a.cc:37:21: error: expected type-specifier before '=' token
   37 |                 new = 1;
      |                     ^
Language: C++

  if(a[0]==0){
    ans1++;
    sum0=1;
  }else{
    sum0=a[0];
  }
  REP(i,1,n){
    sum1=sum0+a[i];
    if(sum1*sum0<0){
    }else if(sum1*sum0>0){
      ans1+=abs(sum1)+1;
      sum1=-1*sum0/abs(sum0);
    }else{
      ans1++;
      sum1=-1*sum0/abs(sum0);
    }
    sum0=sum1;
  }

Compiler output:
a.cc:1:3: error: expected unqualified-id before 'if'
    1 |   if(a[0]==0){
      |   ^~
a.cc:4:4: error: expected unqualified-id before 'else'
    4 |   }else{
      |    ^~~~
a.cc:7:6: error: expected constructor, destructor, or type conversion before '(' token
    7 |   REP(i,1,n){
      |      ^
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <math.h>
#include <limits.h>
#include <map>
#include <algorithm>
#include <functional>
using namespace std;

int main() {
    
    int n;
    vector<long long> A;
    long long ans1 = 0;
    long long ans2 = 0;
    long long sum = 0;
    
    cin >> n;
    
    
    for ( int i = 0; i < n; i++ ) {
        long long a;
        cin >> a;
        
        A.push_back(a);
    }
    
    
    is_plus = true;
    for ( int i = 0; i < n; i++ ) {
        
        if ( i ) { is_plus = sum > 0; }
        
        sum += A[i];
        
        if ( sum == 0 ) {
            ans1++;
            sum = is_plus ? -1 : 1;
        }
        else if ( is_plus == (sum > 0) ) {
            ans1 += abs(sum)+1;
            sum = is_plus ? -1 : 1;
        }
    }
    
    is_plus = false;
    for ( int i = 0; i < n; i++ ) {
        
        if ( i ) { is_plus = sum > 0; }
        
        sum += A[i];
        
        if ( sum == 0 ) {
            ans2++;
            sum = is_plus ? -1 : 1;
        }
        else if ( is_plus == (sum > 0) ) {
            ans2 += abs(sum)+1;
            sum = is_plus ? -1 : 1;
        }
    }
    
    
    
    cout << min( ans1, ans2 ) << endl;
    
    
    
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:5: error: 'is_plus' was not declared in this scope
   31 |     is_plus = true;
      |     ^~~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <math.h>
#include <limits.h>
#include <map>
#include <algorithm>
#include <functional>
using namespace std;

int main() {
    
    int n;
    vector<long long> A;
    int j;
    
    bool is_plus;
    long long ans = 0;
    
    long long sum = 0;
    
    cin >> n;
    
    
    for ( int i = 0; i < n; i++ ) {
        long long a;
        cin >> a;
        
        A.push_back(a);
    }
    
    // for ( j = 0; j < n; j++ ) {
        // if ( abs(A[j]) ) { break; }
     // }
    
    // if ( j == n ) {
        // cout << A.size()*2-1 << endl;
        // return 0;
    // }
    
    // if ( j ) {
        // ans += ( j+1 )*2 - 1;
        // sum = ( A[j] > 0 ) ? -1: 1;
    // }
    // else {
        // sum = 0;
        // ans = 0;
    // }
    
    for ( int i = 0; i < n; i++ ) {
        
        if ( !i ) {
            if ( A[i] == 0 ) {
                if ( A[i+1] >= 0 ) { sum = -1; }
                else { sum = 1; }
                ans+;;
            }
            else {
                sum = A[i];
            }
            
            continue;
        }
       
        bool is_plus = sum > 0;
        
        sum += A[i];
        
        if ( sum == 0 ) {
            ans += 1;
            sum = is_plus ? -1 : 1;
        }
        else if ( is_plus == (sum > 0) ) {
            ans += abs(sum)+1;
            sum = is_plus ? -1 : 1;
        }
        
        
    }
    
    cout << ans << endl;
    
    
    
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:57:21: error: expected primary-expression before ';' token
   57 |                 ans+;;
      |                     ^
Language: C++

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

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

    int S = a[0];
    int j = 0;

    for (int i = 1; i < n; i++){
        if (S * (S+a[i]) < 0){
            S += a[i];
        }
        else if (S+a[i] == 0){
           j += 1;
           if (S > 0) S = -1;
           else (S < 0) S = 1;
        }
        else {
            j += abs(S + a[i]) + 1;
            if (S < 0) S = 1;
            else if (S > 0) S = -1;
            }
        }
    }

    printf("%d\n", j);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:24: error: expected ';' before 'S'
   21 |            else (S < 0) S = 1;
      |                        ^~
      |                        ;
a.cc: At global scope:
a.cc:31:11: error: expected constructor, destructor, or type conversion before '(' token
   31 |     printf("%d\n", j);
      |           ^
a.cc:32:1: error: expected declaration before '}' token
   32 | }
      | ^
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <math.h>
#include <limits.h>
#include <map>
#include <algorithm>
#include <functional>
using namespace std;

int main() {
    
    int n;
    vector<long long> A;
    int j;
    
    bool is_plus;
    long long ans = 0;
    
    long long sum = 0;
    
    cin >> n;
    
    S.push_back(0);
    
    for ( int i = 0; i < n; i++ ) {
        long long a;
        cin >> a;
        
        A.push_back(a);
    }
    
    // for ( j = 0; j < n; j++ ) {
        // if ( abs(A[j]) ) { break; }
     // }
    
    // if ( j == n ) {
        // cout << A.size()*2-1 << endl;
        // return 0;
    // }
    
    // if ( j ) {
        // ans += ( j+1 )*2 - 1;
        // sum = ( A[j] > 0 ) ? -1: 1;
    // }
    // else {
        // sum = 0;
        // ans = 0;
    // }
    
    for ( int i = 0; i < n; i++ ) {
        
        if ( !i ) {
            sum = A[i];
            continue;
        }
        
        bool is_plus = sum > 0;
        
        sum += A[i];
        
        if ( sum == 0 ) {
            ans += 1;
            sum = is_plus ? -1 : 1;
        }
        else if ( is_plus == (sum > 0) ) {
            ans += abs(sum)+1;
            sum = is_plus ? -1 : 1;
        }
        
        
    }
    
    cout << ans << endl;
    
    
    
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:5: error: 'S' was not declared in this scope
   25 |     S.push_back(0);
      |     ^
Language: C++

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<iostream>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<set>
#include<map>
#include<string>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const ll INFF=0x3f3f3f3f3f3f3f3f;

int a[100010];
int n;
ll solve()
{
    ll ans=0;
    ll t=a[0];
    for(int i=1;i<n;i++)
    {
        if(t<0)
        {
            t+=a[i];
            if(t<=0)
            {
                ans+=1-t;
                t=1;
            }
            continue;
        }
            t+=a[i];
            if(t>=0)
            {
                ans+=t+1;
                t=-1;
            }
    }
    return ans;
}

int main()
{
    scanf("%d",&n);
        ll sum=0;
        for(int i=0;i<n;i++)
        {
            scanf("%d",&a[i]);
        }
        ll sum=0,t=a[0];
        if(t==0)
        {
            a[0]=1;
            ll sum1=solve();
            a[0]=-1;
            ll sum2=solve();
            sum=min(sum1,sum2)+1;
        }
        else
        {
            ll sum0=solve();
            a[0]=1;
            ll sum1=solve()+abs(1-t);
            a[0]=-1;
            ll sum2=solve()+abs(-1-t);
            sum=min(sum0,min(sum1,sum2));
        }
        printf("%lld\n",sum);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:54:12: error: redeclaration of 'll sum'
   54 |         ll sum=0,t=a[0];
      |            ^~~
a.cc:49:12: note: 'll sum' previously declared here
   49 |         ll sum=0;
      |            ^~~
Language: C++

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<iostream>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<set>
#include<map>
#include<string>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const ll INFF=0x3f3f3f3f3f3f3f3f;

ll a[1000010];
int n;
ll solve()
{
    ll sum=0;
    ll oo=a[0];
    for(int i=1;i<n;i++)
    {
        if(oo<0)
        {
            oo+=a[i];
            if(oo<=0)
            {
                sum+=1-oo;
                oo=1;
            }
            continue;
        }
        else
        {
            oo+=a[i];
            if(oo>=0)
            {
                sum+=oo+1;
                oo=-1;
            }
        }
    }
    return sum;
}

int main()
{
    scanf("%d",&n);
        ll sum=0;
        for(int i=0;i<n;i++)
        {
            scanf("%lld",&a[i]);
        }
        if(a[0]==0)
        {
            a[0]=1;
            ll sum1=solve();
            a[0]=-1;
            ll sum2=solve();
            sum=min(sum1,sum2)+1;
        }
        else
        {
            ll sum0=solve();
            a[0]=1;
            ll sum1=solve()+abs(1-a[0]);
            a[0]=-1;
            ll sum2=solve()+abs(-1-a[0]);
            sum=min(sum0,min(sum1,sum2));
        }
        printf("%lld\n",sum);
    }
    return 0;
}


Compiler output:
a.cc:76:5: error: expected unqualified-id before 'return'
   76 |     return 0;
      |     ^~~~~~
a.cc:77:1: error: expected declaration before '}' token
   77 | }
      | ^
Language: C++

#include <cstdio>
using namespace std;

int main(){
    long double n;
    scanf("%Lf", &n);
    long double a[n];
    for (int i = 0; i < n; i++) scanf(" %Lf", &a[i]);

    int S = a[0];
    int j = 0;

    for (int i = 1; i < n; i++){
        if (S * (S+a[i]) < 0){
            S += a[i];
        }
        else {
            if (S < 0){
                j += 1 - S - a[i];
                S = 1;
            } else{
                j += S + a[i] + 1;
                S = -1;
            }
        }
    }

    printf("%d\n", j);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:19: error: conversion from 'long double' to 'long unsigned int' in a converted constant expression
    7 |     long double a[n];
      |                   ^
a.cc:7:19: error: could not convert 'n' from 'long double' to 'long unsigned int'
    7 |     long double a[n];
      |                   ^
      |                   |
      |                   long double
a.cc:7:19: error: size of array 'a' has non-integral type 'long double'
Language: C++

#include <iostream>
#include <math.h>
using namespace std;

int a(long long int z) { 
	if (z > 0) return 1;
	else if (z < 0) return -1;
	else return 0;
}

int main(){
	long long int n, sum = 0, in, ans = 0;
	cin >> n >> sum;
	for(int i = 1;i<n;i++){
		cin >> in;
		if(i == 1){
			if(sum == 0){
				sum = -1 * a(in);
				ans++;
			}
		}
		if(a(sum) * a(in) < 0 && abs(sum) < abs(in)){
			sum += in;
			continue;
		}
		else if(a(sum) * a(in) < 0){
			ans += abs(sum+in) + 1;
			sum = -1 * a(sum);
			continue;
		}
		ans += abs(sum+in) + 1;
		sum = 1 * a(sum);
		}
	}
	if (sum == 0) ans++;
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc:35:9: error: expected unqualified-id before 'if'
   35 |         if (sum == 0) ans++;
      |         ^~
a.cc:36:9: error: 'cout' does not name a type
   36 |         cout << ans << endl;
      |         ^~~~
a.cc:37:9: error: expected unqualified-id before 'return'
   37 |         return 0;
      |         ^~~~~~
a.cc:38:1: error: expected declaration before '}' token
   38 | }
      | ^
Language: Java

import java.util.*;

// ABC 6-C
// http://abc006.contest.atcoder.jp/tasks/abc006_3
 
public class Main {
	
	public static void main (String[] args) throws java.lang.Exception {
		Scanner in = new Scanner(System.in);

		int n = in.nextInt();
		
		int[] nums = new int[n];
		for (int i = 0; i < n; i++) {
			nums[i] = in.nextInt();
		}
		
		int answer = 0;
		if (nums[0] == 0) {
			answer = solve(nums, 0, 0);
		} else {
			answer = solve(nums, nums[0], 1);
		}
		
		System.out.println(answer);
		
//		
//		long sum = 0;
//		long answer = 0;
//		
//		for (int i = 0; i < n; i++) {
//			int a = in.nextInt();
//			
//			if (sum < 0 && sum + a < 0) {
//				answer += 1 + Math.abs(sum + a);
//				sum = 1;
//			} else if (sum > 0 && sum + a > 0) {
//				answer += 1 + sum + a;
//				sum = -1;
//			} else if (sum + a == 0) {
//				answer++;
//				if (sum < 0) {
//					sum = 1;
//				} else {
//					sum = -1;
//				}
//			} else { 
//				sum += a;
//			}
//		}
		
//		System.out.println(answer);
	}
	
	public static long solve(int[] nums, long sum, int index) {
		if (index == nums.length) {
			return 0;
		}
		if (sum < 0 && sum + nums[index] < 0) {
			return 1 + Math.abs(sum + nums[index]) + solve(nums, 1, index + 1);
		} else if (sum > 0 && sum + nums[index] > 0) {
			return 1 + sum + nums[index] + solve(nums, -1, index + 1);
		} else if (sum + nums[index] == 0) {
			return 1 + Math.min(solve(nums, 1, index + 1), solve(nums, -1, index + 1));
		} else {
			return solve(nums, sum + nums[index], index + 1);
		}
	}
}

Compiler output:
Main.java:20: error: incompatible types: possible lossy conversion from long to int
			answer = solve(nums, 0, 0);
			              ^
Main.java:22: error: incompatible types: possible lossy conversion from long to int
			answer = solve(nums, nums[0], 1);
			              ^
2 errors
Language: C++

#include"bits/stdc++.h"
using namespace std;
int main(){
	int n;
	cin>>n;
	vector<int> x;
	int temp,ans=0;
	for(int i=0;i!=n;++i){
		cin>>temp;
		x.push_back(temp);
	}
	if(!x[0]){
		x[0]=1;
		++ans;
		int val,ind;
		for(int i=0;i!=n;++i){
			if(!x[i]){
				val=x[i];
				ind=i;
				break;
			}
		}
		if((val>0 && ind%2) || (val<0 && !(ind%2))
			x[0]=-1;
	}
	int sum=x[0];
	for(int i=1;i!=n;++i){
		int sum2=sum+x[i];
		if(sum*sum2>=0){
			ans+=abs(sum2)+1;
			if(sum<0)
				sum2=1;
			else
				sum2=-1;
		}
		sum=sum2;
	}
	cout<<ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:59: error: expected ';' before 'x'
   23 |                 if((val>0 && ind%2) || (val<0 && !(ind%2))
      |                                                           ^
      |                                                           ;
   24 |                         x[0]=-1;
      |                         ~                                  
a.cc:25:9: error: expected primary-expression before '}' token
   25 |         }
      |         ^
a.cc:24:33: error: expected ')' before '}' token
   24 |                         x[0]=-1;
      |                                 ^
      |                                 )
   25 |         }
      |         ~                        
a.cc:23:19: note: to match this '('
   23 |                 if((val>0 && ind%2) || (val<0 && !(ind%2))
      |                   ^
a.cc:25:9: error: expected primary-expression before '}' token
   25 |         }
      |         ^
Language: Java


import java.util.*;
import java.io.*;
import java.math.BigInteger;
public class A {

	private static final int mod =(int)1e9+7;
	public static void main(String[] args) throws Exception  {
	      Scanner  sc=new Scanner(System.in);
	      PrintWriter out=new PrintWriter(System.out);
long x=sc.nextLong();
long y=sc.nextLong();
if(Math.abs(x-y)<=1) {
  System.out.println("Brown");
}else {
  out.println("Alice");
}
out.flush();
	    }
	
	
	static boolean vis[]=new boolean[10001];
	      static int gcd(int a, int b) 
	      { 
	          if (a == 0) 
	              return b; 
	          return gcd(b % a, a); 
	      } 
	    
	      // Function to find gcd of array of 
	      // numbers 
	      static int f(int arr[], int n) 
	      { 
	          int result = n; 
	          int max=-1;
	          int ans=0;
	          for (int element: arr){ 
	                if(vis[element]==false)
	                     
	              result = gcd(n, element); 
	              if(result>max) {      
	                    max=result;
	                    ans=element;
	           
	              }
	           
	            
	          } 
	     
	               
	          return ans; 
	      } 
	     
	      
}

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

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

int main()
{
	int a, b;
  cin >> a >> b;
  if (abs(a-b) <= 1){
	cout << "Brown";
  }
  else{
    cout << "Alice";
  }
  return 0;
}


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

#include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define rep(i,n) for(int i=0, i##_len=(int)(n); i<i##_len; i++)
#define reps(i,n) for(int i=1 , i##_len=(int)(n);i<=i##_len;i++)
#define rrep(i,n) for(int i=((int)(n)-1);i>=0;i--)
#define rreps(i,n) for(int i=((int)(n));i>0;i--)
#define repi(i,x) for(auto i=(x).begin(),i##_fin=(x).end();i!=i##_fin;i++)
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define solve(a) ((a)?"Alice":"Brown")
typedef vector<int> Vi;
typedef vector<Vi> VVi;
typedef pair<int , int> Pi;
typedef vector<Pi> VPi;
typedef vector<long long> V;
typedef vector<V> VV;
typedef pair<long long , long long> P;
typedef vector<P> VP;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1;} return 0;}
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1;} return 0;}
const long long INFLL = 1LL<<60;
const int INF = 1<<30;
const double PI=acos(-1);
int main(){
	lll s,t;
	bool ans=false;
	cin >>s>>t;
	if(s+t <=1){
		ans=false;
	}else{
		if(abs(s-t) <=1){
			ans=false;
		}else{
			ans=true;
		}
	}

	cout<<solve(ans)<<endl;
}
/*
fin: 1,0 or 1,1 -> 0,2 or 0,3 -> 2,1 or 4,1 or 2,2 -> 4,0 or  1,3 or 0,5
determent:(0,0)second | (1,0)second| (1,1)second (2,0)first, |(1,2)second, (3,0)first| (1,3)first (2,2) second (4,0) first |(5,0)first (4,1)first (3,2) second|
S 0
SS 1
FSF 2
FSSF 3
FFSFF 4
FFSSFF 5 (3,2)
FFFSFFF 6  (3,3)

(1,2) ,(2,3), (3,4,5,6),(4,5,6,7,8) (5-)
3, 2,1 second
5,0 -> (4(3,1)->second,3(1,2)-> first)->()
*/

Compiler output:
a.cc: In function 'int main()':
a.cc:29:9: error: 'lll' was not declared in this scope; did you mean 'll'?
   29 |         lll s,t;
      |         ^~~
      |         ll
a.cc:31:15: error: 's' was not declared in this scope
   31 |         cin >>s>>t;
      |               ^
a.cc:31:18: error: 't' was not declared in this scope; did you mean 'tm'?
   31 |         cin >>s>>t;
      |                  ^
      |                  tm
Language: C++

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

int main(){
  ll x,y;
  ll a = 0;
  ll b = 0;

  scanf("%lld %lld", &x, &y);

  if(abs(X - Y) <= 1) printf("Brown\n");

  else printf("Alice\n");

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:10: error: 'X' was not declared in this scope
   14 |   if(abs(X - Y) <= 1) printf("Brown\n");
      |          ^
a.cc:14:14: error: 'Y' was not declared in this scope
   14 |   if(abs(X - Y) <= 1) printf("Brown\n");
      |              ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
long long abs(long long x)
{
    return x>=0?x:-x;
}
int main()
{
    long long x,y;
    cin>>x>>y;
	cout<<(abs(x-y)<=1?"Brown":"Alice")<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:19: error: call of overloaded 'abs(long long int)' is ambiguous
   11 |         cout<<(abs(x-y)<=1?"Brown":"Alice")<<endl;
      |                ~~~^~~~~
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:42,
                 from a.cc:1:
/usr/include/stdlib.h:980:12: note: candidate: 'int abs(int)'
  980 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
      |            ^~~
a.cc:3:11: note: candidate: 'long long int abs(long long int)'
    3 | long long abs(long long x)
      |           ^~~
In file included from /usr/include/c++/14/cstdlib:81:
/usr/include/c++/14/bits/std_abs.h:137:3: note: candidate: 'constexpr __float128 std::abs(__float128)'
  137 |   abs(__float128 __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:85:3: note: candidate: 'constexpr __int128 std::abs(__int128)'
   85 |   abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; }
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)'
   79 |   abs(long double __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)'
   75 |   abs(float __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)'
   71 |   abs(double __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)'
   61 |   abs(long long __x) { return __builtin_llabs (__x); }
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)'
   56 |   abs(long __i) { return __builtin_labs(__i); }
      |   ^~~
Language: C++

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

int main()
{
  	long long int x, y;
  	cin>>x>>y;
  	if(abs(x-y) <= 1)
      	cout<<"Brown";
  	else
      	cout<<"Alice"
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:22: error: expected ';' before 'return'
   11 |         cout<<"Alice"
      |                      ^
      |                      ;
   12 |         return 0;
      |         ~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int int64_t
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
#define priq priority_queue<int>
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
#define tii tuple<int,int,int>
signed main(){
  string A,B;
  cin>>A>>B;
  string ans="Alice";
  if(A.size()<B.size())
    ans="Brown";
  else if(A.size()==B.size()){
    if(A<=B)
      ans="Brown";
    else{
      if(A[A.size()-1]!='0'){
        A[A.size()-1]-=1;
        if(A<=B)
          ans="Brown";
      }
      else{
        int a=stoll(A).b=stoll(B);
        if(a<=b+1)
          ans="Brown";
      }
    }
  }
  cout<<ans<<endl;
  }


Compiler output:
a.cc: In function 'int main()':
a.cc:31:24: error: request for member 'b' in 'std::__cxx11::stoll(A, 0, 10)', which is of non-class type 'long long int'
   31 |         int a=stoll(A).b=stoll(B);
      |                        ^
a.cc:32:15: error: 'b' was not declared in this scope
   32 |         if(a<=b+1)
      |               ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int uint64_t
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
#define priq priority_queue<int>
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
#define tii tuple<int,int,int>
signed main(){
  string A,B;
  cin>>A>>B;
  string ans="Alice";
  if(A.size()<B.size())
    ans="Brown";
  else if(A.size()==B.size()){
    if(A<=B)
      ans="Brown";
    else{
      if(A[A.size()-1]!='0'){
        A[A.size()-1]-=1;
        if(A<=B)
          ans="Brown";
      }
      else{
        int a=stoll(A).b=stoll(B);
        if(a<=b+1)
          ans="Brown";
      }
    }
  }
  cout<<ans<<endl;
  }


Compiler output:
a.cc: In function 'int main()':
a.cc:31:24: error: request for member 'b' in 'std::__cxx11::stoll(A, 0, 10)', which is of non-class type 'long long int'
   31 |         int a=stoll(A).b=stoll(B);
      |                        ^
a.cc:32:15: error: 'b' was not declared in this scope
   32 |         if(a<=b+1)
      |               ^
Language: C++

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

int read()
{
    int num=0;
    int flg=1;
    char c=getchar();
    while(!isdigit(c))
    {
        if(c=='-')
        {
            flg=-1;
        }
        c=getchar();
    }
    while(isdigit(c))
    {
        num=(num<<1)+(num<<3)+(c^48);
        c=getchar();
    }
    return num*flg;
}

int main()
{
    return 0&(int)puts(abs(read()-read())<=1?"Brown":"Alice");

Compiler output:
a.cc: In function 'int main()':
a.cc:29:63: error: expected '}' at end of input
   29 |     return 0&(int)puts(abs(read()-read())<=1?"Brown":"Alice");
      |                                                               ^
a.cc:28:1: note: to match this '{'
   28 | {
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
long read(){
    long num=0,flag=1;
    char c=getchar();
    while(!isdigit(c)){
        if(c=='-') flag=-1;
        c=getchar();
    }
    while(isdigit(c)){
        num=(num<<1)+(num<<3)+(c^48);
        c=getchar();
    }
    return num*flg;
}
int main(){
	puts(abs(read()-read())<=1?"Brown":"Alice");
    return 0;
}


Compiler output:
a.cc: In function 'long int read()':
a.cc:14:16: error: 'flg' was not declared in this scope; did you mean 'flag'?
   14 |     return num*flg;
      |                ^~~
      |                flag
Language: C++

# include <iostream>
using namespace std;
typedef long long ll;

int main(void){
  ll n, m;
  cin >> n>> m;
  if (abs(n-m) <= 1) cout << Brown << endl;
  else cout << Alice << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:30: error: 'Brown' was not declared in this scope
    8 |   if (abs(n-m) <= 1) cout << Brown << endl;
      |                              ^~~~~
a.cc:9:16: error: 'Alice' was not declared in this scope
    9 |   else cout << Alice << endl;
      |                ^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main
{
	unsigned long long int x ,y;
    cin>>x>>y;
    if(abs(x - y) <= 1) puts("Brown");
    else puts("Alice");
}

Compiler output:
a.cc:3:5: error: cannot declare '::main' to be a global variable
    3 | int main
      |     ^~~~
a.cc:5:9: error: expected primary-expression before 'unsigned'
    5 |         unsigned long long int x ,y;
      |         ^~~~~~~~
a.cc:5:9: error: expected '}' before 'unsigned'
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
a.cc:6:5: error: 'cin' does not name a type
    6 |     cin>>x>>y;
      |     ^~~
a.cc:7:5: error: expected unqualified-id before 'if'
    7 |     if(abs(x - y) <= 1) puts("Brown");
      |     ^~
a.cc:8:5: error: expected unqualified-id before 'else'
    8 |     else puts("Alice");
      |     ^~~~
a.cc:9:1: error: expected declaration before '}' token
    9 | }
      | ^
Language: C++

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

int main() {
    ll X, Y;
    cin >> X >> Y;
    if (abs(X - Y) < 2) {
        cout << "Brown" << endl;
    } else {
        cout << "Alice" << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:5: error: 'll' was not declared in this scope
    5 |     ll X, Y;
      |     ^~
a.cc:6:12: error: 'X' was not declared in this scope
    6 |     cin >> X >> Y;
      |            ^
a.cc:6:17: error: 'Y' was not declared in this scope
    6 |     cin >> X >> Y;
      |                 ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, a, b) for (ll i = a; i < b; i++)
#define len(v) ll(v.size())
#define fi first
#define se second

template <class T>
void cout_vec(const vector<T> &vec){
  for(auto itr:vec) cout<<itr<<' ';
  cout<<endl;
}

typedef pair<ll,ll> P;
const ll mod=1e9+7;
const ll inf=1e15;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll x,y;
  cin>>x>>y;
  if(|x-y|<=1) cout<<"Brown"<<endl;
  else cout<<"Alice"<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:6: error: expected primary-expression before '|' token
   26 |   if(|x-y|<=1) cout<<"Brown"<<endl;
      |      ^
a.cc:26:11: error: expected primary-expression before '<=' token
   26 |   if(|x-y|<=1) cout<<"Brown"<<endl;
      |           ^~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <string>
#include <queue>
#include <stack>
#include <math.h>

#define MOD 1000000007
#define INF INT_MAX
#define NINF INT_MIN
#define LLINF LLONG_MAX
using ll = long long;
using namespace std;

int main() {
    int X, Y;
    ll >> X >> Y;
    if (abs(X - Y) <= 1) {
        cout << "Brown" << endl;
    }
    else {
        cout << "Alice" << endl;
    }
    getchar(); getchar();
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:8: error: expected unqualified-id before '>>' token
   19 |     ll >> X >> Y;
      |        ^~
Language: C++

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

int main(void){
  long long x, y;
  cin >> x >> y;
  if(abs(x-y)<=1) cout << "Brown" << endl;
  else cout << "Alice" << endl;
}

Compiler output:
a.cc:1:9: fatal error: bits/stdc++: No such file or directory
    1 | #include<bits/stdc++>
      |         ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <cstdio>
main(){long X,Y;std::cin>>X>>Y;puts((abs(X-Y)<2?"Brown":"Alice"));}


Compiler output:
a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    2 | main(){long X,Y;std::cin>>X>>Y;puts((abs(X-Y)<2?"Brown":"Alice"));}
      | ^~~~
a.cc: In function 'int main()':
a.cc:2:22: error: 'cin' is not a member of 'std'
    2 | main(){long X,Y;std::cin>>X>>Y;puts((abs(X-Y)<2?"Brown":"Alice"));}
      |                      ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include <cstdio>
  +++ |+#include <iostream>
    2 | main(){long X,Y;std::cin>>X>>Y;puts((abs(X-Y)<2?"Brown":"Alice"));}
a.cc:2:38: error: 'abs' was not declared in this scope
    2 | main(){long X,Y;std::cin>>X>>Y;puts((abs(X-Y)<2?"Brown":"Alice"));}
      |                                      ^~~
Language: C++

#include <bits.stdc++.h>
using namespace std;
typedef long long ll;
ll x, y;

int main() {
	cin >> x >> y;
	if(abs(x - y) > 1) puts("Alice");
	else puts("Brown");
}

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

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <utility>
#include <cmath>
#include <functional>
#include <queue>
//#include <stack>
#include <climits>
#include <map>
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,n1,n2) for(int i=n1;i<n2;i++)
#define put(a) cout<<a<<endl;
using namespace std;
typedef long long ll;
//typedef unsigned long long ull;
typedef pair<int, int> P;

ll x,y;

int main() {
    cin >> x >> y;
    if(abs(x-y)<=1){
      put("Brown");
     else{
       put("Alice");
     }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:6: error: expected '}' before 'else'
   26 |      else{
      |      ^~~~
a.cc:24:20: note: to match this '{'
   24 |     if(abs(x-y)<=1){
      |                    ^
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <math.h>
#define MOD 1000000007
typedef long long ll;
using namespace std;

int main(){
  unsigned long long x,y;
  cin>>x>>y;
  if(abs(x-y)>=2) cout<<"Alice"<<endl;
  else cout<<"Brown"<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: call of overloaded 'abs(long long unsigned int)' is ambiguous
   13 |   if(abs(x-y)>=2) cout<<"Alice"<<endl;
      |      ~~~^~~~~
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/stdlib.h:980:12: note: candidate: 'int abs(int)'
  980 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
      |            ^~~
In file included from /usr/include/c++/14/cstdlib:81:
/usr/include/c++/14/bits/std_abs.h:137:3: note: candidate: 'constexpr __float128 std::abs(__float128)'
  137 |   abs(__float128 __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:85:3: note: candidate: 'constexpr __int128 std::abs(__int128)'
   85 |   abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; }
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)'
   79 |   abs(long double __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)'
   75 |   abs(float __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)'
   71 |   abs(double __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)'
   61 |   abs(long long __x) { return __builtin_llabs (__x); }
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)'
   56 |   abs(long __i) { return __builtin_labs(__i); }
      |   ^~~