Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int n;
  cin >> n;
  vector<ll> a(n+1),b(n);
  for(int i = 0; i < n+1; i++){
    cin >> a[i];
  }
  for(int i = 0; i < n; i++){
    cin >> b[i];
  }
  ll monster = 0;
  for(int i = 0; i < n; i++){
    if(a[i] + a[i+1] <= b[i]){//オーバーキル                                    
      monster += (a[i]+a[i+1]);
      a[i+1] = 0;
    }
 
    else if(a[i] <= b[i]){//i番目のモンスターを全滅させる                       
      monster += b[i];
      a[i+1] -= b[i] - a[i];
    }
 
    else{
      monster += b[i];
    }
  }
    cout << monster << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: 'll' was not declared in this scope
    7 |   vector<ll> a(n+1),b(n);
      |          ^~
a.cc:7:12: error: template argument 1 is invalid
    7 |   vector<ll> a(n+1),b(n);
      |            ^
a.cc:7:12: error: template argument 2 is invalid
a.cc:9:13: error: invalid types 'int[int]' for array subscript
    9 |     cin >> a[i];
      |             ^
a.cc:12:13: error: invalid types 'int[int]' for array subscript
   12 |     cin >> b[i];
      |             ^
a.cc:14:5: error: expected ';' before 'monster'
   14 |   ll monster = 0;
      |     ^~~~~~~~
      |     ;
a.cc:16:9: error: invalid types 'int[int]' for array subscript
   16 |     if(a[i] + a[i+1] <= b[i]){//オーバーキル
      |         ^
a.cc:16:16: error: invalid types 'int[int]' for array subscript
   16 |     if(a[i] + a[i+1] <= b[i]){//オーバーキル
      |                ^
a.cc:16:26: error: invalid types 'int[int]' for array subscript
   16 |     if(a[i] + a[i+1] <= b[i]){//オーバーキル
      |                          ^
a.cc:17:7: error: 'monster' was not declared in this scope
   17 |       monster += (a[i]+a[i+1]);
      |       ^~~~~~~
a.cc:17:20: error: invalid types 'int[int]' for array subscript
   17 |       monster += (a[i]+a[i+1]);
      |                    ^
a.cc:17:25: error: invalid types 'int[int]' for array subscript
   17 |       monster += (a[i]+a[i+1]);
      |                         ^
a.cc:18:8: error: invalid types 'int[int]' for array subscript
   18 |       a[i+1] = 0;
      |        ^
a.cc:21:14: error: invalid types 'int[int]' for array subscript
   21 |     else if(a[i] <= b[i]){//i番目のモンスターを全滅させる
      |              ^
a.cc:21:22: error: invalid types 'int[int]' for array subscript
   21 |     else if(a[i] <= b[i]){//i番目のモンスターを全滅させる
      |                      ^
a.cc:22:7: error: 'monster' was not declared in this scope
   22 |       monster += b[i];
      |       ^~~~~~~
a.cc:22:19: error: invalid types 'int[int]' for array subscript
   22 |       monster += b[i];
      |                   ^
a.cc:23:8: error: invalid types 'int[int]' for array subscript
   23 |       a[i+1] -= b[i] - a[i];
      |        ^
a.cc:23:18: error: invalid types 'int[int]' for array subscript
   23 |       a[i+1] -= b[i] - a[i];
      |                  ^
a.cc:23:25: error: invalid types 'int[int]' for array subscript
   23 |       a[i+1] -= b[i] - a[i];
      |                         ^
a.cc:27:7: error: 'monster' was not declared in this scope
   27 |       monster += b[i];
      |       ^~~~~~~
a.cc:27:19: error: invalid types 'int[int]' for array subscript
   27 |       monster += b[i];
      |                   ^
a.cc:30:13: error: 'monster' was not declared in this scope
   30 |     cout << monster << endl;
      |             ^~~~~~~