Language: C++

#include <stdio.h>
#include <numeric>
#include <algorithm>

int main(){
    int N, A1[100], A2[100];
    scanf("%d", &N);
    for (int i = 0; i < N; ++i) {
        scanf("%d", &A1[i]);
    }
    for (int i = 0; i < N; ++i) {
        scanf("%d", &A2[i]);
    }

    int x[100], ans;
    for (int n = 0; n < N; ++n) {
        x[n] = std::accumulate(std::begin(A1), std::begin(A1) + n + 1, 0)
                + std::accumulate(std::begin(A2) + n, std::begin(A2) + N, 0);
    }
    ans = *std::max_element(std::begin(x), std::begin(x) + N);

    printf("%d\n", ans);

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:42: error: no matching function for call to 'begin(int [100])'
   17 |         x[n] = std::accumulate(std::begin(A1), std::begin(A1) + n + 1, 0)
      |                                ~~~~~~~~~~^~~~
In file included from /usr/include/c++/14/bits/algorithmfwd.h:39,
                 from /usr/include/c++/14/bits/stl_algo.h:59,
                 from /usr/include/c++/14/algorithm:61,
                 from a.cc:3:
/usr/include/c++/14/initializer_list:88:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::begin(initializer_list<_Tp>)'
   88 |     begin(initializer_list<_Tp> __ils) noexcept
      |     ^~~~~
/usr/include/c++/14/initializer_list:88:5: note:   template argument deduction/substitution failed:
a.cc:17:42: note:   mismatched types 'std::initializer_list<_Tp>' and 'int*'
   17 |         x[n] = std::accumulate(std::begin(A1), std::begin(A1) + n + 1, 0)
      |                                ~~~~~~~~~~^~~~
a.cc:17:58: error: no matching function for call to 'begin(int [100])'
   17 |         x[n] = std::accumulate(std::begin(A1), std::begin(A1) + n + 1, 0)
      |                                                ~~~~~~~~~~^~~~
/usr/include/c++/14/initializer_list:88:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::begin(initializer_list<_Tp>)'
   88 |     begin(initializer_list<_Tp> __ils) noexcept
      |     ^~~~~
/usr/include/c++/14/initializer_list:88:5: note:   template argument deduction/substitution failed:
a.cc:17:58: note:   mismatched types 'std::initializer_list<_Tp>' and 'int*'
   17 |         x[n] = std::accumulate(std::begin(A1), std::begin(A1) + n + 1, 0)
      |                                                ~~~~~~~~~~^~~~
a.cc:18:45: error: no matching function for call to 'begin(int [100])'
   18 |                 + std::accumulate(std::begin(A2) + n, std::begin(A2) + N, 0);
      |                                   ~~~~~~~~~~^~~~
/usr/include/c++/14/initializer_list:88:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::begin(initializer_list<_Tp>)'
   88 |     begin(initializer_list<_Tp> __ils) noexcept
      |     ^~~~~
/usr/include/c++/14/initializer_list:88:5: note:   template argument deduction/substitution failed:
a.cc:18:45: note:   mismatched types 'std::initializer_list<_Tp>' and 'int*'
   18 |                 + std::accumulate(std::begin(A2) + n, std::begin(A2) + N, 0);
      |                                   ~~~~~~~~~~^~~~
a.cc:18:65: error: no matching function for call to 'begin(int [100])'
   18 |                 + std::accumulate(std::begin(A2) + n, std::begin(A2) + N, 0);
      |                                                       ~~~~~~~~~~^~~~
/usr/include/c++/14/initializer_list:88:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::begin(initializer_list<_Tp>)'
   88 |     begin(initializer_list<_Tp> __ils) noexcept
      |     ^~~~~
/usr/include/c++/14/initializer_list:88:5: note:   template argument deduction/substitution failed:
a.cc:18:65: note:   mismatched types 'std::initializer_list<_Tp>' and 'int*'
   18 |                 + std::accumulate(std::begin(A2) + n, std::begin(A2) + N, 0);
      |                                                       ~~~~~~~~~~^~~~
a.cc:20:39: error: no matching function for call to 'begin(int [100])'
   20 |     ans = *std::max_element(std::begin(x), std::begin(x) + N);
      |                             ~~~~~~~~~~^~~
/usr/include/c++/14/initializer_list:88:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::begin(initializer_list<_Tp>)'
   88 |     begin(initializer_list<_Tp> __ils) noexcept
      |     ^~~~~
/usr/include/c++/14/initializer_list:88:5: note:   template argument deduction/substitution failed:
a.cc:20:39: note:   mismatched types 'std::initializer_list<_Tp>' and 'int*'
   20 |     ans = *std::max_element(std::begin(x), std::begin(x) + N);
      |                             ~~~~~~~~~~^~~
a.cc:20:54: error: no matching function for call to 'begin(int [100])'
   20 |     ans = *std::max_element(std::begin(x), std::begin(x) + N);
      |                                            ~~~~~~~~~~^~~
/usr/include/c++/14/initializer_list:88:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::begin(initializer_list<_Tp>)'
   88 |     begin(initializer_list<_Tp> __ils) noexcept
      |     ^~~~~
/usr/include/c++/14/initializer_list:88:5: note:   template argument deduction/substitution failed:
a.cc:20:54: note:   mismatched types 'std::initializer_list<_Tp>' and 'int*'
   20 |     ans = *std::max_element(std::begin(x), std::begin(x) + N);
      |                                            ~~~~~~~~~~^~~