Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
 
int main() {
  	int n;
  cin>>n;
  vector<int> a,b,c;
  for(int i=0;i<n; i++) {
    int temp1,temp2,temp3;
    cin>>temp1>>temp2>>temp3;
    a.push(back(temp1);
    b.push(back(temp2);
    c.push(back(temp3);
  }
   vector<vector<int>> dp(a,vector<int>(3,0));
    dp[0][0] = a[0];
    dp[0][1] = b[0];
    dp[0][2] = c[0];
	for(int i=0; i<n; i++) {
      	dp[i][0] = a[i] + max(dp[i-1][1],dp[i-1][2]);
      	dp[i][0] = b[i] + max(dp[i-1][0],dp[i-1][2]);
      	dp[i][0] = c[i] + max(dp[i-1][0],dp[i-1][1]);
    }
    cout<<max(max(dp[n-1][0],dp[n-1][1]),dp[n-1][2]);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |   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:8:3: error: 'vector' was not declared in this scope
    8 |   vector<int> a,b,c;
      |   ^~~~~~
a.cc:8: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:8:10: error: expected primary-expression before 'int'
    8 |   vector<int> a,b,c;
      |          ^~~
a.cc:12:5: error: 'a' was not declared in this scope
   12 |     a.push(back(temp1);
      |     ^
a.cc:12:12: error: 'back' was not declared in this scope
   12 |     a.push(back(temp1);
      |            ^~~~
a.cc:13:5: error: 'b' was not declared in this scope
   13 |     b.push(back(temp2);
      |     ^
a.cc:14:5: error: 'c' was not declared in this scope
   14 |     c.push(back(temp3);
      |     ^
a.cc:16:18: error: expected primary-expression before 'int'
   16 |    vector<vector<int>> dp(a,vector<int>(3,0));
      |                  ^~~
a.cc:17:5: error: 'dp' was not declared in this scope
   17 |     dp[0][0] = a[0];
      |     ^~
a.cc:17:16: error: 'a' was not declared in this scope
   17 |     dp[0][0] = a[0];
      |                ^
a.cc:18:16: error: 'b' was not declared in this scope
   18 |     dp[0][1] = b[0];
      |                ^
a.cc:19:16: error: 'c' was not declared in this scope
   19 |     dp[0][2] = c[0];
      |                ^
a.cc:21:27: error: 'max' was not declared in this scope; did you mean 'std::max'?
   21 |         dp[i][0] = a[i] + max(dp[i-1][1],dp[i-1][2]);
      |                           ^~~
      |                           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:25:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   25 |     cout<<max(max(dp[n-1][0],dp[n-1][1]),dp[n-1][2]);
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:25:15: error: 'max' was not declared in this scope; did you mean 'std::max'?
   25 |     cout<<max(max(dp[n-1][0],dp[n-1][1]),dp[n-1][2]);
      |               ^~~
      |               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:25:11: error: 'max' was not declared in this scope; did you mean 'std::max'?
   25 |     cout<<max(max(dp[n-1][0],dp[n-1][1]),dp[n-1][2]);
      |           ^~~
      |           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)
      |     ^~~