Language: C++

#include<bits/stdc++.h>
int findMinimumCost(vector<int> &height,int i,vector<int> &dp){
  if(i==height.size()-1){
    return 0;
  }
  if(dp[i]!=INT_MIN){
    return dp[i];
  }
  int c1=abs(height[i]-height[i+1])+findMinimumCost(height,i+1,dp);
  int c2=0;
  if(i+2<height.size()){
    c2=abs(height[i]-height[i+2])+findMinimumCost(height,i+2,dp);
  }
  dp[i]=min(c1,c2);
  return dp[i];
}
int main(){
  int N;
  cin>>N;
  vector<int> height;
  for(int i=0;i<N;i++){
  	int x;
    cin>>x;
    height.push_back(x);
  }
  vector<int> dp;
  for(int i=0;i<N;i++){
    dp.push_back(INT_MIN);
  }
  return findMinimumCost(height,0,dp);
}

Compiler output:
a.cc:2:21: error: 'vector' was not declared in this scope
    2 | int findMinimumCost(vector<int> &height,int i,vector<int> &dp){
      |                     ^~~~~~
a.cc:2:21: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 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/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:2:28: error: expected primary-expression before 'int'
    2 | int findMinimumCost(vector<int> &height,int i,vector<int> &dp){
      |                            ^~~
a.cc:2:41: error: expected primary-expression before 'int'
    2 | int findMinimumCost(vector<int> &height,int i,vector<int> &dp){
      |                                         ^~~
a.cc:2:47: error: 'vector' was not declared in this scope
    2 | int findMinimumCost(vector<int> &height,int i,vector<int> &dp){
      |                                               ^~~~~~
a.cc:2:47: note: suggested alternatives:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:2:54: error: expected primary-expression before 'int'
    2 | int findMinimumCost(vector<int> &height,int i,vector<int> &dp){
      |                                                      ^~~
a.cc:2:62: error: expression list treated as compound expression in initializer [-fpermissive]
    2 | int findMinimumCost(vector<int> &height,int i,vector<int> &dp){
      |                                                              ^
a.cc: In function 'int main()':
a.cc:19:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   19 |   cin>>N;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:20:3: error: 'vector' was not declared in this scope
   20 |   vector<int> height;
      |   ^~~~~~
a.cc:20:3: note: suggested alternatives:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:20:10: error: expected primary-expression before 'int'
   20 |   vector<int> height;
      |          ^~~
a.cc:24:5: error: 'height' was not declared in this scope
   24 |     height.push_back(x);
      |     ^~~~~~
a.cc:26:10: error: expected primary-expression before 'int'
   26 |   vector<int> dp;
      |          ^~~
a.cc:28:5: error: 'dp' was not declared in this scope; did you mean 'dup'?
   28 |     dp.push_back(INT_MIN);
      |     ^~
      |     dup
a.cc:30:26: error: 'height' was not declared in this scope
   30 |   return findMinimumCost(height,0,dp);
      |                          ^~~~~~
a.cc:30:35: error: 'dp' was not declared in this scope; did you mean 'dup'?
   30 |   return findMinimumCost(height,0,dp);
      |                                   ^~
      |                                   dup
a.cc:30:37: error: 'findMinimumCost' cannot be used as a function
   30 |   return findMinimumCost(height,0,dp);
      |                                     ^