Language: C++

#include<bits/stdc++.h>
#include <iostream>
using namespace std;
struct data
{
  int a,b,c;
};
int VacationKeMaz(int n, vector<data> v)
{ 
    int dp[n+1][3];
    dp[1][0]=v[1].a;
    dp[1][1]=v[1].b;
    dp[1][2]=v[1].c;
    for(int i=2;i<=n;i++)
    {
        dp[i][0]=v[i].a+max(dp[i-1][1],dp[i-1][2]);
        dp[i][1]=v[i].b+max(dp[i-1][0],dp[i-1][2]);
        dp[i][2]=v[i].c+max(dp[i-1][0],dp[i-1][1]);
    }
    return max(dp[n][0],max(dp[n][1],dp[n][2]));
}
int main() {
    int n;
    cin>>n;
    vector<data> v(n+1);
    for(int i=1;i<=n;i++)
    {
        cin>>v[i].a;
        cin>>v[i].b;
        cin>>v[i].c;
    }
    cout<<VacationKeMaz(n,v);
}


Compiler output:
a.cc:8:37: error: template argument 1 is invalid
    8 | int VacationKeMaz(int n, vector<data> v)
      |                                     ^
a.cc:8:37: error: template argument 2 is invalid
a.cc:8:37: error: template argument 1 is invalid
a.cc:8:37: error: template argument 2 is invalid
a.cc:8:37: error: template argument 1 is invalid
a.cc:8:37: error: template argument 2 is invalid
a.cc:8:26: error: invalid template-id
    8 | int VacationKeMaz(int n, vector<data> v)
      |                          ^~~~~~
a.cc:8:33: error: reference to 'data' is ambiguous
    8 | int VacationKeMaz(int n, vector<data> v)
      |                                 ^~~~
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:4:8: note:                 'struct data'
    4 | struct data
      |        ^~~~
a.cc:8:26: error: missing template argument list after 'std::vector'; template placeholder not permitted in parameter
    8 | int VacationKeMaz(int n, vector<data> v)
      |                          ^~~~~~
      |                                <>
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:
/usr/include/c++/14/bits/stl_vector.h:428:11: note: 'template<class _Tp, class _Alloc> class std::vector' declared here
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
a.cc: In function 'int VacationKeMaz(...)':
a.cc:11:14: error: 'v' was not declared in this scope
   11 |     dp[1][0]=v[1].a;
      |              ^
a.cc: In function 'int main()':
a.cc:25:16: error: template argument 1 is invalid
   25 |     vector<data> v(n+1);
      |                ^
a.cc:25:16: error: template argument 2 is invalid
a.cc:28:15: error: invalid types 'int[int]' for array subscript
   28 |         cin>>v[i].a;
      |               ^
a.cc:29:15: error: invalid types 'int[int]' for array subscript
   29 |         cin>>v[i].b;
      |               ^
a.cc:30:15: error: invalid types 'int[int]' for array subscript
   30 |         cin>>v[i].c;
      |               ^