Language: C++

#include"bits/stdc++.h"
using namespace std;
using ll=long long
void solve();
ll sum(ll,ll);

ll n;
vector<ll> a;
vector<ll> s;

int main(){
	solve();
	return 0;
}
void solve(){
	cin >>n;
	a.resize(n+1);
	s.resize(n+1);
	a[0]=0;
	s[0]=a[0];
	for(ll i=1;i<=n;i++){
		cin >>a[i];
		s[i]=s[i-1]+a[i];
	}
	
	ll ans=1e18;
	for(ll i=1;i<n;i++){
		ans=min(ans,abs(sum(1,i)-sum(i+1,n)));
	}
	cout <<ans <<endl;
}

ll sum(ll l,ll r){
	return s[r]-s[l-1];
}

Compiler output:
a.cc:3:15: error: 'long long' specified with 'void'
    3 | using ll=long long
      |               ^~~~
a.cc:4:5: error: expected ';' before 'solve'
    4 | void solve();
      |     ^~~~~~
      |     ;
a.cc:5:1: error: 'll' does not name a type
    5 | ll sum(ll,ll);
      | ^~
a.cc:7:1: error: 'll' does not name a type
    7 | ll n;
      | ^~
a.cc:8:8: error: 'll' was not declared in this scope
    8 | vector<ll> a;
      |        ^~
a.cc:8:10: error: template argument 1 is invalid
    8 | vector<ll> a;
      |          ^
a.cc:8:10: error: template argument 2 is invalid
a.cc:9:8: error: 'll' was not declared in this scope
    9 | vector<ll> s;
      |        ^~
a.cc:9:10: error: template argument 1 is invalid
    9 | vector<ll> s;
      |          ^
a.cc:9:10: error: template argument 2 is invalid
a.cc: In function 'int main()':
a.cc:12:9: error: 'solve' was not declared in this scope
   12 |         solve();
      |         ^~~~~
a.cc: In function 'void solve()':
a.cc:16:15: error: 'n' was not declared in this scope; did you mean 'yn'?
   16 |         cin >>n;
      |               ^
      |               yn
a.cc:17:11: error: request for member 'resize' in 'a', which is of non-class type 'int'
   17 |         a.resize(n+1);
      |           ^~~~~~
a.cc:18:11: error: request for member 'resize' in 's', which is of non-class type 'int'
   18 |         s.resize(n+1);
      |           ^~~~~~
a.cc:19:10: error: invalid types 'int[int]' for array subscript
   19 |         a[0]=0;
      |          ^
a.cc:20:10: error: invalid types 'int[int]' for array subscript
   20 |         s[0]=a[0];
      |          ^
a.cc:20:15: error: invalid types 'int[int]' for array subscript
   20 |         s[0]=a[0];
      |               ^
a.cc:21:13: error: 'll' was not declared in this scope
   21 |         for(ll i=1;i<=n;i++){
      |             ^~
a.cc:21:20: error: 'i' was not declared in this scope
   21 |         for(ll i=1;i<=n;i++){
      |                    ^
a.cc:26:9: error: 'll' was not declared in this scope
   26 |         ll ans=1e18;
      |         ^~
a.cc:27:15: error: expected ';' before 'i'
   27 |         for(ll i=1;i<n;i++){
      |               ^~
      |               ;
a.cc:27:20: error: 'i' was not declared in this scope
   27 |         for(ll i=1;i<n;i++){
      |                    ^
a.cc:28:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   28 |                 ans=min(ans,abs(sum(1,i)-sum(i+1,n)));
      |                 ^~~
      |                 abs
a.cc:28:33: error: 'sum' was not declared in this scope
   28 |                 ans=min(ans,abs(sum(1,i)-sum(i+1,n)));
      |                                 ^~~
a.cc:30:16: error: 'ans' was not declared in this scope; did you mean 'abs'?
   30 |         cout <<ans <<endl;
      |                ^~~
      |                abs
a.cc: At global scope:
a.cc:33:1: error: 'll' does not name a type
   33 | ll sum(ll l,ll r){
      | ^~