Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); ++i)
using namespace std;
long long N,M,X;
long long ans;
int data[12][12];
int cList[12];

void dfs(vector<int> P){
    if(P.size() == N){
        long long now = 0;
        std::vector<long long> AList = std::vector<long long>(M);
        rep(i,N){
            if(P[i] == 0){continue;}
            now += cList[i];
            bool isOk = true;
            rep(j,M){
                AList[j] += data[i][j];
                if(AList[j] < X){
                    isOk = false;
                }
            }
            if(ans == 0 && isOk){ans = now;}
            if(isOk){
                ans = min(ans, now);
                return;
            }
        }
        return;
    }
    P.push_back(0);
    while(P.back() <= 1){
        dfs(P);
        P.back()++;
    }
}

int main(){
    cin >> N >> M >> X;
    vector<long long> A(M);
    long long sum = 0;
    rep(i,N){
        long long c;
        cin >> c;
        cList[i] = c;
        rep(j,M){
            long long temp;
            cin >> temp;
            data[i][j] = temp;
        }
    }
    ans = 0;
    dfs(vector<int>());
    if(ans == 0){
        cout << -1 << endl;
    }else{
        cout << ans << endl;
    }
}


Compiler output:
a.cc: In function 'void dfs(std::vector<int>)':
a.cc:18:29: error: reference to 'data' is ambiguous
   18 |                 AList[j] += data[i][j];
      |                             ^~~~
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:6:5: note:                 'int data [12][12]'
    6 | int data[12][12];
      |     ^~~~
a.cc: In function 'int main()':
a.cc:49:13: error: reference to 'data' is ambiguous
   49 |             data[i][j] = temp;
      |             ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:6:5: note:                 'int data [12][12]'
    6 | int data[12][12];
      |     ^~~~