Language: C++

#include <iostream>
#include <algorithm>
#include <vector>

struct Tuplle {
  int a;
  int b;
  int c;
};

int main() {
  int n;
  std::cin >> n;
  
  std::vector<Tuple> t(n);
  for (auto&& ti : t) std::cin >> ti.a >> ti.b >> ti.c;

  std::vector<Tuple> h(n);
  h[0] = t[0];
  for (int i = 1; i < n; ++i) {
    auto& hi = h[i];
    auto& hii = h[i-1];
    hi.a = hii.a + std::max(hii.b, hii.c);
    hi.b = hii.b + std::max(hii.a, hii.c);
    hi.c = hii.c + std::max(hii.a, hii.b);
  }
  const auto& hn = h[n-1];
  std::cout << std::max({hn.a, hn.b, hn.c}) << std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:15: error: 'Tuple' was not declared in this scope; did you mean 'Tuplle'?
   15 |   std::vector<Tuple> t(n);
      |               ^~~~~
      |               Tuplle
a.cc:15:20: error: template argument 1 is invalid
   15 |   std::vector<Tuple> t(n);
      |                    ^
a.cc:15:20: error: template argument 2 is invalid
a.cc:16:20: error: 'begin' was not declared in this scope; did you mean 'std::begin'?
   16 |   for (auto&& ti : t) std::cin >> ti.a >> ti.b >> ti.c;
      |                    ^
      |                    std::begin
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:114:37: note: 'std::begin' declared here
  114 |   template<typename _Tp> const _Tp* begin(const valarray<_Tp>&) noexcept;
      |                                     ^~~~~
a.cc:16:20: error: 'end' was not declared in this scope; did you mean 'std::end'?
   16 |   for (auto&& ti : t) std::cin >> ti.a >> ti.b >> ti.c;
      |                    ^
      |                    std::end
/usr/include/c++/14/bits/range_access.h:116:37: note: 'std::end' declared here
  116 |   template<typename _Tp> const _Tp* end(const valarray<_Tp>&) noexcept;
      |                                     ^~~
a.cc:18:20: error: template argument 2 is invalid
   18 |   std::vector<Tuple> h(n);
      |                    ^
a.cc:19:4: error: invalid types 'int[int]' for array subscript
   19 |   h[0] = t[0];
      |    ^
a.cc:19:11: error: invalid types 'int[int]' for array subscript
   19 |   h[0] = t[0];
      |           ^
a.cc:21:17: error: invalid types 'int[int]' for array subscript
   21 |     auto& hi = h[i];
      |                 ^
a.cc:22:18: error: invalid types 'int[int]' for array subscript
   22 |     auto& hii = h[i-1];
      |                  ^
a.cc:27:21: error: invalid types 'int[int]' for array subscript
   27 |   const auto& hn = h[n-1];
      |                     ^
a.cc:28:24: error: no matching function for call to 'max(<brace-enclosed initializer list>)'
   28 |   std::cout << std::max({hn.a, hn.b, hn.c}) << std::endl;
      |                ~~~~~~~~^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   template argument deduction/substitution failed:
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   candidate expects 2 arguments, 1 provided