Language: C++

#include <iostream>

using namespace std;

int data[1e5+5][3];
int dp [1e5+5][3];
int n;
int vacation(int a,int i){
if(i == n) return 0;
	if(dp[i][a] != -1) return dp[i][a];
	int& ans = dp[i][a];

	if(a==0){
		ans=max(ans, vacation(1, i+1)+data[i][0]);
		ans=max(ans, vacation(2, i+1)+data[i][0]);
	}
	if(a==1){
		ans=max(ans, vacation(0, i+1)+data[i][1]);
		ans=max(ans, vacation(2, i+1)+data[i][1]);
	}
	if(a==2){
		ans=max(ans, vacation(0, i+1)+data[i][2]);
		ans=max(ans, vacation(1, i+1)+data[i][2]);
	}

	return ans;
}

int main()
{
 cin >> n;
    for(int i=0;i<n;i++){
        for(int j=0; j<3;j++){
            cin >> data[i][j];
            dp[i][j]=-1;
        }

    }
 int result = max(max(vacation(0,0),vacation(1,0)),vacation(2,0));
    cout << result << endl;
 return 0;

}

Compiler output:
a.cc:5:13: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
    5 | int data[1e5+5][3];
      |          ~~~^~
a.cc:5:13: error: could not convert '(1.0e+5 + (double)5)' from 'double' to 'long unsigned int'
    5 | int data[1e5+5][3];
      |          ~~~^~
      |             |
      |             double
a.cc:5:13: error: size of array 'data' has non-integral type 'double'
a.cc:6:12: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
    6 | int dp [1e5+5][3];
      |         ~~~^~
a.cc:6:12: error: could not convert '(1.0e+5 + (double)5)' from 'double' to 'long unsigned int'
    6 | int dp [1e5+5][3];
      |         ~~~^~
      |            |
      |            double
a.cc:6:12: error: size of array 'dp' has non-integral type 'double'
a.cc: In function 'int vacation(int, int)':
a.cc:14:47: error: reference to 'data' is ambiguous
   14 |                 ans=max(ans, vacation(1, i+1)+data[i][0]);
      |                                               ^~~~
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 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:5:5: note:                 'int data [1][3]'
    5 | int data[1e5+5][3];
      |     ^~~~
a.cc:15:47: error: reference to 'data' is ambiguous
   15 |                 ans=max(ans, vacation(2, i+1)+data[i][0]);
      |                                               ^~~~
/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:5:5: note:                 'int data [1][3]'
    5 | int data[1e5+5][3];
      |     ^~~~
a.cc:18:47: error: reference to 'data' is ambiguous
   18 |                 ans=max(ans, vacation(0, i+1)+data[i][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:5:5: note:                 'int data [1][3]'
    5 | int data[1e5+5][3];
      |     ^~~~
a.cc:19:47: error: reference to 'data' is ambiguous
   19 |                 ans=max(ans, vacation(2, i+1)+data[i][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:5:5: note:                 'int data [1][3]'
    5 | int data[1e5+5][3];
      |     ^~~~
a.cc:22:47: error: reference to 'data' is ambiguous
   22 |                 ans=max(ans, vacation(0, i+1)+data[i][2]);
      |                                               ^~~~
/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:5:5: note:                 'int data [1][3]'
    5 | int data[1e5+5][3];
      |     ^~~~
a.cc:23:47: error: reference to 'data' is ambiguous
   23 |                 ans=max(ans, vacation(1, i+1)+data[i][2]);
      |                                               ^~~~
/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:5:5: note:                 'int data [1][3]'
    5 | int data[1e5+5][3];
      |     ^~~~
a.cc: In function 'int main()':
a.cc:34:20: error: reference to 'data' is ambiguous
   34 |             cin >> data[i][j];
      |                    ^~~~
/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:5:5: note:                 'int data [1][3]'
    5 | int data[1e5+5][3];
      |     ^~~~