Language: C++

#include<bits/stdc++.h>
using  namespace std;
#define endl '\n' 
#define long  long ll;
#define AC ios::sync_with_stdio(false);cin.tie(0);
const ll N=20005;
ll dp[N][2];
ll arr[N];
int main()
{
    AC
    ll n;
    cin >> n;
    for (int i= 1; i<=n; i++) cin>> arr[i];
    dp[2][0]=arr[1];dp[2][1]=arr[2];
    for (int i= 3; i<=n; i++)
    {
        if (i&1)
        {
            dp[i][1]=max({dp[i-2][1],dp[i-2][0],dp[i-3][1],dp[i-3][0]})+ arr[i];
            dp[i][0]=max(dp[i-1][0],dp[i-1][1]);
        }
        else 
        {
            dp[i][1]=max(dp[i-2][1],dp[i-2][0])+ arr[i];
            dp[i][0]=arr[i-1]+dp[i-2][0];
        }
    }
    cout<<max(dp[n][0],dp[n][1])<<'\n';
}

Compiler output:
a.cc:6:7: error: 'll' does not name a type
    6 | const ll N=20005;
      |       ^~
a.cc:7:1: error: 'll' does not name a type
    7 | ll dp[N][2];
      | ^~
a.cc:8:1: error: 'll' does not name a type
    8 | ll arr[N];
      | ^~
a.cc: In function 'int main()':
a.cc:12:5: error: 'll' was not declared in this scope
   12 |     ll n;
      |     ^~
a.cc:13:12: error: 'n' was not declared in this scope; did you mean 'yn'?
   13 |     cin >> n;
      |            ^
      |            yn
a.cc:14:37: error: 'arr' was not declared in this scope
   14 |     for (int i= 1; i<=n; i++) cin>> arr[i];
      |                                     ^~~
a.cc:15:5: error: 'dp' was not declared in this scope; did you mean 'dup'?
   15 |     dp[2][0]=arr[1];dp[2][1]=arr[2];
      |     ^~
      |     dup
a.cc:15:14: error: 'arr' was not declared in this scope
   15 |     dp[2][0]=arr[1];dp[2][1]=arr[2];
      |              ^~~
a.cc:20:25: error: no matching function for call to 'max(<brace-enclosed initializer list>)'
   20 |             dp[i][1]=max({dp[i-2][1],dp[i-2][0],dp[i-3][1],dp[i-3][0]})+ arr[i];
      |                      ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   template argument deduction/substitution failed:
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   candidate expects 2 arguments, 1 provided