Language: C++

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

using namepsace std;

int main() {
  int n; cin >> n;
  vector<int> as(n, 0), bs(n, 0), cs(n, 0);
  for (int i = 0; i < n; i++) {
    cin >> as[i]; cin >> bs[i]; cin >> cs[i];
  }
  
  vector< vector<int> > dp(n, vector<int>(3, 0));
  dp[0][0] = as[0]; dp[0][1] = bs[0]; dp[0][2] = cs[0];
  for (int i = 1; i < n; i++) {
    dp[i][0] = max(dp[i - 1][1] + bs[i], dp[i - 1][2] + cs[i]);
    dp[i][1] = max(dp[i - 1][2] + cs[i], dp[i - 1][0] + as[i]);
    dp[i][2] = max(dp[i - 1][0] + as[i], dp[i - 1][1] + bs[i]);
  }
  cout << max(dp[n - 1][0], max(dp[n - 1][1], dp[n - 1][2])) << endl;
}

Compiler output:
a.cc:5:7: error: expected nested-name-specifier before 'namepsace'
    5 | using namepsace std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:8:10: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 |   int n; cin >> n;
      |          ^~~
      |          std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:9:3: error: 'vector' was not declared in this scope
    9 |   vector<int> as(n, 0), bs(n, 0), cs(n, 0);
      |   ^~~~~~
a.cc:9:3: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:2:
/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:9:10: error: expected primary-expression before 'int'
    9 |   vector<int> as(n, 0), bs(n, 0), cs(n, 0);
      |          ^~~
a.cc:11:12: error: 'as' was not declared in this scope; did you mean 'abs'?
   11 |     cin >> as[i]; cin >> bs[i]; cin >> cs[i];
      |            ^~
      |            abs
a.cc:11:26: error: 'bs' was not declared in this scope; did you mean 'abs'?
   11 |     cin >> as[i]; cin >> bs[i]; cin >> cs[i];
      |                          ^~
      |                          abs
a.cc:11:40: error: 'cs' was not declared in this scope
   11 |     cin >> as[i]; cin >> bs[i]; cin >> cs[i];
      |                                        ^~
a.cc:14:18: error: expected primary-expression before 'int'
   14 |   vector< vector<int> > dp(n, vector<int>(3, 0));
      |                  ^~~
a.cc:15:3: error: 'dp' was not declared in this scope
   15 |   dp[0][0] = as[0]; dp[0][1] = bs[0]; dp[0][2] = cs[0];
      |   ^~
a.cc:15:14: error: 'as' was not declared in this scope; did you mean 'abs'?
   15 |   dp[0][0] = as[0]; dp[0][1] = bs[0]; dp[0][2] = cs[0];
      |              ^~
      |              abs
a.cc:15:32: error: 'bs' was not declared in this scope; did you mean 'abs'?
   15 |   dp[0][0] = as[0]; dp[0][1] = bs[0]; dp[0][2] = cs[0];
      |                                ^~
      |                                abs
a.cc:15:50: error: 'cs' was not declared in this scope
   15 |   dp[0][0] = as[0]; dp[0][1] = bs[0]; dp[0][2] = cs[0];
      |                                                  ^~
a.cc:17:16: error: 'max' was not declared in this scope; did you mean 'std::max'?
   17 |     dp[i][0] = max(dp[i - 1][1] + bs[i], dp[i - 1][2] + cs[i]);
      |                ^~~
      |                std::max
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: 'std::max' declared here
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:21:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   21 |   cout << max(dp[n - 1][0], max(dp[n - 1][1], dp[n - 1][2])) << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:21:29: error: 'max' was not declared in this scope; did you mean 'std::max'?
   21 |   cout << max(dp[n - 1][0], max(dp[n - 1][1], dp[n - 1][2])) << endl;
      |                             ^~~
      |                             std::max
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: 'std::max' declared here
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:21:11: error: 'max' was not declared in this scope; did you mean 'std::max'?
   21 |   cout << max(dp[n - 1][0], max(dp[n - 1][1], dp[n - 1][2])) << endl;
      |           ^~~
      |           std::max
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: 'std::max' declared here
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:21:65: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   21 |   cout << max(dp[n - 1][0], max(dp[n - 1][1], dp[n - 1][2])) << endl;
      |                                                                 ^~~~
      |                                                                 std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~