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

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
  ll n;
  cin >> n;
  ll sum[n + 1] = {};
  for(ll i = 0; i < n; i++){
    ll a;
    cin >> a;
    sum[i + 1] = sum[i] + a;
  }
  ll ans = 1145148931919810;
  for(ll i = 1; i < n; i++) ans = min(ans, (ll)abs(suｍ[i] - (sum[n] - sum[i])));
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:52: error: 'su\U0000ff4d' was not declared in this scope
   14 |   for(ll i = 1; i < n; i++) ans = min(ans, (ll)abs(suｍ[i] - (sum[n] - sum[i])));
      |                                                    ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
  ll n;
  cin >> n;
  ll sum[n + 1] = {};
  for(ll i = 0; i < n; i++){
    ll a;
    cin >> a;
    sum[i + 1] = sum[i] + a;
  }
  ll ans = 1145148931919810;
  for(ll i = 1; i < n; i++) ans = min(ans, (ll)abs(suu[i] - (sum[n] - sum[i])));
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:52: error: 'suu' was not declared in this scope; did you mean 'sum'?
   14 |   for(ll i = 1; i < n; i++) ans = min(ans, (ll)abs(suu[i] - (sum[n] - sum[i])));
      |                                                    ^~~
      |                                                    sum
Language: C++

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

using namespace std;

