Language: C++

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

    vector<ll> a(N);
    for (int i = 0; i < N; i++)
    {
        cin >> a[i];
    }
    vector<ll> b(N);
    b = a;
    reverse(b.begin(), b.end());

    int M = N + 1;
    vector<ll> rui1(M, 0);
    vector<ll> rui2(M, 0);
    for (int i = 0; i < M; ++i)
    {
        rui1[i + 1] = rui1[i] + a[i];
    }
    for (int i = 0; i < M; ++i)
    {
        rui2[i + 1] = rui2[i] + b[i];
    }

    ll diff = LINF;
    ll ans = LINF;
    for (int i = 1; i < N; i++)
    {
        ll num1 = rui1[i];
        ll num2 = rui2[N - i];
        printf("%d - %d\n", num1, num2);
        diff = abs(num1 - num2);
        ans = min(ans, diff);
    }
    cout << ans << "\n";
    return (0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:5: error: 'cin' was not declared in this scope
    4 |     cin >> N;
      |     ^~~
a.cc:6:5: error: 'vector' was not declared in this scope
    6 |     vector<ll> a(N);
      |     ^~~~~~
a.cc:6:12: error: 'll' was not declared in this scope
    6 |     vector<ll> a(N);
      |            ^~
a.cc:6:16: error: 'a' was not declared in this scope
    6 |     vector<ll> a(N);
      |                ^
a.cc:11:16: error: 'b' was not declared in this scope
   11 |     vector<ll> b(N);
      |                ^
a.cc:13:5: error: 'reverse' was not declared in this scope
   13 |     reverse(b.begin(), b.end());
      |     ^~~~~~~
a.cc:16:16: error: 'rui1' was not declared in this scope
   16 |     vector<ll> rui1(M, 0);
      |                ^~~~
a.cc:17:16: error: 'rui2' was not declared in this scope
   17 |     vector<ll> rui2(M, 0);
      |                ^~~~
a.cc:27:7: error: expected ';' before 'diff'
   27 |     ll diff = LINF;
      |       ^~~~~
      |       ;
a.cc:28:7: error: expected ';' before 'ans'
   28 |     ll ans = LINF;
      |       ^~~~
      |       ;
a.cc:31:11: error: expected ';' before 'num1'
   31 |         ll num1 = rui1[i];
      |           ^~~~~
      |           ;
a.cc:32:11: error: expected ';' before 'num2'
   32 |         ll num2 = rui2[N - i];
      |           ^~~~~
      |           ;
a.cc:33:29: error: 'num1' was not declared in this scope
   33 |         printf("%d - %d\n", num1, num2);
      |                             ^~~~
a.cc:33:35: error: 'num2' was not declared in this scope
   33 |         printf("%d - %d\n", num1, num2);
      |                                   ^~~~
a.cc:33:9: error: 'printf' was not declared in this scope
   33 |         printf("%d - %d\n", num1, num2);
      |         ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int main(void)
a.cc:34:9: error: 'diff' was not declared in this scope
   34 |         diff = abs(num1 - num2);
      |         ^~~~
a.cc:34:16: error: 'abs' was not declared in this scope
   34 |         diff = abs(num1 - num2);
      |                ^~~
a.cc:35:9: error: 'ans' was not declared in this scope
   35 |         ans = min(ans, diff);
      |         ^~~
a.cc:35:15: error: 'min' was not declared in this scope; did you mean 'main'?
   35 |         ans = min(ans, diff);
      |               ^~~
      |               main
a.cc:37:5: error: 'cout' was not declared in this scope
   37 |     cout << ans << "\n";
      |     ^~~~
a.cc:37:13: error: 'ans' was not declared in this scope
   37 |     cout << ans << "\n";
      |             ^~~