Language: C++

#include <bits/stdc++.h>
using namespace std;
#define int long long;
const int MAX_N = 100001;

int main()
{
    int N, d, e, f;
    e = 0;
    f = 0;
    int a[MAX_N];
    int b[MAX_N];
    cin >> N;
    for (int i = 0; i < N + 1; i++)
    {
        scanf("%d", &a[i]);
    }
    for (int i = 0; i < N; i++)
    {
        scanf("%d", &b[i]);
    }
    for (int i = 0; i < N; i++)
    {
        d = max(0, b[i] - a[i]);
        a[i + 1] -= d;
        if (a[i + 1] < 0)
        {
            e += a[i + 1];
            a[i + 1] = 0;
        }
    }
    for (int i = 0; i < N; i++)
    {
        f += b[i];
    }
    printf("%d\n", f + e);
    return 0;
}

Compiler output:
a.cc:3:18: error: declaration does not declare anything [-fpermissive]
    3 | #define int long long;
      |                  ^~~~
a.cc:4:7: note: in expansion of macro 'int'
    4 | const int MAX_N = 100001;
      |       ^~~
a.cc:4:11: error: 'MAX_N' does not name a type
    4 | const int MAX_N = 100001;
      |           ^~~~~
a.cc:3:18: error: declaration does not declare anything [-fpermissive]
    3 | #define int long long;
      |                  ^~~~
a.cc:6:1: note: in expansion of macro 'int'
    6 | int main()
      | ^~~
a.cc:6:5: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    6 | int main()
      |     ^~~~
a.cc: In function 'int main()':
a.cc:3:18: error: declaration does not declare anything [-fpermissive]
    3 | #define int long long;
      |                  ^~~~
a.cc:8:5: note: in expansion of macro 'int'
    8 |     int N, d, e, f;
      |     ^~~
a.cc:8:9: error: 'N' was not declared in this scope
    8 |     int N, d, e, f;
      |         ^
a.cc:8:12: error: 'd' was not declared in this scope
    8 |     int N, d, e, f;
      |            ^
a.cc:8:15: error: 'e' was not declared in this scope
    8 |     int N, d, e, f;
      |               ^
a.cc:8:18: error: 'f' was not declared in this scope
    8 |     int N, d, e, f;
      |                  ^
a.cc:3:18: error: declaration does not declare anything [-fpermissive]
    3 | #define int long long;
      |                  ^~~~
a.cc:11:5: note: in expansion of macro 'int'
   11 |     int a[MAX_N];
      |     ^~~
a.cc:11:9: error: 'a' was not declared in this scope
   11 |     int a[MAX_N];
      |         ^
a.cc:11:11: error: 'MAX_N' was not declared in this scope
   11 |     int a[MAX_N];
      |           ^~~~~
a.cc:3:18: error: declaration does not declare anything [-fpermissive]
    3 | #define int long long;
      |                  ^~~~
a.cc:12:5: note: in expansion of macro 'int'
   12 |     int b[MAX_N];
      |     ^~~
a.cc:12:9: error: 'b' was not declared in this scope
   12 |     int b[MAX_N];
      |         ^
a.cc:3:18: error: declaration does not declare anything [-fpermissive]
    3 | #define int long long;
      |                  ^~~~
a.cc:14:10: note: in expansion of macro 'int'
   14 |     for (int i = 0; i < N + 1; i++)
      |          ^~~
a.cc:14:14: error: 'i' was not declared in this scope
   14 |     for (int i = 0; i < N + 1; i++)
      |              ^
a.cc:14:30: error: expected ')' before ';' token
   14 |     for (int i = 0; i < N + 1; i++)
      |         ~                    ^
      |                              )
a.cc:14:32: error: 'i' was not declared in this scope
   14 |     for (int i = 0; i < N + 1; i++)
      |                                ^
a.cc:3:18: error: declaration does not declare anything [-fpermissive]
    3 | #define int long long;
      |                  ^~~~
a.cc:18:10: note: in expansion of macro 'int'
   18 |     for (int i = 0; i < N; i++)
      |          ^~~
a.cc:18:26: error: expected ')' before ';' token
   18 |     for (int i = 0; i < N; i++)
      |         ~                ^
      |                          )
a.cc:3:18: error: declaration does not declare anything [-fpermissive]
    3 | #define int long long;
      |                  ^~~~
a.cc:22:10: note: in expansion of macro 'int'
   22 |     for (int i = 0; i < N; i++)
      |          ^~~
a.cc:22:26: error: expected ')' before ';' token
   22 |     for (int i = 0; i < N; i++)
      |         ~                ^
      |                          )
a.cc:3:18: error: declaration does not declare anything [-fpermissive]
    3 | #define int long long;
      |                  ^~~~
a.cc:32:10: note: in expansion of macro 'int'
   32 |     for (int i = 0; i < N; i++)
      |          ^~~
a.cc:32:26: error: expected ')' before ';' token
   32 |     for (int i = 0; i < N; i++)
      |         ~                ^
      |                          )