Language: C++

int main()
{
    ios_base::sync_with_stdio(false) ;
    cin.tie(NULL) ;
    cout.tie(NULL) ;
    
    int n;
    scanf("%d", &n);
    vector<int> dp(3,0);

    for(int i1 = 0; i1 < n; i1++) 
    {
        vector<int> new_dp(3, 0);
        vector<int> c(3);
        for(int i = 0; i < 3; i++) 
            scanf("%d", &c[i]);

        for(int i = 0; i < 3; i++)   //Parent Possibility
        {
            for(int j = 0; j < 3; j++)   // Current Child Possibility
            {
                if(i != j && (new_dp[j] < dp[i] + c[j])) 
                    new_dp[j] =  dp[i] + c[j];
            }
        }
        dp = new_dp;
    }
    printf("%d\n", max({dp[0], dp[1], dp[2]}));

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:5: error: 'ios_base' has not been declared
    3 |     ios_base::sync_with_stdio(false) ;
      |     ^~~~~~~~
a.cc:4:5: error: 'cin' was not declared in this scope
    4 |     cin.tie(NULL) ;
      |     ^~~
a.cc:4:13: error: 'NULL' was not declared in this scope
    4 |     cin.tie(NULL) ;
      |             ^~~~
a.cc:1:1: note: 'NULL' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
  +++ |+#include <cstddef>
    1 | int main()
a.cc:5:5: error: 'cout' was not declared in this scope
    5 |     cout.tie(NULL) ;
      |     ^~~~
a.cc:8:5: error: 'scanf' was not declared in this scope
    8 |     scanf("%d", &n);
      |     ^~~~~
a.cc:9:5: error: 'vector' was not declared in this scope
    9 |     vector<int> dp(3,0);
      |     ^~~~~~
a.cc:9:12: error: expected primary-expression before 'int'
    9 |     vector<int> dp(3,0);
      |            ^~~
a.cc:13:16: error: expected primary-expression before 'int'
   13 |         vector<int> new_dp(3, 0);
      |                ^~~
a.cc:14:16: error: expected primary-expression before 'int'
   14 |         vector<int> c(3);
      |                ^~~
a.cc:16:26: error: 'c' was not declared in this scope
   16 |             scanf("%d", &c[i]);
      |                          ^
a.cc:22:31: error: 'new_dp' was not declared in this scope
   22 |                 if(i != j && (new_dp[j] < dp[i] + c[j]))
      |                               ^~~~~~
a.cc:22:43: error: 'dp' was not declared in this scope
   22 |                 if(i != j && (new_dp[j] < dp[i] + c[j]))
      |                                           ^~
a.cc:22:51: error: 'c' was not declared in this scope
   22 |                 if(i != j && (new_dp[j] < dp[i] + c[j]))
      |                                                   ^
a.cc:26:9: error: 'dp' was not declared in this scope
   26 |         dp = new_dp;
      |         ^~
a.cc:26:14: error: 'new_dp' was not declared in this scope
   26 |         dp = new_dp;
      |              ^~~~~~
a.cc:28:25: error: 'dp' was not declared in this scope
   28 |     printf("%d\n", max({dp[0], dp[1], dp[2]}));
      |                         ^~
a.cc:28:20: error: 'max' was not declared in this scope
   28 |     printf("%d\n", max({dp[0], dp[1], dp[2]}));
      |                    ^~~
a.cc:28:5: error: 'printf' was not declared in this scope
   28 |     printf("%d\n", max({dp[0], dp[1], dp[2]}));
      |     ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int main()