Language: C++

#include <bits/stdc++.h>
using namespace std;

int pei(int sum, vector<int> price, int j, vector<vector<int> > vec, int X, vector<int> Y, int M){
  if(j == M){
    return sum;
  }else{
  	int no = pei(sum, price, j+1, vec, X, Y, M);
  	int i;
    int w = 1;
  	for(i = 0; i < M; i++){
      Y[i] += vec[j][i];
      if(Y[i] < X){
        w = -1;
      }
    }
  	sum += price[j];
    if(w == 1){
      return sum;
    }else{
      int yes = pei(sum, price, j+1, vec, X, Y, M);
      if(no < yes){
        return no;
      }else{
        return yes;
      }
    }
  }
}


int main() {
  int N, M, X;
  cin >> N >> M >> X;
  vector<int> price(N);
  vector<vector<int>> vec(N, vector<int>(M);
  int i, j;
  for(i = 0; i < N; i++){
    cin >> price[i];
    for(j = 0; j < M; j++){
      cin >> vec[i][j];
    }
  }
  int sum = 0;
  vector<int> Y[N];
  for(i = 0; i < N; i++){
    Y[i] = 0;
  }
  int a = pei(sum, price, 0, vec, X, Y, M);
  cout << a << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:36:44: error: expected ')' before ';' token
   36 |   vector<vector<int>> vec(N, vector<int>(M);
      |                          ~                 ^
      |                                            )
a.cc:47:12: error: no match for 'operator=' (operand types are 'std::vector<int>' and 'int')
   47 |     Y[i] = 0;
      |            ^
In file included from /usr/include/c++/14/vector:72,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/vector.tcc:210:5: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = int; _Alloc = std::allocator<int>]'
  210 |     vector<_Tp, _Alloc>::
      |     ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:211:42: note:   no known conversion for argument 1 from 'int' to 'const std::vector<int>&'
  211 |     operator=(const vector<_Tp, _Alloc>& __x)
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
In file included from /usr/include/c++/14/vector:66:
/usr/include/c++/14/bits/stl_vector.h:766:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = int; _Alloc = std::allocator<int>]'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:766:26: note:   no known conversion for argument 1 from 'int' to 'std::vector<int>&&'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |                 ~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:788:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = int; _Alloc = std::allocator<int>]'
  788 |       operator=(initializer_list<value_type> __l)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:788:46: note:   no known conversion for argument 1 from 'int' to 'std::initializer_list<int>'
  788 |       operator=(initializer_list<value_type> __l)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
a.cc:49:38: error: could not convert '(std::vector<int>*)(& Y)' from 'std::vector<int>*' to 'std::vector<int>'
   49 |   int a = pei(sum, price, 0, vec, X, Y, M);
      |                                      ^
      |                                      |
      |                                      std::vector<int>*