Language: C++

#include <bits/stdc++.h>

using namespace std;

#define DIM 200009
#define INF 1e11+9
#define amen exit(0)
#define fast ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define pairll pair<long long,long long>
#define fi first
#define se second
#define ld long double
#define MODULO 1000000007

long long i,j,k,l,n,m,res;

long long a[17][17],dp[65537][17];

long long rec(long long mask){
    if(mask==0)return 0;
    if(dp[mask]!=-1)return dp[mask];

    long long res;

    dp[mask]=0;

//    cout<<mask<<' '<<k<<endl;

    for(int i=((mask-1)&mask);;i=((i-1)&mask)){
        res=0;
        for(int j=0;j<n;j++){
            if((mask^i)&(1<<j)){
                for(int kk=j+2;kk<=n;kk++){
                    if((mask^i)&(1<<(kk-1)))res+=a[j+1][kk];
                }
            }
        }
        dp[mask]=max(dp[mask],res+rec(i));
        if(i==0)break;
    }

    return dp[mask];
}

int main()
{
    cin>>n;

    memset(dp,-1,sizeof(dp));

    for(i=1;i<=n;i++){
        for(j=1;j<=n;j++){
            cin>>a[i][j];
        }
    }

    long long res=0;

    for(i=1;i<(1<<n);i++){
        for(j=1;j<=n;j++){
            res=max(res,rec(i));
        }
    }

    cout<<res<<endl;

    return 0;
}


Compiler output:
a.cc: In function 'long long int rec(long long int)':
a.cc:21:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   21 |     if(dp[mask]!=-1)return dp[mask];
      |        ~~~~~~~~^~~~
a.cc:21:35: error: invalid conversion from 'long long int*' to 'long long int' [-fpermissive]
   21 |     if(dp[mask]!=-1)return dp[mask];
      |                            ~~~~~~~^
      |                                   |
      |                                   long long int*
a.cc:25:13: error: incompatible types in assignment of 'int' to 'long long int [17]'
   25 |     dp[mask]=0;
      |     ~~~~~~~~^~
a.cc:38:21: error: no matching function for call to 'max(long long int [17], long long int)'
   38 |         dp[mask]=max(dp[mask],res+rec(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:   template argument deduction/substitution failed:
a.cc:38:21: note:   deduced conflicting types for parameter 'const _Tp' ('long long int [17]' and 'long long int')
   38 |         dp[mask]=max(dp[mask],res+rec(i));
      |                  ~~~^~~~~~~~~~~~~~~~~~~~~
/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, 2 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:   candidate expects 1 argument, 2 provided
/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:   template argument deduction/substitution failed:
a.cc:38:21: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int*'
   38 |         dp[mask]=max(dp[mask],res+rec(i));
      |                  ~~~^~~~~~~~~~~~~~~~~~~~~
a.cc:42:19: error: invalid conversion from 'long long int*' to 'long long int' [-fpermissive]
   42 |     return dp[mask];
      |            ~~~~~~~^
      |                   |
      |                   long long int*