int main() {
  int N;
  cin >> N;
  vector<long long> a(n);
  long long int sum = 0;
  for (int i = 0; i < N; ++i) {
    cin >> a[i];
    sum += a[i];
  }

  long long int ans = 1000000000000000000LL;
  long long int x = 0;
  for (int i = 0; i < N; i++) {
    x += a[i];
    if (i + 1 < N) {
      ans = min(ans, abs(sum - 2 * x));
    }
  }
  cout << ans << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: 'vector' was not declared in this scope
   11 |   vector<long long> a(n);
      |   ^~~~~~
a.cc:5:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    4 | #include <iostream>
  +++ |+#include <vector>
    5 | 
a.cc:11:10: error: expected primary-expression before 'long'
   11 |   vector<long long> a(n);
      |          ^~~~
a.cc:14:12: error: 'a' was not declared in this scope
   14 |     cin >> a[i];
      |            ^
a.cc:21:10: error: 'a' was not declared in this scope
   21 |     x += a[i];
      |          ^
Language: C++

#include<cstdio>
#include<iomanip>
#include<cmath>
#include<cstdlib>
#include<cctype>
#include<cstring>
#include<algorithm>
#include<iostream>
#define IO ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define rep(i,n) for(int i=1;i<=n;i++)
#define c(ans) cout<<ans<<endl;
using namespace std;
typedef long long ll;
const int MAXN=2e5+10;
ll a[MAXN];
int main(){
	IO;
	ll n, t;
	a[0] = 0;
	cin >>  n;
	for(ll i = 1; i <= n; i++){ 
		cin >> t;
		a[i] = a[i-1] + t;	
	}
	ll ans = 1 << 29;
	rep(ll i = 1; i < n; i++){
		ans = min(ans, abs(a[n] - a[i]*2));
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc:26:33: error: macro "rep" requires 2 arguments, but only 1 given
   26 |         rep(ll i = 1; i < n; i++){
      |                                 ^
a.cc:10:9: note: macro "rep" defined here
   10 | #define rep(i,n) for(int i=1;i<=n;i++)
      |         ^~~
a.cc: In function 'int main()':
a.cc:26:9: error: 'rep' was not declared in this scope
   26 |         rep(ll i = 1; i < n; i++){
      |         ^~~
Language: C

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

int main()
{
    int n,i,j;
    int min1=100,min2;
    int s1=0,s2=0,s=0;
    cin>>n;
    long long a[n];
    for(i=0;i<n;i++){
        cin>>a[i];
    }


    for(i=0;i<n;i++){
        s+=a[i];
    }

    for(i=0;i<n-1;i++){
    for(j=0;j<=i;j++){
        s1+=a[j];
    }
    s2=s-s1;

    min2=abs(s1-s2);
    if(min2<min1) min1=min2;
    }
    cout<<min1<<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 <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main()
{
	int n;
	cin >> n;
	
	long long sum = 0;
	vector<long long> a(n);
	for(int i = 0; i < n; i++)
	{
		cin >> a[i];
		sum += a[i];
	}
	
	long long tmp = 0;
	long long ans = 2*max_element(a.begin(), a.end());
	for(int i = 0; i < n - 1; i++)
	{
		tmp += a[i];
		
		long long ttmp = sum - 2*tmp > 0 ? sum - 2*tmp : 2*tmp - sum;
		
		if(ans > ttmp)
		{
			ans = ttmp;
		}
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:26: error: no match for 'operator*' (operand types are 'int' and '__gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >')
   21 |         long long ans = 2*max_element(a.begin(), a.end());
      |                         ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                         |            |
      |                         int          __gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >
Language: C++

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

int main(){
  int n;
  cin >> n;
  ll a[n], ansy=0;
  for(int i=0;i<n;i++){
    cin >> a[i];
    ansy+=a[i];
  }
  ll ansx=a[i], ans = abs(ansy-ansx); 
  for(int i=1;i<n;i++){
    ansx += a[i];
    ansy -= a[i];
    ans = min(ans, abs(ansx-ansy));
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:13: error: 'i' was not declared in this scope
   14 |   ll ansx=a[i], ans = abs(ansy-ansx);
      |             ^
a.cc:18:5: error: 'ans' was not declared in this scope; did you mean 'ansx'?
   18 |     ans = min(ans, abs(ansx-ansy));
      |     ^~~
      |     ansx
a.cc:20:11: error: 'ans' was not declared in this scope; did you mean 'ansx'?
   20 |   cout << ans << endl;
      |           ^~~
      |           ansx
Language: C++

#include <vector> 
#include <list> 
 #include <map>
 #include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <queue>
using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

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

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

//debug
#define dump(x)  cerr << #x << '=' << (x) << endl;
#define debug(x) cerr << #x << '=' << (x) << '('<<'L' << __LINE__ << ')' << ' ' << __FILE__ << endl;

LL minabs=LONG_LONG_MAX;

LL sum=0;
LL N;
vector<LL> A;
LL a;
int main(){
    cin>>N;
    REP(i,N){
        cin>>a;
        A.push_back(a);
        sum+=a;   
    }
    LL suke=0;
    FOR(i,0,N-1){
        suke+=A[i];
        minabs=min(minabs,abs(suke-(sum-suke)));
    }

    cout<<minabs<<endl;




}


Compiler output:
a.cc:70:11: error: 'LONG_LONG_MAX' was not declared in this scope
   70 | LL minabs=LONG_LONG_MAX;
      |           ^~~~~~~~~~~~~
Language: C++

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

using namespace std;

int main()
{
    long long N;
    cin >> N;

    vector<long long> sumVec(N, 0);

    long long a;
    cin >> a;
    sumVec.[0] = a;

    long long total = a;

    for (long long i = 1; i < N; i++)
    {
        cin >> a;
        sumVec.[i] = a + sumVec[i - 1];
        total += a;
    }

    long long ans = LLONG_MAX;
    for (long long i = 0; i < N - 1; i++)
    {
        ans = min(ans, abs(sumVec[i] - (total - sumVec[i])));
    }

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

Compiler output:
a.cc: In function 'int main()':
a.cc:17:12: error: expected unqualified-id before '[' token
   17 |     sumVec.[0] = a;
      |            ^
a.cc:24:16: error: expected unqualified-id before '[' token
   24 |         sumVec.[i] = a + sumVec[i - 1];
      |                ^
Language: C++

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

using namespace std;

int main()
{
    vector<long long> sumVec;

    long long N;
    cin >> N;

    long long a;
    cin >> a;
    sumVec.push_back(a);

    for (long long i = 1; i < N; i++)
    {
        cin >> a;
        sumVec.push_back(a + sumVec[i - 1]);
    }

    long long ans = 1 << 29;
    for (long long i = 0; i < N - 1; i++)
    {
        ans = min(ans, abs(sumVec[i] -  (sumVec[i] - sumVec[N - 1]));
    }

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

Compiler output:
a.cc: In function 'int main()':
a.cc:27:69: error: expected ')' before ';' token
   27 |         ans = min(ans, abs(sumVec[i] -  (sumVec[i] - sumVec[N - 1]));
      |                  ~                                                  ^
      |                                                                     )
Language: C++

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

using namespace std;

int main()
{
    vector<long long> sumVec;

    long long N;
    cin >> N;

    long long a;
    cin >> a;
    sumVec.push_back(a);

    for (long long i = 1; i < N; i++)
    {
        cin >> a;
        sumVec.push_back(a + sumVec[i - 1]);
    }

    long long ans = 1 << 29;
    for (long long i = 0; i < N - 1; i++)
    {
        ans = min(ans, abs(sumVec[i] - sumVec[N - 1]))
    }

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

Compiler output:
a.cc: In function 'int main()':
a.cc:27:55: error: expected ';' before '}' token
   27 |         ans = min(ans, abs(sumVec[i] - sumVec[N - 1]))
      |                                                       ^
      |                                                       ;
   28 |     }
      |     ~
Language: C++

#define _CRT_SECURE_NO_WARNINGS
#define __STDC_FORMAT_MACROS
#include <algorithm>
#include <cinttypes>
#include <cstdio>
#include <cstdlib>
#include <vector>

using namespace std;

template<class T> void gc(T &x)
{
    char c;
    int s = 0;
    x = 0;

    c = getgetchar_unlocked();

    if (c == '-') s = 1;
    else if ('0' <= c && c <= '9')  x = c - '0';

    while (true)
    {
        c = getchar_unlocked();

        if (c < '0' || c > '9') break;
        x = x * 10 + (c - '0');
    }

    if (s) x = -x;
}

int main()
{
    int N;

    gc(N);

    int tmp;
    int64_t ttl = 0;
    vector<int> a(N);
    for (int i = 0; i < N; i++)
    {
        gc(tmp);
        a[i] = tmp;
        ttl += tmp;
    }

    int64_t now = 0;
    int64_t mn = INT64_MAX;
    for (int i = 0; i < N; i++)
    {
        now += a[i];
        mn = min(mn, abs(ttl - 2 * now));
    }

    printf("%" PRId64 "\n", mn);
    return 0;
}


Compiler output:
a.cc: In function 'void gc(T&)':
a.cc:17:9: error: there are no arguments to 'getgetchar_unlocked' that depend on a template parameter, so a declaration of 'getgetchar_unlocked' must be available [-fpermissive]
   17 |     c = getgetchar_unlocked();
      |         ^~~~~~~~~~~~~~~~~~~
a.cc:17:9: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
a.cc: In instantiation of 'void gc(T&) [with T = int]':
a.cc:37:7:   required from here
   37 |     gc(N);
      |     ~~^~~
a.cc:17:28: error: 'getgetchar_unlocked' was not declared in this scope; did you mean 'getchar_unlocked'?
   17 |     c = getgetchar_unlocked();
      |         ~~~~~~~~~~~~~~~~~~~^~
      |         getchar_unlocked
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#include <limits>

using namespace std;
inline void amin(int  &x,int  y)
{
    if ( y < x ) {
        x   =   y;
    }
}

int main()
{
    int N;//,a;
    long long sum[200001];
    sum[0] = 0;
    long long min_num = 2 * 10000000000;//pow(10, 9.0);

    cin >> N;

    for (int i = 1; i <= N; i++) {
        //cin >> a;
        cin >> sum[i];
        sum[i] += sum[i - 1];// + a;
    }
    
    for ( int i = 1; i < N; i++) {
        //min_num = min(min_num, abs(sum[N] - (2 * sum[i])));
        admin(min_num, abs(sum[N] - (2 * sum[i)));
    }
    cout << min_num << '\n';

}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:47: error: expected ']' before ')' token
   33 |         admin(min_num, abs(sum[N] - (2 * sum[i)));
      |                                               ^
      |                                               ]
a.cc:33:9: error: 'admin' was not declared in this scope; did you mean 'amin'?
   33 |         admin(min_num, abs(sum[N] - (2 * sum[i)));
      |         ^~~~~
      |         amin
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#include <limits>

using namespace std;

int main()
{
    int N;//,a;
    long long sum[200001];
    sum[0] = 0;
    long long min_num = LLONG_MAX;//2 * 10000000000;//pow(10, 9.0);

    cin >> N;

    for (int i = 1; i <= N; i++) {
        //cin >> a;
        cin >> sum[i];
        sum[i] += sum[i - 1];// + a;
    }
    
    for ( int i = 1; i < N; i++) {
        min_num = min(min_num, abs(sum[N] - (2 * sum[i])));
    }
    cout << min_num << '\n';

}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:25: error: 'LLONG_MAX' was not declared in this scope
   15 |     long long min_num = LLONG_MAX;//2 * 10000000000;//pow(10, 9.0);
      |                         ^~~~~~~~~
a.cc:6:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    5 | #include <vector>
  +++ |+#include <climits>
    6 | #include <limits>
Language: C++

#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
using namespace std;

#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define pi acos(-1.0)

typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;



int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    ll ans = LLONG_MAX;
    ll a_sum = 0;
    VL v;
    cin >> n;
    REP(i, n){
        ll a;
        cin >> a;
        a_sum += a;
        if(i == n - 1) break;
        v.push_back(a_sum);
    }

    REP(i, v.size()){
        ans = min(abs(a_sum - 2 * v[i]), ans);
    }
    cout << ans << "\n";
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:14: error: 'LLONG_MAX' was not declared in this scope
   33 |     ll ans = LLONG_MAX;
      |              ^~~~~~~~~
a.cc:13:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   12 | #include <algorithm>
  +++ |+#include <climits>
   13 | using namespace std;
Language: Java

import java.util.Scanner;

public class C {
	
	public static int absDifference(int x, int[] cards) {
		int sumx = 0;
		int sumy = 0;
		int n = cards.length;
		
		for (int i = 0; i < x; i++) {
			sumx += cards[i];
		}
		
		for (int i = 0; i < n-x; i++) {
			sumy += cards[n-i-1];
		}
		
		return Math.abs(sumx - sumy);
	}

	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] cards = new int[n];
		
		for (int i = 0; i < n; i++) {
			cards[i] = sc.nextInt();
		}
		
		sc.close();
		
		int ans = 100000000;
		
		for (int i = 1; i < n; i++) {
			int temp = absDifference(i, cards);
			if (temp <= ans) {
				ans = temp; 
			}
		}
		
		System.out.println(ans);
		
		
	}
	
}

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


#include <iostream>
#include <algorithm>
using namespace std;
int main(){
	int N;
	int input,total[200010]={0};
	
	int answer=INT_MAX;
	
	cin >> N;
	for(int i=1;i<=N;i++){
		cin >> input;
		total[i]=total[i-1]+input;
//		cout << total[i] << endl;
	}
	
	for(int i=1;i<N;i++){
		answer=min(int(answer),abs(total[i]-(total[N]-total[i])));
	}
	cout << answer << endl;
	
	return 0;
}

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

//El Lool
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cmath>
#include <iomanip>
#include <algorithm>
#include <fstream>
#include <cctype>
#include <string>
#include <string.h>
#include <vector>
#include <sstream>
#include <queue>
#include <map>
#include <set>
using namespace std;
#define all(v) ((v).begin()),((v).end())
#define sz(v) ((int)((v).size()))
void fast()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
}
string cop(vector<char>v)
{
	string x;
	for (int i = 0; i < sz(v); i++)
		x += v[i];
	return x;
}
 
int main()
{
	fast();
	int t, n, w;
	long long sum = 0, min = LONG_MAX;
	vector<long long>v;
	string s;
	t=1;
 
	while (t--)
	{
		cin >> n;
		for (int i = 0; i < n; i++)
		{
			cin >> w;
			sum += w;
			v.push_back(sum);
		}
		for (int i = 0; i < v.size() - 1; i++)
		{
			long long  x = v[i];
			long long y = sum - v[i];
			if (abs(x-y) < min)
				min = abs(x-y);
		}
		cout << min << endl;
		min = 1e18;
		v.clear();
		sum = 0;
	}
	return 0;
 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:34: error: 'LONG_MAX' was not declared in this scope
   37 |         long long sum = 0, min = LONG_MAX;
      |                                  ^~~~~~~~
a.cc:16:1: note: 'LONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   15 | #include <set>
  +++ |+#include <climits>
   16 | using namespace std;
Language: C++

//El Lool
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cmath>
#include <iomanip>
#include <algorithm>
#include <fstream>
#include <cctype>
#include <string>
#include <string.h>
#include <vector>
#include <sstream>
#include <queue>
#include <map>
#include <set>
using namespace std;
#define all(v) ((v).begin()),((v).end())
#define sz(v) ((int)((v).size()))
void fast()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
}
string cop(vector<char>v)
{
	string x;
	for (int i = 0; i < sz(v); i++)
		x += v[i];
	return x;
}

int main()
{
	fast();
	int t, n, w;
	long long sum = 0, min = LONG_MAX;
	vector<long long>v;
	string s;
	t=1

	while (t--)
	{
		cin >> n;
		for (int i = 0; i < n; i++)
		{
			cin >> w;
			sum += w;
			v.push_back(sum);
		}
		for (int i = 0; i < v.size() - 1; i++)
		{
			long long  x = v[i];
			long long y = sum - v[i];
			if (abs(x-y) < min)
				min = abs(x-y);
		}
		cout << min << endl;
		min = 1e18;
		v.clear();
		sum = 0;
	}
	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:34: error: 'LONG_MAX' was not declared in this scope
   37 |         long long sum = 0, min = LONG_MAX;
      |                                  ^~~~~~~~
a.cc:16:1: note: 'LONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   15 | #include <set>
  +++ |+#include <climits>
   16 | using namespace std;
a.cc:40:12: error: expected ';' before 'while'
   40 |         t=1
      |            ^
      |            ;
   41 | 
   42 |         while (t--)
      |         ~~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main () {
	int n;
	cin >> n;
	long long a[200005];
	for (int i=1;i<=n;i++) cin >> a[i];
	long long sum=0;
	for (int i=1;i<=n;i++) {
		sum+=a[i];
	}
	a[0]=0;
	for (int i=1;i<=n;i++) {
		a[i]+=a[i-1];
	}
	int ans=2000000007;
	for (int i=1;i<n;i++) {
		ans=min(ans,abs(a[i]-(sum-a[i])));
	}
	cout << ans << endl;
	return 0;
}

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

#include <cstdio>
#define LL long long
#define INF 0x3f3f3f3f3f
int cards[200005];
int n;
LL sum_all;
LL sum;

LL abs(LL x){
  if(x < 0) x = -x;
  return x;
}
int main(){
  scanf("%d", &n);
  for(int i = 0; i < n; i++){
    scanf("%d", &(cards[i]));
  }
  
  sum_all = 0;
  for(int i = 0 ; i < n; i++){
    sum_all += cards[i];
  }
  sum = 0;
  LL take = 0; LL min = INF; LL min_take;
  for(int i = 0; i < n; i++){
    LL diff = abs( sum_all - sum - sum);
    if( min > diff ){
      min = diff;
      min_take = take;
    }
    sum += cards[i];
    take ++;
  }
  LL diff = abs( sum_all  -

Compiler output:
a.cc: In function 'int main()':
a.cc:34:28: error: expected primary-expression at end of input
   34 |   LL diff = abs( sum_all  -
      |                            ^
a.cc:34:28: error: expected '}' at end of input
a.cc:13:11: note: to match this '{'
   13 | int main(){
      |           ^
Language: C++

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

int main(){
  int N, su_sum, ta_sum;
  cin >> N;

  vector<int> a(N), dif(N-1);
  for(int i = 0; i < N; i++) cin >> a[i];

  /*/
  すぬけの引く数を1〜Nまで変化させて、そのときのx-yを記録
  記録した配列をソートして、最小値を出力
  /*/

  //1〜Nまで変化させるループ(iで進める)
  for(int i = 0; i < N-1; i++){
    su_sum = 0;
    ta_sum = 0;

    //すぬけの合計値(0~iまで)を求めるためのループ
    for(int j = 0; j < i+1; j++){
      su_sum += a[j];
    }
    //たぬきの合計値(i+1 ~ N-1まで)を求めるループ
    for(int j = i+1; j < N; j++){
      ta_sum += a[j];
    }
    //x-yを格納
    dif[i] = abs(su_sum - ta_sum);
  }

  sort(dif.begin(),dif.end());
  cout << dif[0] << endl;

  return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:3: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   35 |   sort(dif.begin(),dif.end());
      |   ^~~~
      |   sqrt
Language: C++

#include <iostream>
#include <cstdio>

using namespace std;

vector<int> v;

#define pb push_back

int main()
{
        int N; cin >> N;
        for(int i = 0; i < N; i++) cin >> v[i];

        int min = 2e5;

        for(int i = 1; i < N; i++)
        {
                if(abs(v[i] - v[i-1]) < min) min = abs(v[i] - v[i-1];
        }
        cout << min << endl;
}


Compiler output:
a.cc:6:1: error: 'vector' does not name a type
    6 | vector<int> v;
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:13:43: error: 'v' was not declared in this scope
   13 |         for(int i = 0; i < N; i++) cin >> v[i];
      |                                           ^
a.cc:19:24: error: 'v' was not declared in this scope
   19 |                 if(abs(v[i] - v[i-1]) < min) min = abs(v[i] - v[i-1];
      |                        ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

vector<int> v;

#define pb push_back

int main()
{
        int N; cin >> N;
        for(int i = 0; i < N; i++) cin >> v[i];

        int min = 2e5;

        for(int i = 1; i < N; i++)
        {
                if(abs(v[i] - v[i-1]) < min) min = abs(v[i] - v[i-1];
        }
        cout << min << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:69: error: expected ')' before ';' token
   18 |                 if(abs(v[i] - v[i-1]) < min) min = abs(v[i] - v[i-1];
      |                                                       ~             ^
      |                                                                     )
Language: C++

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<stack>
#include<vector>
#include<algorithm>
long long int abs(long long int a){
    if(a>=0)return a;
    else return -a;
}
#define max 200005
long long int fo[max],re[max],sum[max];

using namespace std;
int main(){
    int n;
    scanf("%d",&n);
    int a[n],i;
    for(i=0;i<=n-1;i++)scanf("%d",&a[i]);
    for(i=0;i<=n-1;i++){
        if(i==0)fo[i]=a[i];
        else fo[i]=fo[i-1]+a[i];
    }
    for(i=n-1;i>=0;i--){
        if(i==n-1)re[i]=-a[i];
        else re[i]=re[i+1]-a[i];
    }
    for(i=0;i<=n-2;i++){
        sum[i]=abs(fo[i]+re[i+1]);
    }
    sort(sum,sum+n-1);
    printf("%lld",sum[0]);
    
    
    return 0;
}


Compiler output:
a.cc:8:34: error: 'long long int abs(long long int)' conflicts with a previous declaration
    8 | long long int abs(long long int a){
      |                                  ^
In file included from /usr/include/c++/14/cstdlib:81,
                 from /usr/include/c++/14/stdlib.h:36,
                 from a.cc:3:
/usr/include/c++/14/bits/std_abs.h:61:3: note: previous declaration 'long long int std::abs(long long int)'
   61 |   abs(long long __x) { return __builtin_llabs (__x); }
      |   ^~~
a.cc: In function 'int main()':
a.cc:30:19: error: call of overloaded 'abs(long long int)' is ambiguous
   30 |         sum[i]=abs(fo[i]+re[i+1]);
      |                ~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/cstdlib:79:
/usr/include/stdlib.h:980:12: note: candidate: 'int abs(int)'
  980 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
      |            ^~~
/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); }
      |   ^~~
a.cc:8:15: note: candidate: 'long long int abs(long long int)'
    8 | long long int abs(long long int a){
      |               ^~~
Language: C

#include<stdio.h>

int main(){
  long long x[100010], sum=0LL;
  long long res, ans=10000000000000LL, a, n;
  int i, j;

  if(scanf("%lld", &n)==1){

    for(i=0; i<n; i++){
      if(scanf("%ld", &a)==1){
	sum+=a;
	if(i==0){
	  x[i]=a;
      }
    }
    
    for(i=0; i<n-1; i++){
      res=sum-2*x[i];
     
      if(res<0){
	res*=-1;
      }
      if(res<ans && i+1<n){
	ans=res;
      }
    }
    
    printf("%lld\n", ans);
  }
  
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:33:1: error: expected declaration or statement at end of input
   33 | }
      | ^
Language: C++

//
//  main.cpp
//  CODE 2
//
//  Created by Parsa Mrezaei on 7/13/17.
//  Copyright © 2017 Parsa Mrezaei. All rights reserved.
//

#include <iostream>
#include <set>
#include <vector>
#include <cmath>
#include <string>
#include <algorithm>
#include <unordered_set>
#include <stdio.h>


using namespace std;

const int MAXN = 3e5;

int arr[MAXN];
int main () {
    int n; cin >> n;
    long long sum = 0;
    for (int i = 0; i < n; sum += arr[i++])
        cin >> arr[i];
    if (n == 2)
        return cout << abs(arr[0] - arr[1]) << endl, 0;
    long long mn = LLONG_MAX;
    long long sumtilnow = arr[0];
    for (int i = 1; i < n - 1; sumtilnow += arr[i++]) {
        long long now = abs(sum - sumtilnow);
        cout << i << " " << sumtilnow << " " << now << endl;
        mn = min(mn, abs(sumtilnow - now));
    }
    cout << mn << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:20: error: 'LLONG_MAX' was not declared in this scope
   31 |     long long mn = LLONG_MAX;
      |                    ^~~~~~~~~
a.cc:16:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   15 | #include <unordered_set>
  +++ |+#include <climits>
   16 | #include <stdio.h>
Language: C++

#include<iostream>
using namespace std;int main(){long long int a[200000],mini=100000000000,n,sum1=0,sum2=0;cin>>n;for(int i=0;i<n;i++){cin>>a[i];sum1+=a[i];
	for(int i=n-1;0<i;i--){sum1-=a[i];sum2+=a[i];if(abs(sum1-sum2)<mini){mini=abs(sum1-sum2);}}cout<<mini<<endl;return 0;}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:127: error: expected '}' at end of input
    3 |         for(int i=n-1;0<i;i--){sum1-=a[i];sum2+=a[i];if(abs(sum1-sum2)<mini){mini=abs(sum1-sum2);}}cout<<mini<<endl;return 0;}
      |                                                                                                                               ^
a.cc:2:31: note: to match this '{'
    2 | using namespace std;int main(){long long int a[200000],mini=100000000000,n,sum1=0,sum2=0;cin>>n;for(int i=0;i<n;i++){cin>>a[i];sum1+=a[i];
      |                               ^
Language: C++

#include<iostream>
using namespace std;int main(){long long int a[200000],mini=100000000000,n,sum1=0,sum2=0;cin>>n;for(int i=0;i<n;i++){cin>>a[i];sum1+=a[i];for(int i=n-1;0<i;i--){sum1-=a[i];sum2+=a[i];if(abs(sum1-sum2)<mini){mini=abs(sum1-sum2);}}cout<<mini<<endl;return 0;}

Compiler output:
a.cc: In function 'int main()':
a.cc:2:257: error: expected '}' at end of input
    2 | using namespace std;int main(){long long int a[200000],mini=100000000000,n,sum1=0,sum2=0;cin>>n;for(int i=0;i<n;i++){cin>>a[i];sum1+=a[i];for(int i=n-1;0<i;i--){sum1-=a[i];sum2+=a[i];if(abs(sum1-sum2)<mini){mini=abs(sum1-sum2);}}cout<<mini<<endl;return 0;}
      |                               ~                                                                                                                                                                                                                                 ^
Language: C++

#define inf 1000000000UL
#define v_all v.begin(),v.end()
#define vi vector<long long>
#define ll long long

#include<cstdlib> //abs()
#include<algorithm>
#include<vector>
#include<iostream>

using namespace std;

int main(){
	ll n;
	cin>>n;
	vi v(n);
	ll max=0;
	for(int i=0;i<n;i++){
		cin>>v[i];
		max+=v[i];
	}
	ll ans=inf;
	ll m[n]={0};
	auto add=[&v,&m](int x){
		ll ans=0;
		if(m[x-1]==0){
			for(int i=0;i<x;i++){
			ans+=v[i];
			//cout<<"ans in 1:"<<ans<<"x:"<<x<<endl;
			}
			m[x]=ans;
		}else{
			ans=v[x-1]+m[x-1];
			//cout<<"ans in 2:"<<ans<<"x:"<<x<<endl;
			m[x]=ans;
		}
		return ans;
	};
	//sort(v_all);
	for(int i=1;i<n;i++){
		ans= min(abs(max-add(i)*2),ans);
		//cout<<"i"<<i<<endl;
	}
	cout<<ans<<endl;
	return 0;
}#define inf 1000000000UL
#define v_all v.begin(),v.end()
#define vi vector<long long>
#define ll long long

#include<cstdlib> //abs()
#include<algorithm>
#include<vector>
#include<iostream>

using namespace std;

int main(){
	ll n;
	cin>>n;
	vi v(n);
	ll max=0;
	for(int i=0;i<n;i++){
		cin>>v[i];
		max+=v[i];
	}
	ll ans=inf;
	ll m[n]={0};
	auto add=[&v,&m](int x){
		ll ans=0;
		if(m[x-1]==0){
			for(int i=0;i<x;i++){
			ans+=v[i];
			//cout<<"ans in 1:"<<ans<<"x:"<<x<<endl;
			}
			m[x]=ans;
		}else{
			ans=v[x-1]+m[x-1];
			//cout<<"ans in 2:"<<ans<<"x:"<<x<<endl;
			m[x]=ans;
		}
		return ans;
	};
	//sort(v_all);
	for(int i=1;i<n;i++){
		ans= min(abs(max-add(i)*2),ans);
		//cout<<"i"<<i<<endl;
	}
	cout<<ans<<endl;
	return 0;
}

Compiler output:
a.cc:46:2: error: stray '#' in program
   46 | }#define inf 1000000000UL
      |  ^
a.cc:46:3: error: 'define' does not name a type
   46 | }#define inf 1000000000UL
      |   ^~~~~~
a.cc:58:5: error: redefinition of 'int main()'
   58 | int main(){
      |     ^~~~
a.cc:13:5: note: 'int main()' previously defined here
   13 | int main(){
      |     ^~~~
Language: C++

    #include <stdio.h>
        #include <stdlib.h>
         
        int main(void){
        	int n;
        	scanf("%d",&n);
        	double c[n];
        	scanf("%d",&c[0]);
        	double sum = 0;
        	for (int i = 1 ; i<n ; i++){
        		scanf("%d",&c[i]);
        		sum += c[i];
        	}
        	double sa = sum - c[0];
        	double min = fabs(sa);
        	 for (int i = 1; i< n-1;i++){
        	 	sa -= c[i]*2;
        	 	if (min > fabs(sa)){
        	 		min = fabs(sa);
        	 	}
        	 }
        	 printf("%0.lf\n",min);
        	return (0);
        }

Compiler output:
a.cc: In function 'int main()':
a.cc:15:30: error: 'fabs' was not declared in this scope; did you mean 'labs'?
   15 |                 double min = fabs(sa);
      |                              ^~~~
      |                              labs
Language: C++

#include<iostream>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<math.h>
#include<string.h>
#include<algorithm>
#define maxn 200005
#define ll long long
using namespace std;
vector<int>num;
int cmp(int a,int b)
{
	if(abs(a)>=abs(b))
	return 1;
	return 0;
}
int used[maxn];
int main()
{
	int n,tmp;
	ll ans;
	while(scanf("%d",&n)!=EOF)
	{
		num.clear();
		ans=0;
		if(n==)
		while(n--)
		{
			cin>>tmp;
			num.push_back(tmp);
		}
		
		sort(num.begin(),num.end(),cmp);
		int len=num.size();
		for(int i=0;i<len;i++)
		{
			if(ans>=0&&num[i]>=0||(ans<0&&num[i]<0))
			ans-=num[i];
			else ans+=num[i];
		}
		if(ans>=0)cout<<ans<<endl;
		else cout<<-ans<<endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:23: error: expected primary-expression before ')' token
   28 |                 if(n==)
      |                       ^
Language: C++

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;

typedef long long LL;
LL num;
int n;
LL a[200005];
LL q[200005];

int main()
{
	while(~scanf("%d",&n)){
	LL sum = 0;
	LL ans = 1LL << 60;
	LL fir,sec;
	for(int i = 1;i <= n;i++){
		scanf("%I64d",&a[i]);
		sum += a[i];
		q[i] = q[i-1] + a[i];
	}
	if(n == 2)printf("%I64d\n",abs(a[1] - a[2]));
else{
	for(int i = 1;i < n;i++)
	{
	 	fir = q[i];
		sec = sum - q[i];
		num = abs(fir - sec);
		ans = min(ans,num);
	}
	printf("%I64d\n",ans);
}
	memset(a,0,sizeof(a));
	memset(q,0,sizeof(q));
}
}#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;

typedef long long LL;
LL num;
int n;
LL a[200005];
LL q[200005];

int main()
{
	while(~scanf("%d",&n)){
	LL sum = 0;
	LL ans = 1LL << 60;
	LL fir,sec;
	for(int i = 1;i <= n;i++){
		scanf("%I64d",&a[i]);
		sum += a[i];
		q[i] = q[i-1] + a[i];
	}
	if(n == 2)printf("%I64d\n",abs(a[1] - a[2]));
else{
	for(int i = 1;i < n;i++)
	{
	 	fir = q[i];
		sec = sum - q[i];
		num = abs(fir - sec);
		ans = min(ans,num);
	}
	printf("%I64d\n",ans);
}
	memset(a,0,sizeof(a));
	memset(q,0,sizeof(q));
}
}

Compiler output:
a.cc:39:2: error: stray '#' in program
   39 | }#include<cstdio>
      |  ^
a.cc:39:3: error: 'include' does not name a type
   39 | }#include<cstdio>
      |   ^~~~~~~
a.cc:47:4: error: redefinition of 'LL num'
   47 | LL num;
      |    ^~~
a.cc:9:4: note: 'LL num' previously declared here
    9 | LL num;
      |    ^~~
a.cc:48:5: error: redefinition of 'int n'
   48 | int n;
      |     ^
a.cc:10:5: note: 'int n' previously declared here
   10 | int n;
      |     ^
a.cc:49:4: error: redefinition of 'LL a [200005]'
   49 | LL a[200005];
      |    ^
a.cc:11:4: note: 'LL a [200005]' previously declared here
   11 | LL a[200005];
      |    ^
a.cc:50:4: error: redefinition of 'LL q [200005]'
   50 | LL q[200005];
      |    ^
a.cc:12:4: note: 'LL q [200005]' previously declared here
   12 | LL q[200005];
      |    ^
a.cc:52:5: error: redefinition of 'int main()'
   52 | int main()
      |     ^~~~
a.cc:14:5: note: 'int main()' previously defined here
   14 | int main()
      |     ^~~~
Language: Java

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int[] a = new int[n];
            long sum = 0;
            for (int i = 0; i < n; ++i) {
                a[i] = in.nextInt();
                sum += a[i];
            }
            long tmp = 0, res = Integer.MAX_VALUE;
            for (int i = n - 1; i >= 1; --i) {
                tmp += a[i];
                long curSum = sum - tmp;
                res = Math.min(res, Math.abs(curSum - tmp));
            }
            out.println(res);
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            

Compiler output:
Main.java:66: error: reached end of file while parsing
        public int nextInt() {
                              ^
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int N;
    cin >> N;
    vector <long long int> cards (N);
    long long int sum = 0;
    long long int ans = LONG_MAX;
    for(int i = 0; i < N; i++){
        long long int z;
        cin >> z;
        if(i==0){
            cards[i] = z;
        }else{
            cards[i] = (z+cards[i-1]);
        }
        sum = cards[i];
    }
//    cout << sum << "\n";
    for(int i = 0; i < N-1; i++){
        int a = cards[i];
        int b = sum-a;
  //      cout << a << " " << b << "\n";
        ans = min(ans, abs(a-b));
    }
    cout << ans << "\n";
    return 0;
}

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

#include <cstdio>
#include <cstdlib>
#include <climits>
 
long long int absll(long long int g){
	return (g < 0)?g * -1:g;
}
 
int main(){
	int N;
	long long int a[200000];
	long long int sn = 0,al = 0,ans;
	scanf("%d\n",&N);
	for(int i = 0;i < N;i++){
		long long int buf;
		scanf("%lld ",&buf);
		a[i] = buf;
		sn += buf;
	}
	al = a[N - 1];
	sn -= a[N - 1];
	ans = absll(sn - al);
	for(int i = N - 2;i > 0;i--){
		al += a[i];
		sn -= a[i];
		int g = absll(sn - al);
		if(g < ans) ans = g;
	}
	printf("%lld\n",ans);
	return 0;
}

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

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

int main(void){
    int N;
    cin>>N;
    vector<ll> a(N),b(N);
    rep(i,N){
        cin>>a[i];
    }
    rep(i,N-1){
        sum += a[i];
        b[i] = sum;
    }

    ll res = INT_MAX;
    rep(i,N-1){
        res = min(res,abs(sum-2*b[i]));
    }
    cout<<res<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: 'sum' was not declared in this scope
   14 |         sum += a[i];
      |         ^~~
a.cc:20:27: error: 'sum' was not declared in this scope
   20 |         res = min(res,abs(sum-2*b[i]));
      |                           ^~~
Language: Java

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author zhangyong
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n;
            n = in.nextInt();
            int[] arr = new int[n];
            long sum = 0;
            for (int i = 0; i < arr.length; i++) {
                arr[i] = in.nextInt();
                sum += arr[i];
            }
            Arrays.sort(arr);
            long x = 0, min = 1000000000000000000;
            for (int i = 0; i < n; i++) {
                x += arr[i];
                if (i + 1 < n) min = Math.min(min, Math.abs(sum - 2 * x));
            }
            out.println(min);
        }

    }
}



Compiler output:
Main.java:36: error: integer number too large
            long x = 0, min = 1000000000000000000;
                              ^
1 error
Language: Java

#include <iostream>
#include <vector>
#include <numeric>
#include <climits>
using namespace std;
 
int main() {
	int n;
	cin >> n;
	vector<int> v;
	for (int i=0; i<n; ++i) {
		int a;
		cin >> a;
		v.push_back(a);
	}
	unsigned long long snuke_ = accumulate(v.begin(), v.end(), 0);
	unsigned long long raccoon = 0;
	unsigned long long res = ULLONG_MAX;
	for (int i=n-1; i>0; --i) {
		int a = v[i];
		snuke_ -= a;
		raccoon += a;
		res = min(res, abs(snuke_-raccoon));
	}
	cout << res << endl;
}

Compiler output:
Main.java:1: error: illegal character: '#'
#include <iostream>
^
Main.java:2: error: illegal character: '#'
#include <vector>
^
Main.java:3: error: illegal character: '#'
#include <numeric>
^
Main.java:4: error: illegal character: '#'
#include <climits>
^
Main.java:9: error: not a statement
	cin >> n;
	    ^
Main.java:13: error: not a statement
		cin >> a;
		    ^
Main.java:16: error: not a statement
	unsigned long long snuke_ = accumulate(v.begin(), v.end(), 0);
	^
Main.java:16: error: not a statement
	unsigned long long snuke_ = accumulate(v.begin(), v.end(), 0);
	         ^
Main.java:17: error: not a statement
	unsigned long long raccoon = 0;
	^
Main.java:17: error: not a statement
	unsigned long long raccoon = 0;
	         ^
Main.java:18: error: not a statement
	unsigned long long res = ULLONG_MAX;
	^
Main.java:18: error: not a statement
	unsigned long long res = ULLONG_MAX;
	         ^
Main.java:25: error: not a statement
	cout << res << endl;
	            ^
Main.java:7: error: unnamed classes are a preview feature and are disabled by default.
int main() {
^
  (use --enable-preview to enable unnamed classes)
Main.java:16: error: ';' expected
	unsigned long long snuke_ = accumulate(v.begin(), v.end(), 0);
	        ^
Main.java:16: error: ';' expected
	unsigned long long snuke_ = accumulate(v.begin(), v.end(), 0);
	             ^
Main.java:17: error: ';' expected
	unsigned long long raccoon = 0;
	        ^
Main.java:17: error: ';' expected
	unsigned long long raccoon = 0;
	             ^
Main.java:18: error: ';' expected
	unsigned long long res = ULLONG_MAX;
	        ^
Main.java:18: error: ';' expected
	unsigned long long res = ULLONG_MAX;
	             ^
20 errors