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

//D
/*==========================================================*/
/*    Template ver 2017-0401    |   Created by AVM.Martin   */
/* DOMINUS pascit me, et nihil mihi deerit (Psalmorum 23:1) */
/*==========================================================*/
#include<cstdio>
#include<iostream>
#include<cstdlib>
#include<ctime>
#include<cassert>
#include<algorithm>
#include<cmath>

#include<cstring>
#include<string>
#include<cctype>
#include<utility>
#include<vector>
#include<stack>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<list>

typedef long long ll;
typedef std::pair<int,int> pii;
typedef std::pair<ll,ll> pll;
typedef std::vector<int> vi;

const int OO=(int)2e9;
const ll INF=(ll)4e18;
const double EPS=(double)1e-12;

#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define pf push_front
#define pob pop_back
#define pof pop_front

#define INL(i,a,b) ((a<=i)&&(i<=b))
#define EXL(i,a,b) ((a< i)&&(i< b))
#define REPP(i,a,b,c) for(int i=a;i<=b;i+=c)
#define REP(i,a,b) REPP(i,a,b,1)
#define REVV(i,a,b,c) for(int i=a;i>=b;i-=c)
#define REV(i,a,b) REVV(i,a,b,1)
using namespace std;

int n,a,b,sz;
vi dat[100005];
int flag[100005];
priority_queue<int>bfsa,bfsb;
 
