Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#typedef long long ll

using namespace std;

int main(){
  int N;
  cin >> N;
  vector<ll> A(N+1);
  vector<ll> B(N+1);
  for(int i = 0; i < N + 1; i++){
    cin >> A.at(i);
  }
  for(int i = 0; i < N; i++){
    cin >> B.at(i);
  }

  ll ans = 0;
  ll tmp = min(A.at(0), B.at(0));
  A.at(0) -= tmp;
  B.at(0) -= tmp;
  ans += tmp;
  for(int i = 1; i < N+1; i++){
    tmp = min(A.at(i), B.at(i-1));
    A.at(i) -= tmp;
    B.at(i-1) -= tmp;
    ans += tmp;
    tmp = min(A.at(i), B.at(i));
    A.at(i) -= tmp;
    B.at(i) -= tmp;
    ans += tmp;
  }
  cout << ans << endl;
}


Compiler output:
a.cc:5:2: error: invalid preprocessing directive #typedef
    5 | #typedef long long ll
      |  ^~~~~~~
a.cc: In function 'int main()':
a.cc:12:10: error: 'll' was not declared in this scope
   12 |   vector<ll> A(N+1);
      |          ^~
a.cc:12:12: error: template argument 1 is invalid
   12 |   vector<ll> A(N+1);
      |            ^
a.cc:12:12: error: template argument 2 is invalid
a.cc:13:12: error: template argument 2 is invalid
   13 |   vector<ll> B(N+1);
      |            ^
a.cc:15:14: error: request for member 'at' in 'A', which is of non-class type 'int'
   15 |     cin >> A.at(i);
      |              ^~
a.cc:18:14: error: request for member 'at' in 'B', which is of non-class type 'int'
   18 |     cin >> B.at(i);
      |              ^~
a.cc:21:5: error: expected ';' before 'ans'
   21 |   ll ans = 0;
      |     ^~~~
      |     ;
a.cc:22:5: error: expected ';' before 'tmp'
   22 |   ll tmp = min(A.at(0), B.at(0));
      |     ^~~~
      |     ;
a.cc:23:5: error: request for member 'at' in 'A', which is of non-class type 'int'
   23 |   A.at(0) -= tmp;
      |     ^~
a.cc:23:14: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   23 |   A.at(0) -= tmp;
      |              ^~~
      |              tm
a.cc:24:5: error: request for member 'at' in 'B', which is of non-class type 'int'
   24 |   B.at(0) -= tmp;
      |     ^~
a.cc:25:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
   25 |   ans += tmp;
      |   ^~~
      |   abs
a.cc:27:17: error: request for member 'at' in 'A', which is of non-class type 'int'
   27 |     tmp = min(A.at(i), B.at(i-1));
      |                 ^~
a.cc:27:26: error: request for member 'at' in 'B', which is of non-class type 'int'
   27 |     tmp = min(A.at(i), B.at(i-1));
      |                          ^~
a.cc:28:7: error: request for member 'at' in 'A', which is of non-class type 'int'
   28 |     A.at(i) -= tmp;
      |       ^~
a.cc:29:7: error: request for member 'at' in 'B', which is of non-class type 'int'
   29 |     B.at(i-1) -= tmp;
      |       ^~
a.cc:31:17: error: request for member 'at' in 'A', which is of non-class type 'int'
   31 |     tmp = min(A.at(i), B.at(i));
      |                 ^~
a.cc:31:26: error: request for member 'at' in 'B', which is of non-class type 'int'
   31 |     tmp = min(A.at(i), B.at(i));
      |                          ^~
a.cc:32:7: error: request for member 'at' in 'A', which is of non-class type 'int'
   32 |     A.at(i) -= tmp;
      |       ^~
a.cc:33:7: error: request for member 'at' in 'B', which is of non-class type 'int'
   33 |     B.at(i) -= tmp;
      |       ^~