int main(){
	//reset
	while(!bfsa.empty())bfsa.pop();
	while(!bfsb.empty())bfsb.pop();
	REP(i,0,100003){
		dat[i].clear();
		flag[i]=0;
	}
	//input
	scanf("%d",&n);
	REP(i,1,n-1){
		scanf("%d %d",&a,&b);
		dat[a].pb(b);
		dat[b].pb(a);
	}
	REP(i,1,n)sort(dat[i].begin(),dat[i].end());
	//bodoh
	puts(n%2==0?"Snuke""Fennec");
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:73:36: error: expected ':' before ')' token
   73 |         puts(n%2==0?"Snuke""Fennec");
      |                                    ^
      |                                    :
a.cc:73:36: error: expected primary-expression before ')' token
Language: C++

#include <bits/stdc++.h>

#define ll long long
#define mp make_pair
#define pb push_back
#define f first
#define vi vector<int>
#define vl vector<long long>
#define sz size()
#define x first
#define y second
#define pii pair<int, int>
#define pll pair<ll, ll>
#define ld long double

using namespace std;

vi g[100100];
int n, lvl[100100], s[100100], par[100100];
int F, S;

void dfs(int v, int p, int l) {
	par[v] = p;
	lvl[v] = l;
	s[v] = 1;
	for(int i = 0; i < g[v].sz; i++) {
		int to = g[v][i];
		if(to == p) continue;
		dfs(to, v, l + 1);
		s[v] += s[to];
	}
}

int main() {
	
	cin >> n;
	for(int i = 1, a, b; i < n; i++) {
		cin >> a >> b;
		g[a].pb(b);
		g[b].pb(a);
	}	

	dfs(1, 0, 1);

	int cnt = (lvl[n] - 2 ) /2;

	int cur = n;

	S = s[n];

	for(int i = 0; i < cnt; i++) {
		ans += s[par[cur]] - s[cur];
		cur = par[cur];
	}

	F = n - S;

	cerr << F << " " << S << endl;
	
	if(F > S) {
		cout << "Fennec\n";
	} else {
		cout << "Snuke\n";
	}


	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:52:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   52 |                 ans += s[par[cur]] - s[cur];
      |                 ^~~
      |                 abs
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int N; cin>>N;
  vector<int>A(N);
  vector<int>B(N);
  for(int i=0;i<N;i++){cin>>A[i];B[i]=A[i]+(i!=0? B[i-1]:0);}
  long long ans=100000000000000;
  for(int i=0;i<N-1;i++)ans=min(ans,abs(B[i]*2-B[N-1]));
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:32: error: no matching function for call to 'min(long long int&, int)'
    9 |   for(int i=0;i<N-1;i++)ans=min(ans,abs(B[i]*2-B[N-1]));
      |                             ~~~^~~~~~~~~~~~~~~~~~~~~~~~
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:9:32: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
    9 |   for(int i=0;i<N-1;i++)ans=min(ans,abs(B[i]*2-B[N-1]));
      |                             ~~~^~~~~~~~~~~~~~~~~~~~~~~~
/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:9:32: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
    9 |   for(int i=0;i<N-1;i++)ans=min(ans,abs(B[i]*2-B[N-1]));
      |                             ~~~^~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

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

int main() {
	ios_base::sync_with_stdio(0);cin.tie(0);
	int n;
	cin>>n;
	vector<ll> a(n);
	for(ll& x:a) cin>>x;
	ll sum=accumulate(a.begin(),a.end(),0),pf=0;
	ll res=1e18;
	for(int i=0;i<n-1;++i){
		pf+=a[i];
		res=min(res,abs(2ll*pf-sum));
	}
	cout<<res<<'\n';
}



Compiler output:
a.cc: In function 'int main()':
a.cc:15:24: error: no matching function for call to 'min(int64_t&, long long int)'
   15 |                 res=min(res,abs(2ll*pf-sum));
      |                     ~~~^~~~~~~~~~~~~~~~~~~~~
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:15:24: note:   deduced conflicting types for parameter 'const _Tp' ('long int' and 'long long int')
   15 |                 res=min(res,abs(2ll*pf-sum));
      |                     ~~~^~~~~~~~~~~~~~~~~~~~~
/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:15:24: note:   mismatched types 'std::initializer_list<_Tp>' and 'long int'
   15 |                 res=min(res,abs(2ll*pf-sum));
      |                     ~~~^~~~~~~~~~~~~~~~~~~~~
Language: C++

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

int main() {
	ios_base::sync_with_stdio(0);cin.tie(0);
	int n;
	cin>>n;
	vector<ll> a(n);
	for(ll& x:a) cin>>x;
	ll sum=accumulate(a.begin(),a.end(),0),pf=0;
	ll res=1e18;
	for(int i=0;i<n-1;++i){
		pf+=a[i];
		res=min(res,abs(2LL*pf-sum));
	}
	cout<<res<<'\n';
}



Compiler output:
a.cc: In function 'int main()':
a.cc:15:24: error: no matching function for call to 'min(int64_t&, long long int)'
   15 |                 res=min(res,abs(2LL*pf-sum));
      |                     ~~~^~~~~~~~~~~~~~~~~~~~~
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:15:24: note:   deduced conflicting types for parameter 'const _Tp' ('long int' and 'long long int')
   15 |                 res=min(res,abs(2LL*pf-sum));
      |                     ~~~^~~~~~~~~~~~~~~~~~~~~
/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:15:24: note:   mismatched types 'std::initializer_list<_Tp>' and 'long int'
   15 |                 res=min(res,abs(2LL*pf-sum));
      |                     ~~~^~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define int long long
#define ll long long
#define vi vector<int>
#define pii pair<int,int>
#define F first
#define S second
#define pb push_back
#define forn(b) for(int i = 0; i < b; i++)
#define rforn(b) for(int i = b - 1 ;i >= 0; i--)
#define It(m) for(auto it = m.begin(); it != m.end(); it++)
#define N 500500
#define PI 3.14159265358979323846264338327950L
#define speed ios_base :: sync_with_stdio(0);cin.tie(0);cout.tie(0);
    
const ll mod = (ll)1e9 + 7;
    
int main() {

    int n; cin >> n;
    vi v(n);
    forn(n) cin >> v[i];
    sort(all(v));
    int mn = INT_MAX;
    for(int i = 1; i < n; i++) {
        mn = min(mn, abs(v[i] - v[i - 1]));
    }
    cout << mn;
 
    return 0;
}


Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include<iostream>
#include<algorithm>
#include<string>
#include<map>//int dx[4]={0,0,-1,1};int dy[4]={-1,1,0,0};
#include<queue>//int gcd(int a,int b){return b?gcd(b,a%b):a;}
#include<vector>
#include<cmath>
#include<stack>
#include<string.h>
#include<stdlib.h>
#include<cstdio>
#define ll long long
#define maxn 100005
#define eps 0.0000001
using namespace std;
#pragma comment(linker, "/STACK:1024000000,1024000000") ///在c++中是防止暴栈用的
 
struct eg
{
    int e,next;
    eg (int x=0,int y=0)
    {
        e=x;
        next=y;
    }
}edge[maxn<<1];
 
int head[maxn];
int tot,a,b;
int d1[maxn],dn[maxn];
 
void init()
{
    memset(d1,0xf,sizeof(d1));
    memset(dn,0xf,sizeof(dn));
    memset(head,-1,sizeof(head));
    tot=0;
}
 
void add_edge(int a,int b)
{
    edge[tot]=eg(b,head[a]);
    head[a]=tot++;
}
 
struct node
{
    int u,d;
    node(int x=0,int y=0)
    {
        u=x;
        d=y;
    }
};
 
void Bfs(int u)
{
    int vis[maxn];
    memset(vis,0,sizeof(vis));
    vis[u]=1;
    if(u==1) d1[u]=0;
    else dn[u]=0;
 
    queue<node> q;
    q.push(node(u,0));
    while(!q.empty())
    {
        node tp=q.front();
        q.pop();
        for(int i=head[tp.u];i!=-1;i=edge[i].next)
        {
            int p=edge[i].e;
            if(vis[p]) continue;
            vis[p]=1;
            if(u==1) d1[p]=min(d1[p],tp.d+1);
            else dn[p]=min(dn[p],tp.d+1);
            q.push(node(p,tp.d+1));
        }
    }
}
 
int main()
{
    init();
    int n;
    scanf("%d",&n);
    for(int i=1;i<n;i++)
    {
        scanf("%d%d",&a,&b);
        add_edge(a,b);
        add_edge(b,a);
    }
    Bfs(n);
    Bfs(1);
 
    ///for(int i=1;i<=n;i++) cout<<d1[i]<<" ";puts("");
    ///for(int i=1;i<=n;i++) cout<<dn[i]<<" ";puts("");
 
    int cnt1=0,cntn=0;
    for(int i=1;i<=n;i++)
    {
        if(d1[i]<=dn[i]) cnt1++;
        else cntn++;
    }
    if(cnt1<=cntn) puts("Snuke");
    else puts("Fennec");
 
    return 0;
}
details/81333376

Compiler output:
a.cc:110:1: error: 'details' does not name a type
  110 | details/81333376
      | ^~~~~~~
Language: C++

#include <iostream>
#include <stack>
#include <climits>
using namespace std;

int abs(int a) {return (a < 0) ? -a : a;}

int main(){
    int N; cin >> N; int a[N];
    long long s[N], t[N], x=0, y=0;
    for (int i = 0; i < N; i++) cin >> a[i];
    for (int i = 0; i < N; i++)
        s[N-i-1] = (x+=a[i]), t[i] = (y+=a[N-i-1]);

    int MIN = INT_MAX;
    for (int i = 1; i < N; i++)
        MIN = min(MIN, abs(t[i-1]-s[i]));

    cout << MIN << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:18: error: no matching function for call to 'min(int&, long long int)'
   17 |         MIN = min(MIN, abs(t[i-1]-s[i]));
      |               ~~~^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: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:17:18: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   17 |         MIN = min(MIN, abs(t[i-1]-s[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
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int a;
  int b[256],d=0;
  cin>>a;
  for(int i=0;i<a;i++){
    cin>>b[i];
  }
  sort(b,b+n);
  if(a==2){
    d=a/2;
  }
  else{
    d=a/2+1;
  }
  c+=(b.begin(),b[d]);
  cout<<c<<'\n';
  
    
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:10:12: error: 'n' was not declared in this scope
   10 |   sort(b,b+n);
      |            ^
a.cc:17:3: error: 'c' was not declared in this scope
   17 |   c+=(b.begin(),b[d]);
      |   ^
a.cc:17:9: error: request for member 'begin' in 'b', which is of non-class type 'int [256]'
   17 |   c+=(b.begin(),b[d]);
      |         ^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int a,c=0,d=0,x=1;
  int q,w;
  int b[1000000];
  int z[1000000];
  cin>>a;
 for(int i=0;i<1000000;i++){
   z[i]=10000000;
 }
  for(int i=0;i<a;i++){
    cin>>b[i];
    d+=b[i];
  }
  sort(b,b+a);
     c=b[0];
     d+=b[a-1];
  }
  z[0]=abs(c-d);
  for(int i=1;i<a-1;i++){
    q=c,w=d;
    c+=b[i];
    d-=b[i];
    z[x]=abs(c-d);
    x++;
  }
  sort(z,z+a+1);
  cout<<z[0]<<"\n";
}


Compiler output:
a.cc:20:3: error: 'z' does not name a type
   20 |   z[0]=abs(c-d);
      |   ^
a.cc:21:3: error: expected unqualified-id before 'for'
   21 |   for(int i=1;i<a-1;i++){
      |   ^~~
a.cc:21:15: error: 'i' does not name a type
   21 |   for(int i=1;i<a-1;i++){
      |               ^
a.cc:21:21: error: 'i' does not name a type
   21 |   for(int i=1;i<a-1;i++){
      |                     ^
a.cc:28:7: error: expected constructor, destructor, or type conversion before '(' token
   28 |   sort(z,z+a+1);
      |       ^
a.cc:29:3: error: 'cout' does not name a type
   29 |   cout<<z[0]<<"\n";
      |   ^~~~
a.cc:30:1: error: expected declaration before '}' token
   30 | }
      | ^
Language: C++

#include <iostream>
#include <bits/stdc++.h>
using namespace std;
const int maxn=1<<18;
int n;
vector<int> e[maxn];
int cnt[maxn];
vector <int> vct;
int frst;
void dfs(int v,int pr){
	cnt[v]=1;
	vct.push_back(v);
	if(v==n-1){
		frst=vct[((int)vct.size()+1)/2];
	}
	for(int j=0;j<e[v].size();j++){
		if(e[v][j]==pr)	continue;
		dfs(e[v][j],v);
		cnt[v]+=cnt[e[v][j]];
	}
	vct.pop_back();
}
int mian(){
	while(scanf("%d",&n)==1){
		for(int i=0;i<n;i++){
			e[i]=clear();
		}
		for(int i=0;i<n-1;i++){
			int u,v;
			scanf("%d%d",&u,&v);
			--u;--v;
			e[u].push_back(v);
			e[v].push_back(u);
		}
		frst=-1;
		dfs(0,0);
		bool win=cnt[frst]*2<n;
		string ans=win?"Fennec":"Snuke";
		cout<<ans<<endl;
	}
}

Compiler output:
a.cc: In function 'int mian()':
a.cc:26:30: error: 'clear' was not declared in this scope
   26 |                         e[i]=clear();
      |                              ^~~~~
a.cc:41:1: warning: no return statement in function returning non-void [-Wreturn-type]
   41 | }
      | ^
Language: C++

 #include<bits/stdc++.h>
using namespace std;
#define int long long
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
 int wari(int a,int b) {
   if(a%b==0)
     return a/b;
   else
     return a/b+1;
 }
 int keta(int a){
  double b=a;
  b=log10(b);
  int c=b;
  return c+1;
 }
 int souwa(int a){
  return a*(a+1)/2;
 }
 int lcm(int a,int b){
  int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return d*e/f;
    }
  int gcm(int a,int b){
      int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return f;
  }
signed main(){
  int a,e=1000000000;
  cin>>a;
  vector<int> b(a),c(a,0),d(a,0);
  fo(i,a)
    cin>>b[i];
  c[0]=b[0];
  d[0]=b[a-1];
  for(int i=1;i<a;i++)
    c[i]=c[i-1]+b[i];
  for(int i=1;i<a;i++)
    d[i]=d[i-1]+b[a-1-i];
  c.pop_back();
  d.pop_back();
  rev(d);
  fo(i,a-1)
    e=min(e,abs(c[i]-d[i]));
  cout<<e<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:71:3: error: 'rev' was not declared in this scope
   71 |   rev(d);
      |   ^~~
Language: C++

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

using namespace std;
#define REP(i,n) FOR(i,0,n)
#define FOR(i,a,b) for(long long i=(a),i##Len_=(b);i<i##Len_;i++)
typedef long long ll;
static const ll MOD = 1000000007;



int main()
{
    ll N;

    cin >> N;

    ll a[N];
    ll x = 0;

    ll tmp = 0;

    ll iMin = INF;

    REP(i,N)
    {
        cin >> a[i];
        tmp += a[i];

    }

    REP(i,N)
    {
        x += a[i];

        iMin = min(iMin,abs(tmp -2*x));

    }

    cout << iMin << endl;

}



Compiler output:
a.cc: In function 'int main()':
a.cc:25:15: error: 'INF' was not declared in this scope
   25 |     ll iMin = INF;
      |               ^~~
Language: C++

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

int main() {
    int N;
    cin >> N;
    vector<long long> A(N);
    for(int i=0; i<N; ++i) {
        cin >> A[i];
        if(i > 0) A[i] += A[i-1];
    }

    int res = 1001001001001001;
    for(int i=0; i+1<N; ++i) {
        res = min(res, abs(A[N-1] - A[i] - A[i]));
    }
    cout << res << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:15: warning: overflow in conversion from 'long int' to 'int' changes value from '1001001001001001' to '-1256873943' [-Woverflow]
   13 |     int res = 1001001001001001;
      |               ^~~~~~~~~~~~~~~~
a.cc:15:18: error: no matching function for call to 'min(int&, long long int)'
   15 |         res = min(res, abs(A[N-1] - A[i] - 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:15:18: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   15 |         res = min(res, abs(A[N-1] - A[i] - 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:15:18: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   15 |         res = min(res, abs(A[N-1] - A[i] - A[i]));
      |               ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>

typedef long long LL;

const int MAXN = 2e5 + 5;

int main()
{
	int N; scanf("%d", &N);
	static LL a[MAXN]; LL sum = 0;
	for (int i = 1; i <= N; i++)
	{
		scanf("%d", &a[i]);
		sum += a[i];
	}
	
	LL pre = a[1], mDif = abs(sum - 2 * a[1]);
	for (int i = 2; i <= N; i++)
	{
		pre += a[i];
		mDif = std::min(mDif, abs(sum - 2 * pre));
	}
	
	printf("%lld\n", mDif);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:32: error: no matching function for call to 'min(LL&, int)'
   21 |                 mDif = std::min(mDif, abs(sum - 2 * pre));
      |                        ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
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:21:32: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   21 |                 mDif = std::min(mDif, abs(sum - 2 * pre));
      |                        ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/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:21:32: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   21 |                 mDif = std::min(mDif, abs(sum - 2 * pre));
      |                        ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<vector>
#include<algorithm>
#include<cmath>
#include<numeric>

using namespace std;
using ll =  long long;
int main(){
    ll n;
    cin>>n;
    
    vector<int>a(n);
    for(auto &e:a)cin>>e;
    
    ll sum=accumulate(a.begin(),a.end(),0);
    ll tmp=0;
    int i=0;
    for(;i<n-1;++i){
        tmp+=a[i];
        if(tmp>sum/2)break;
    }
    if(n==2)cout<<abs(a[1]-a[0]);
    else cout<<abs(a[i-1]-a[i]);
    cout<<endl;
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'cin' was not declared in this scope
   10 |     cin>>n;
      |     ^~~
a.cc:5:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    4 | #include<numeric>
  +++ |+#include <iostream>
    5 | 
a.cc:22:13: error: 'cout' was not declared in this scope
   22 |     if(n==2)cout<<abs(a[1]-a[0]);
      |             ^~~~
a.cc:22:13: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:23:10: error: 'cout' was not declared in this scope
   23 |     else cout<<abs(a[i-1]-a[i]);
      |          ^~~~
a.cc:23:10: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:24:5: error: 'cout' was not declared in this scope
   24 |     cout<<endl;
      |     ^~~~
a.cc:24:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:24:11: error: 'endl' was not declared in this scope
   24 |     cout<<endl;
      |           ^~~~
a.cc:5:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    4 | #include<numeric>
  +++ |+#include <ostream>
    5 |
Language: C++

#include<iosteam>
#include <string.h>
#include <algorithm>
#include<cstdlib>
typedef long long ll;
using namespace std;

int main()
{
    ll n,a[200000],x = 0,y  = 0,lim= 9223372036854775807,ans=0;
    memset(a,0,sizeof(a));
    cin >> n;
    for(int i = 0; i < n; i++)
    {
        cin >> a[i];
        ans += a[i];
    }

    for(int i = 0; i < n-1; i++)
    {
       x += a[i];
       if(abs(ans-2*x) <= lim)
       {
           lim = abs(ans-2*x);
       }
    }

    cout << lim << endl;
}

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

#include <string.h>
#include <algorithm>
#include<cstdlib>
typedef long long ll;
using namespace std;

int main()
{
    ll n,a[200000],x = 0,y  = 0,lim= 9223372036854775807,ans=0;
    memset(a,0,sizeof(a));
    cin >> n;
    for(int i = 0; i < n; i++)
    {
        cin >> a[i];
        ans += a[i];
    }

    for(int i = 0; i < n-1; i++)
    {
       x += a[i];
       if(abs(ans-2*x) <= lim)
       {
           lim = abs(ans-2*x);
       }
    }

    cout << lim << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'cin' was not declared in this scope
   11 |     cin >> n;
      |     ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #include<cstdlib>
  +++ |+#include <iostream>
    4 | typedef long long ll;
a.cc:27:5: error: 'cout' was not declared in this scope
   27 |     cout << lim << endl;
      |     ^~~~
a.cc:27:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:27:20: error: 'endl' was not declared in this scope
   27 |     cout << lim << endl;
      |                    ^~~~
a.cc:4:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    3 | #include<cstdlib>
  +++ |+#include <ostream>
    4 | typedef long long ll;
Language: C++



#include "pch.h"
#include <iostream>
#include <math.h>
#include <vector>    

using namespace std;
int main()
{
	int N; 
	cin >> N;
	vector<int> a(N);
	for (int i = 0;i < N;i++) {
		cin >> a[i];
	}
	int x = 0;int y = N - x;
	int Max = 1000000000;
	for (int i = 1;i < N;i++) {
		int xC = 0;
		int yC = 0;
		x = i;
		for (int j = 0;j < x;j++) {
			xC += a[j];
		}
		for (int k = x;k < y;k++) {
			yC += a[k];
		}
		if (abs(xC - yC) < Max) {
			Max = abs(xC - yC);
		}
	}
	cout << Max << endl;
}


Compiler output:
a.cc:3:10: fatal error: pch.h: No such file or directory
    3 | #include "pch.h"
      |          ^~~~~~~
compilation terminated.
Language: C

#include<iostream>
#include<vector>
#include<string.h>
using namespace std;
#define N 110
vector<int>g[N];
int dis1[N], parent[N];
int n, num;
//work out the distance between each point and first point with dfs
void dfs_dis(int cur, int par){
    int next;
    dis1[cur] = dis1[par] + 1;
    for(int i = 0; i < g[cur].size(); i++){
        next = g[cur][i];
        if(next == par) continue;
        parent[cur] = par;
        dfs_dis(next, cur);
    }
}
void dfs_child(int cur, int par){
    int next;
    num++;
    for(int i = 0;i <g[cur].size(); i++){
        next = g[cur][i];
        if(next == par) continue;
        dfs_child(next, cur);
    }
}
int main(int argc, char const *argv[])
{
    int to, from;
    while(cin>>n){
        //init
        num = 0;
        memset(dis1, 0, sizeof(dis1));
        memset(parent, 0, sizeof(parent));
        for(int i = 0; i < N; i++){
            g[i].clear();
        }
        //read g[N][i]
        for(int i = 0; i < n-1; i++){
            cin>>to>>from;
            g[to].push_back(from);
            g[from].push_back(to);
        }
        //work out dis1[i] dis1[0] = -1, dis1[1] = 0;
        dis1[0] = -1;
        dfs_dis(1, 0);
        //find the middle point between 1 and n
        //how to find a tree?
        int cur = n;
        int par = parent[cur];
        for(int i = 0; i < (dis1[n]-1)/2; i++){
            int t = cur;
            cur = par;
            par = parent[t];
        }
        dfs_child(cur, par);
        if(num > n-num)
            cout<<"Snuke"<<endl;
        else  
            cout<<"Fennec"<<endl;
    } 
    return 0;
}

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

Select Code
#include<stdio.h>
int n;
int list[200001];
long long int abs(long long int x) { return x<0 ? -x : x; }
int main() {
	while (scanf("%d", &n) != EOF) {
		long long int sum = 0;
		for (int i = 0; i<n; i++) {
			scanf("%d", &list[i]);
			sum += list[i];
		}
		long long int sumi = 0;
		long long int ans =1e18;
		for (int i = 0; i<n-1; i++) {
			sumi += list[i];
			long long int tmp = abs(sum - 2 * sumi);
			if (tmp<ans)  ans = tmp;
		}
		printf("%I64d\n", ans);
	}
	return 0;
}

Compiler output:
a.cc:1:1: error: 'Select' does not name a type
    1 | Select Code
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:7:16: error: 'scanf' was not declared in this scope
    7 |         while (scanf("%d", &n) != EOF) {
      |                ^~~~~
a.cc:20:17: error: 'printf' was not declared in this scope
   20 |                 printf("%I64d\n", ans);
      |                 ^~~~~~
a.cc:3:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    2 | #include<stdio.h>
  +++ |+#include <cstdio>
    3 | int n;
Language: C++

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

int main()
{
       long long N;
       long long Sum_t[200000]={0};

       cin>>N;
       cin>>Sum_t[0];
       for(int i=1;i<N;i++)
       {
             cin>>Sum_t[i];
             Sum_t[i]=Sum_t[i-1]+Sum_t[i];
        }

       long long min=abs(Sum[N-1]-2*Sum[0]);
        for(int i=0;i<N;i++)
        {
                long long temp=abs(Sum[N-1]-2*Sum[i]);
                if(temp<min) min=temp;
         }
   
        cout<<min;
        return 0;
}






Compiler output:
a.cc: In function 'int main()':
a.cc:18:26: error: 'Sum' was not declared in this scope; did you mean 'Sum_t'?
   18 |        long long min=abs(Sum[N-1]-2*Sum[0]);
      |                          ^~~
      |                          Sum_t
Language: C

#include<stdio.h>
#include<math.h>
int main()
{
    long long int s1,s2=0,min,x;
    int N,i,p=1;
    scanf("%d",&N);
    long long int a[N];
    for(i=0;i<N;i++)
    {
        scanf("%lld",&a[i]);
    }
    s1=a[0];
    for(i=1;i<N;i++)
    {
        s2=s2+a[i];
    }
    min=llabs(s2-s1);
    for(p=1;p<N-1;p++){
    s1=s1+[p];
    s2=s2-a[p];
    x=llabs(s2-s1);
    if(x<min)
        min=x;
    }
    printf("%lld",min);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:18:9: error: implicit declaration of function 'llabs' [-Wimplicit-function-declaration]
   18 |     min=llabs(s2-s1);
      |         ^~~~~
main.c:3:1: note: include '<stdlib.h>' or provide a declaration of 'llabs'
    2 | #include<math.h>
  +++ |+#include <stdlib.h>
    3 | int main()
main.c:18:9: warning: incompatible implicit declaration of built-in function 'llabs' [-Wbuiltin-declaration-mismatch]
   18 |     min=llabs(s2-s1);
      |         ^~~~~
main.c:18:9: note: include '<stdlib.h>' or provide a declaration of 'llabs'
main.c:20:11: error: expected expression before '[' token
   20 |     s1=s1+[p];
      |           ^
Language: C++

#include<iostream>
#include<cmath>
using namespace std;
const long long size=2e+5;
	long long a[size],x[size];
	long long n,s;
int main()
{	
	cin>>n>>a[0];
     x[0]=a[0];
	 s=a[0]; 
	for(int i=1;i<n;i++)
	{
		cin>>a[i];
	    x[i]=x[i-1]+a[i];
	    s+=a[i];
	}
	long long min=2e+10,result;
	for(int i=0;i<n-1;i++)
	{
	result=abs(2*x[i]-s);
	if(min>result)
	min=result;
	}
	cout<<min;
	return 0;
	

Compiler output:
a.cc:5:21: error: reference to 'size' is ambiguous
    5 |         long long a[size],x[size];
      |                     ^~~~
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:4:17: note:                 'const long long int size'
    4 | const long long size=2e+5;
      |                 ^~~~
a.cc:5:29: error: reference to 'size' is ambiguous
    5 |         long long a[size],x[size];
      |                             ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:4:17: note:                 'const long long int size'
    4 | const long long size=2e+5;
      |                 ^~~~
a.cc: In function 'int main()':
a.cc:9:17: error: 'a' was not declared in this scope
    9 |         cin>>n>>a[0];
      |                 ^
a.cc:10:6: error: 'x' was not declared in this scope
   10 |      x[0]=a[0];
      |      ^
a.cc:26:18: error: expected '}' at end of input
   26 |         return 0;
      |                  ^
a.cc:8:1: note: to match this '{'
    8 | {
      | ^
Language: C++

#include <iostream>
#include<cmath> 
using namespace std ;
int sum(int a , int t[] ,int e)
{int sum=0,j;
for(j=a;j<e;++j)
sum+=t[j];
return sum;
} 
int main()
{
 int N,i,b;
cin>>N;
int *a= new int g [N];
for(i=0;i<N;++i)
cin>>a[i];
for(i=0;i<N-1;++i)
if(b>abs(sum(0,a,i+1)-sum(i+1,a,N))||i==0)
b=abs(sum(0,a,i+1)-sum(i+1,a,N));
cout<<b;
delete [] a;
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: expected ',' or ';' before 'g'
   14 | int *a= new int g [N];
      |                 ^
Language: C++

#include<stdio.h>
#include<stdlib.h>
#include<windows.h>
#include<windef.h>
#define N 2*100000
long long a[N];
long long sum[N + 200];
long long Min =1e9;
int main() {
	long long n, m;
	scanf("%lld", &n);
	sum[0] = 0;
	for (int i = 1; i <= n; i++) {
		scanf("%lld", &a[i]);
		sum[i] = sum[i - 1] + a[i];
	}
	for (int i = 1; i <= n - 1; i++) {
		Min = min(abs(sum[i] - (sum[n] - sum[i])), Min);
	}
	printf("%lld\n", Min);
	return 0;
}

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

#include<stdio.h>
#include<stdlib.h>
#include<windows.h>
#include<windef.h>
#define N 2*100000
long long a[N];
long long sum[N + 200];
long long Min =1e9;
int main() {
	long long n, m;
	scanf("%lld", &n);
	sum[0] = 0;
	for (int i = 1; i <= n; i++) {
		scanf("%lld", &a[i]);
		sum[i] = sum[i - 1] + a[i];
	}
	for (int i = 1; i <= n - 1; i++) {
		Min = min(abs(sum[i] - (sum[n] - sum[i])), Min);
	}
	printf("%lld\n", Min);
	return 0;
}

Compiler output:
main.c:3:9: fatal error: windows.h: No such file or directory
    3 | #include<windows.h>
      |         ^~~~~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<Windows.h>
#include<windef.h>
#define N 2*100000
long long a[N];
long long sum[N + 200];
long long Min =1e9;
int main() {
	long long n, m;
	scanf("%lld", &n);
	sum[0] = 0;
	for (int i = 1; i <= n; i++) {
		scanf("%lld", &a[i]);
		sum[i] = sum[i - 1] + a[i];
	}
	for (int i = 1; i <= n - 1; i++) {
		Min = min(abs(sum[i] - (sum[n] - sum[i])), Min);
	}
	printf("%lld\n", Min);
	return 0;
}

Compiler output:
main.c:3:9: fatal error: Windows.h: No such file or directory
    3 | #include<Windows.h>
      |         ^~~~~~~~~~~
compilation terminated.
Language: C

#include<bits/stdc++.h>
#define N 2*100000
long long a[N];
long long sum[N + 200];
long long Min =1e9;
int main() {
	long long n, m;
	scanf("%lld", &n);
	sum[0] = 0;
	for (int i = 1; i <= n; i++) {
		scanf("%lld", &a[i]);
		sum[i] = sum[i - 1] + a[i];
	}
	for (int i = 1; i <= n - 1; i++) {
		Min = min(abs(sum[i] - (sum[n] - sum[i])), Min);
	}
	printf("%lld\n", Min);
	return 0;
}

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

#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#define N 2*100000
long long a[N];
long long sum[N + 200];
long long Min =1e9;
int main() {
	long long n, m;
	scanf("%lld", &n);
	sum[0] = 0;
	for (int i = 1; i <= n; i++) {
		scanf("%lld", &a[i]);
		sum[i] = sum[i - 1] + a[i];
	}
	for (int i = 1; i <= n - 1; i++) {
		Min = min(abs(sum[i] - (sum[n] - sum[i])), Min);
	}
	printf("%lld\n", Min);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:17:23: error: implicit declaration of function 'min'; did you mean 'main'? [-Wimplicit-function-declaration]
   17 |                 Min = min(abs(sum[i] - (sum[n] - sum[i])), Min);
      |                       ^~~
      |                       main
Language: C

#include<stdio.h>
#include<stdlib.h>
#define N 2*100000
long long a[N];
long long sum[N + 200];
long long Min =1e9;
int main() {
	long long n, m;
	scanf("%lld", &n);
	sum[0] = 0;
	for (int i = 1; i <= n; i++) {
		scanf("%lld", &a[i]);
		sum[i] = sum[i - 1] + a[i];
	}
	for (int i = 1; i <= n - 1; i++) {
		Min = min(abs(sum[i] - (sum[n] - sum[i])), Min);
	}
	printf("%lld\n", Min);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:16:23: error: implicit declaration of function 'min'; did you mean 'main'? [-Wimplicit-function-declaration]
   16 |                 Min = min(abs(sum[i] - (sum[n] - sum[i])), Min);
      |                       ^~~
      |                       main
Language: C

#include<stdio.h>
#include<stdlib.h>
#define N 2*100000
long long a[N];
long long sum[N + 200];
long long Min = _INTEGRAL_MAX_BITS;
int main() {
	long long n, m;
	scanf("%lld", &n);
	sum[0] = 0;
	for (int i = 1; i <= n; i++) {
		scanf("%lld", &a[i]);
		sum[i] = sum[i - 1] + a[i];
	}
	for (int i = 1; i <= n - 1; i++) {
		Min = min(abs(sum[i] - (sum[n] - sum[i])), Min);
	}
	printf("%lld\n", Min);
	return 0;
}

Compiler output:
main.c:6:17: error: '_INTEGRAL_MAX_BITS' undeclared here (not in a function)
    6 | long long Min = _INTEGRAL_MAX_BITS;
      |                 ^~~~~~~~~~~~~~~~~~
main.c: In function 'main':
main.c:16:23: error: implicit declaration of function 'min'; did you mean 'main'? [-Wimplicit-function-declaration]
   16 |                 Min = min(abs(sum[i] - (sum[n] - sum[i])), Min);
      |                       ^~~
      |                       main
Language: C++

#include "iostream"
#include "cmath.h"
#define  MAX 100000;
using namespace std;
int main()
{
    long int n;int idx=0;
    long long int _sum[MAX];
    long long int a[MAX];
    long long int sum=0;
    long long int min=MAX;
    cin>>n;
    for(idx=1;idx<=n;idx++){
        cin>>a[idx];
        _sum[idx]=_sum[idx-1]+a[idx];
        sum+=a[idx];
    }
    for(idx=1;idx<n;idx++){
        min=abs(2*_sum[idx]-sum);
        if(min>abs(2*_sum[idx]-sum))
        min=abs(2*_sum[idx]-sum);
    }
   cout<<min;
   cunt<<endl;
     

    return 0;
}

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

#include "stdio.h"
#include "math.h"
#define MAX 1000000000
int main(){
	long int n;
	long long int min=0;	
	long long int a[MAX];
	long long int _sum[MAX];
	long long int sum=0;
	int idx=0;
	scanf("%ld",&n);
	for(idx=1;idx<=n;idx++){
		scanf("%lld",&a[idx]);	
		sum+=a[idx];
		_sum[idx]=_sum[idx-1]+a[idx];
	}
	for(idx=1;idx<n;idx++){
		min=abs(2*_sum[idx]-sum);
		if(min>abs(2*_sum[idx]-sum))
		min=abs(2*_sum[idx]-sum);
	}
	printf("%lld\n",min);
	return 0;

Compiler output:
main.c: In function 'main':
main.c:18:21: error: implicit declaration of function 'abs' [-Wimplicit-function-declaration]
   18 |                 min=abs(2*_sum[idx]-sum);
      |                     ^~~
main.c:3:1: note: include '<stdlib.h>' or provide a declaration of 'abs'
    2 | #include "math.h"
  +++ |+#include <stdlib.h>
    3 | #define MAX 1000000000
main.c:18:36: warning: 'abs' argument 1 type is 'long long int' where 'int' is expected in a call to built-in function declared without prototype [-Wbuiltin-declaration-mismatch]
   18 |                 min=abs(2*_sum[idx]-sum);
      |                         ~~~~~~~~~~~^~~~
<built-in>: note: built-in 'abs' declared here
main.c:19:39: warning: 'abs' argument 1 type is 'long long int' where 'int' is expected in a call to built-in function declared without prototype [-Wbuiltin-declaration-mismatch]
   19 |                 if(min>abs(2*_sum[idx]-sum))
      |                            ~~~~~~~~~~~^~~~
<built-in>: note: built-in 'abs' declared here
main.c:20:36: warning: 'abs' argument 1 type is 'long long int' where 'int' is expected in a call to built-in function declared without prototype [-Wbuiltin-declaration-mismatch]
   20 |                 min=abs(2*_sum[idx]-sum);
      |                         ~~~~~~~~~~~^~~~
<built-in>: note: built-in 'abs' declared here
main.c:23:9: error: expected declaration or statement at end of input
   23 |         return 0;
      |         ^~~~~~
Language: C++

#include<stdio.h>
#include<malloc.h>
int sum(long int *a, int n, int m)
{
	long int sum = 0;
	for (int i = n; i <= m; i++)
		sum += a[i];
	return sum;
}
int min(long long int *a, int n)
{
	int flag,min=0;
	for (int i = 0; i < n-1; i++)
	{
		if (a[i] > a[i + 1]) min = i + 1;
	}
	return a[min];
}
int main() {
	int n;
	long long *a, sumx, sumy, *m;
	scanf("%d", &n);
	a = (long long int*)malloc(n * sizeof(long long int));
	m = (long long int *)malloc((n - 1) * sizeof(long long int));
	for (int i = 0; i < n; i++)
		scanf("%lld", &a[i]);
	for (int i = 0; i < n-1; i++)
	{
		sumx=sum(a, 0, i);
		sumy = sum(a, i + 1, n - 1);
		m[i] = sumy - sumx<0?-(sumy-sumx):sumy-sumx;
	}
	printf("%lld", min(m, n-1));
	free(a);
	free(m);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:26: error: invalid conversion from 'long long int*' to 'long int*' [-fpermissive]
   29 |                 sumx=sum(a, 0, i);
      |                          ^
      |                          |
      |                          long long int*
a.cc:3:19: note:   initializing argument 1 of 'int sum(long int*, int, int)'
    3 | int sum(long int *a, int n, int m)
      |         ~~~~~~~~~~^
a.cc:30:28: error: invalid conversion from 'long long int*' to 'long int*' [-fpermissive]
   30 |                 sumy = sum(a, i + 1, n - 1);
      |                            ^
      |                            |
      |                            long long int*
a.cc:3:19: note:   initializing argument 1 of 'int sum(long int*, int, int)'
    3 | int sum(long int *a, int n, int m)
      |         ~~~~~~~~~~^
Language: C++

int main()
{
	long size,s,i;
	s=i=0;
	cin>>size;
	long* a=new long[size];
	long* b=new long[size]; 
	for(i=0;i<size;i++)
	{
		cin>>a[i];
		s+=a[i];
		b[i]=s;
	}
	long k=abs(s-b[0]*2);
	for(i=0;i<size-1;i++)
	{
		if(abs(s-b[i]*2)<k)
		{
			k=abs(s-b[i]*2);
		}
	}
	cout<<k;
	delete [] a;
	delete [] b;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'cin' was not declared in this scope
    5 |         cin>>size;
      |         ^~~
a.cc:14:16: error: 'abs' was not declared in this scope
   14 |         long k=abs(s-b[0]*2);
      |                ^~~
a.cc:22:9: error: 'cout' was not declared in this scope
   22 |         cout<<k;
      |         ^~~~
Language: C++

#include<cmath>
using namespace std;

int main()
{
	int N;
	cin >> N;
	int* a = new int[N],sum = 0,sum1 = 0,r1,r;
	for(int i=0;i < N;i++)
	{
	    cin >> a[i];
	    sum = sum + a[i];
	}
	r = abs(sum - 2 * a[1]);
	for(int k = 0;k < N - 1;k++)
	{
		for(int i = 0;i < k + 1;i++)
		    sum1 = sum1 + a[i];
		r1 = abs(sum - 2 * sum1);
		if(r1 < r)
		r = r1;
	}
	cout << r << endl;
	delete []a;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope
    7 |         cin >> N;
      |         ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include<cmath>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:23:9: error: 'cout' was not declared in this scope
   23 |         cout << r << endl;
      |         ^~~~
a.cc:23:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:23:22: error: 'endl' was not declared in this scope
   23 |         cout << r << endl;
      |                      ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include<cmath>
  +++ |+#include <ostream>
    2 | using namespace std;