criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;

#define forn(i,n)            for(int i=0; i<n; i++)
#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;


void zeus()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}

int32_t main()
{
	//zeus();

	int n; cin >> n;

	vector<int> dp(3);

	forn(day, n) {
		vector<int> new_dp(3) = {0};
		vector<int> c(3);
		forn(i, 3) {
			cin >> c[i];
		}
		forn(i, 3) {
			forn(j, 3) {
				if (i != j) {
					new_dp[j] = max(new_dp[j], dp[i] + c[j]);
				}
			}
		}
		dp = new_dp;
	}

	cout << max({dp[0], dp[1], dp[2]});



	return 0;
}

Compiler output:
a.cc: In function 'int32_t main()':
a.cc:47:39: error: expected ',' or ';' before '=' token
   47 |                 vector<int> new_dp(3) = {0};
      |                                       ^
Language: C++

#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;

#define forn            for(int i=0; i<n; i++)
#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;


void zeus()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}

int32_t main()
{
	zeus();
	
	int n; cin>>n;

	vector<int> dp(3);

	forn(day,n){
		vector<int> new_dp(3)={0};
		vector<int> c(3);
		forn(i,3){
			cin>>c[i];
		}
		forn(i,3){
			forn(j,3){
				if(i!=j){
					new_dp[j]=max(new_dp[j],dp[i]+c[j]);
				}
			}
		}
		dp=new_dp;
	}

	cout<<max({dp[0],dp[1],dp[2]});



	return 0;
}

Compiler output:
a.cc: In function 'int32_t main()':
a.cc:46:14: error: 'day' was not declared in this scope
   46 |         forn(day,n){
      |              ^~~
Language: Java

import java.util.*;
public class Main{
  public static void main(String Args[]){
   	Scanner ob=new Scanner(System.in);
    int n=ob.nextInt();
    int a=0,b=0,c=0,sum=0;
    int d=-1;
    for(int i=0;i<n;i++){
      a=ob.nextInt();
      b=ob.nextInt();
      c=ob.nextInt();
      if(d==0){
        sum+=math.max(b,c);
        if(b>c)
          d=1;
        else
          d=2;
      }
      else if(d==1){
       sum+=Math.max(a,c);
        if(a>c)
          d=0;
        else
          d=2;
      }
      else if(d==2){
       sum+=Math.max(a,b);
        if(b>a)
          d=1;
        else
          d=0;
      }
      else{
      	sum+=Math.max(a,Math.max(b,c));
        if(a>c&&a>b)
          d=0;
        else if(b>c)
          d=1;
        else
          d=2;
      }
    }
  }
}

Compiler output:
Main.java:13: error: cannot find symbol
        sum+=math.max(b,c);
             ^
  symbol:   variable math
  location: class Main
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int mod = 1000000007;
int dp[100001];
int a[100001],b[100001],c[100001];
int n;
int dpf(int num,int two,char x)
{
       // if (dp[num]!=-1   ) { return dp[num]; }
  else if (two==1&&num==n) { if(x=='A'){return dp[num]=max(b[num],c[num]);} if(x=='B'){return dp[num]=max(a[num],c[num]);} if(x=='C'){return dp[num]=max(b[num],a[num]);} }
  else if (x=='A'&&two==1) { return dp[num]=max(b[num]+dpf(num+1,1,'B'),c[num]+dpf(num+1,1,'C'));}
  else if (x=='B'&&two==1) { return dp[num]=max(a[num]+dpf(num+1,1,'A'),c[num]+dpf(num+1,1,'C'));}
  else if (x=='C'&&two==1) { return dp[num]=max(a[num]+dpf(num+1,1,'A'),b[num]+dpf(num+1,1,'B'));}
  else if (x=='D'        ) { return dp[num]=max(a[num]+dpf(num+1,1,'A'),max(b[num]+dpf(num+1,1,'B'),c[num]+dpf(num+1,1,'C')));}
  return 0;
}
int main()
{  ios_base::sync_with_stdio(false); cin.tie(NULL);
   memset(dp,0,sizeof(dp));
   cin>>n;
   for(int i=1;i<=n;i++)
   {
    cin>>a[i]>>b[i]>>c[i];
   }
   int ans=dpf(1,1,'D');
   cout<<ans;
   cout<<"\n";
   return 0;
}


Compiler output:
a.cc: In function 'int dpf(int, int, char)':
a.cc:11:3: error: 'else' without a previous 'if'
   11 |   else if (two==1&&num==n) { if(x=='A'){return dp[num]=max(b[num],c[num]);} if(x=='B'){return dp[num]=max(a[num],c[num]);} if(x=='C'){return dp[num]=max(b[num],a[num]);} }
      |   ^~~~
Language: C++

#include <iostream>
using namespace std;

int main() {
	int n;
	cin>>n;
	vector<int>dp[n]={0};

	  int temp=INT_MIN;
	    int  manx=INT_MIN;
	    
	  vector<int>index[n];
index[0]=0;

	    
	for(int i=0;i<n;i++){
	    vector<int>c[4];
	    c[3]=INT_MIN;
	    
	  
	   for(int j=0;j<3;j++){
	       
	        cin>>c[i];
	        temp=c[i];
	        
	       if(temp>manx)
	        {
	            manx=temp;
	            index[i]=j;
	        }
	   }
	   if(i==0){
	       dp[0]+=max(c[0],max(c[1],c[2]     ));
	   }
	   else if(i>0){
	       swap(c[index[i-1]],c[3] );
	       
	        dp[0]+=max(c[0],max(c[1],c[2]     ));
	       
	       
	   }
	
	    
	    
	    
	    
	}
	
	 cout<<dp[n-1]<<endl;

	
	
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'vector' was not declared in this scope
    7 |         vector<int>dp[n]={0};
      |         ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:7:16: error: expected primary-expression before 'int'
    7 |         vector<int>dp[n]={0};
      |                ^~~
a.cc:9:20: error: 'INT_MIN' was not declared in this scope
    9 |           int temp=INT_MIN;
      |                    ^~~~~~~
a.cc:2:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    1 | #include <iostream>
  +++ |+#include <climits>
    2 | using namespace std;
a.cc:12:18: error: expected primary-expression before 'int'
   12 |           vector<int>index[n];
      |                  ^~~
a.cc:13:1: error: 'index' was not declared in this scope
   13 | index[0]=0;
      | ^~~~~
a.cc:17:20: error: expected primary-expression before 'int'
   17 |             vector<int>c[4];
      |                    ^~~
a.cc:18:13: error: 'c' was not declared in this scope
   18 |             c[3]=INT_MIN;
      |             ^
a.cc:33:16: error: 'dp' was not declared in this scope
   33 |                dp[0]+=max(c[0],max(c[1],c[2]     ));
      |                ^~
a.cc:38:17: error: 'dp' was not declared in this scope
   38 |                 dp[0]+=max(c[0],max(c[1],c[2]     ));
      |                 ^~
a.cc:49:16: error: 'dp' was not declared in this scope
   49 |          cout<<dp[n-1]<<endl;
      |                ^~
Language: C

#include <bits/stdc++.h>

using namespace std;

int main()
{
    //freopen("tttt.out", "w", stdout) ;
    //freopen("tttt.in", "r", stdin) ;
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    long long a,fr,sc,th,bef1=0,bef2=0,bef3=0,ov1,ov2,ov3;
    cin>>a;
    for(int i=0;i<a;i++)
    {
        cin>>fr>>sc>>th;
        ov3=max(bef1,bef2)+th;
        ov2=max(bef1,bef3)+sc;
        ov1=max(bef3,bef2)+fr;
        bef1=ov1;
        bef2=ov2;
        bef3=ov3;
    }
    cout<<max(ov1,max(ov2,ov3));
    return 0;
}

Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

include<bits/stdc++.h>
 
using namespace std;
 
int main(){
  int n;
  cin>>n;
  vector<vector<int>> arr(n,vector<int>(3));
  for(int i=0;i<n;i++){
    for(int j=0;j<3;j++){
      cin>>arr[i][j];
    }
  }
  for(int i=1;i<n;i++){
    arr[i][0]+=max(arr[i-1][1],arr[i-1][2]);
    arr[i][1]+=max(arr[i-1][0],arr[i-1][2]);
    arr[i][2]+=max(arr[i-1][1],arr[i-1][0]);
  }
  int ans=max(arr[n-1][0],min(arr[n-1][1],arr[n-1][2]));
  cout<<ans<<"\n";
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope
    7 |   cin>>n;
      |   ^~~
a.cc:8:3: error: 'vector' was not declared in this scope
    8 |   vector<vector<int>> arr(n,vector<int>(3));
      |   ^~~~~~
a.cc:8:17: error: expected primary-expression before 'int'
    8 |   vector<vector<int>> arr(n,vector<int>(3));
      |                 ^~~
a.cc:11:12: error: 'arr' was not declared in this scope
   11 |       cin>>arr[i][j];
      |            ^~~
a.cc:15:5: error: 'arr' was not declared in this scope
   15 |     arr[i][0]+=max(arr[i-1][1],arr[i-1][2]);
      |     ^~~
a.cc:15:16: error: 'max' was not declared in this scope
   15 |     arr[i][0]+=max(arr[i-1][1],arr[i-1][2]);
      |                ^~~
a.cc:19:15: error: 'arr' was not declared in this scope
   19 |   int ans=max(arr[n-1][0],min(arr[n-1][1],arr[n-1][2]));
      |               ^~~
a.cc:19:27: error: 'min' was not declared in this scope; did you mean 'main'?
   19 |   int ans=max(arr[n-1][0],min(arr[n-1][1],arr[n-1][2]));
      |                           ^~~
      |                           main
a.cc:19:11: error: 'max' was not declared in this scope
   19 |   int ans=max(arr[n-1][0],min(arr[n-1][1],arr[n-1][2]));
      |           ^~~
a.cc:20:3: error: 'cout' was not declared in this scope
   20 |   cout<<ans<<"\n";
      |   ^~~~
Language: Java

import java.util.*;
import java.util.function.*;
import java.math.*;
public class Main {
    public static void main(String[] args){
		Scanner s = new Scanner(System.in);
		int N = s.nextInt();
		int[][] A = new int[N][3];
		for(int i = 0; i < N; i++) {
			A[i][0] = s.nextInt();
			A[i][1] = s.nextInt();
			A[i][2] = s.nextInt();
		}
		
		int[][] dp = new int[N][3];
		dp[0][0] = A[0][0];
		dp[0][1] = A[0][1];
		dp[0][2] = A[0][2];
		for(int i = 1; i < N; i++) {
			for(int k = 0; k < 3; k++) {
				dp[i][k] = Math.max(dp[i-1][(k+1)%3], dp[i-1][(k+2)%3]);
			}
		}
		int result = Math.max(dp[N-1][0], dp[N-1][1]);
		result = Math.max(dp[N-1][2], result);
      	System.out.println(result);
    {
}

Compiler output:
Main.java:28: error: reached end of file while parsing
}
 ^
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
    int n;
    int a,b,c;
    cin>>n;
    int dp[n][3];
    dp[0][0]=0;
    dp[0][1]=0;
    dp[0][2]=0;
    for (int i = 1; i <=n ; i++) {
        /* code */
        cin>>a>>b>>c;
        dp[i][0]=a+max(dp[i-1][1],dp[i-1][2]);
        dp[i][1]=b+max(dp[i-1][0],dp[i-1][2]);
        dp[i][2]=c+max(dp[i-1][0],dp[i-1][1]);
    }
    cout<<max(dp[n][0],dp[n][1],dp[n][2])<<endl;
}

Compiler output:
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:19:14:   required from here
   19 |     cout<<max(dp[n][0],dp[n][1],dp[n][2])<<endl;
      |           ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:306:17: error: '__comp' cannot be used as a function
  306 |       if (__comp(__a, __b))
      |           ~~~~~~^~~~~~~~~~
Language: C++

#include <iostream>
#define ll long long
#include <string>
#include <vector>
#include <math.h>
#include <utility>
#include<set>
#include<tuple>
#define f first
#define sec second
#define t 3
using namespace std;
/*
12
13
*/

ll min(ll a, ll b)
{
    if(a<b)
    return a;
    return b;
}
ll max(ll a, ll b)
{
    if(a>b)
    return a;
    return b;
}

ll DP(ll n , ll arr[n][t])
{
    ll dp[n][t];
    memset(dp,0,sizeof(dp));
    for(int i=0;i<t;i++)
    {
        dp[0][i]=arr[0][i];
    }

    for(int i=1;i<n;i++)
    {
           dp[i][0]=arr[i][0]+max(dp[i-1][1],dp[i-1][2]);
           dp[i][1]=arr[i][1]+max(dp[i-1][0],dp[i-1][2]);
           dp[i][2]=arr[i][2]+max(dp[i-1][0],dp[i-1][1]);
       
    }

    ll ans=max(dp[n-1][1],max(dp[n-1][2],dp[n-1][0]));

    return ans;
   
}
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    ll n=0;
    cin>>n;
    ll arr[n][3];
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<3;j++)
        {
            cin>>arr[i][j];
        }
    }

    cout<<DP(n,arr) ;


}

Compiler output:
a.cc:31:22: error: use of parameter outside function body before ']' token
   31 | ll DP(ll n , ll arr[n][t])
      |                      ^
a.cc: In function 'long long int DP(...)':
a.cc:33:11: error: 'n' was not declared in this scope; did you mean 'yn'?
   33 |     ll dp[n][t];
      |           ^
      |           yn
a.cc:34:12: error: 'dp' was not declared in this scope; did you mean 'DP'?
   34 |     memset(dp,0,sizeof(dp));
      |            ^~
      |            DP
a.cc:34:5: error: 'memset' was not declared in this scope
   34 |     memset(dp,0,sizeof(dp));
      |     ^~~~~~
a.cc:8:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    7 | #include<set>
  +++ |+#include <cstring>
    8 | #include<tuple>
a.cc:37:18: error: 'arr' was not declared in this scope
   37 |         dp[0][i]=arr[0][i];
      |                  ^~~
a.cc:42:21: error: 'arr' was not declared in this scope
   42 |            dp[i][0]=arr[i][0]+max(dp[i-1][1],dp[i-1][2]);
      |                     ^~~
Language: C++

#include <bits/stdc++.h>
#define ll long long
#include <string>
#include <vector>
#include <math.h>
#include <utility>
#include<set>
#include<tuple>
#define f first
#define sec second
#define t 3
using namespace std;
/*
12
13
*/

ll min(ll a, ll b)
{
    if(a<b)
    return a;
    return b;
}
ll max(ll a, ll b)
{
    if(a>b)
    return a;
    return b;
}

ll DP(ll n , ll arr[n][t])
{
    ll dp[n][t];
    memset(dp,0,sizeof(dp));
    for(int i=0;i<t;i++)
    {
        dp[0][i]=arr[0][i];
    }

    for(int i=1;i<n;i++)
    {
           dp[i][0]=arr[i][0]+max(dp[i-1][1],dp[i-1][2]);
           dp[i][1]=arr[i][1]+max(dp[i-1][0],dp[i-1][2]);
           dp[i][2]=arr[i][2]+max(dp[i-1][0],dp[i-1][1]);
       
    }

    ll ans=max(dp[n-1][1],max(dp[n-1][2],dp[n-1][0]));

    return ans;
   
}
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    ll n=0;
    cin>>n;
    ll arr[n][3];
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<3;j++)
        {
            cin>>arr[i][j];
        }
    }

    cout<<DP(n,arr) ;


}

Compiler output:
a.cc:31:22: error: use of parameter outside function body before ']' token
   31 | ll DP(ll n , ll arr[n][t])
      |                      ^
a.cc: In function 'long long int DP(...)':
a.cc:33:11: error: 'n' was not declared in this scope; did you mean 'yn'?
   33 |     ll dp[n][t];
      |           ^
      |           yn
a.cc:34:12: error: 'dp' was not declared in this scope; did you mean 'dup'?
   34 |     memset(dp,0,sizeof(dp));
      |            ^~
      |            dup
a.cc:37:18: error: 'arr' was not declared in this scope
   37 |         dp[0][i]=arr[0][i];
      |                  ^~~
a.cc:42:21: error: 'arr' was not declared in this scope
   42 |            dp[i][0]=arr[i][0]+max(dp[i-1][1],dp[i-1][2]);
      |                     ^~~
Language: C++

// 【問題概要】
// NN 日間の夏休みです。i 日目には、

// A: 海で泳ぐ。幸福度 ai を加算
// B: 山で虫取りする。幸福度 bi を加算
// C: 家で宿題をする。幸福度 ci を加算

// の三択の中から好きなものを選ぶことができます。ただし、
// 2 日連続で A, B, C のうちの同一種類の活動を選択をする
// ことはできません。この制約下で最終的に得られる幸福度の総和を最大にせよ。

// 【制約】

// 1≤N≤1051≤N≤105

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
template<class T>inline bool chmax(T& a, T b){if(a<b){a=b;return true;}return false}
template<class T>inline bool chmin(T& a, T b){if(a>b){a=b;return true;}return false}

int n;
ll a[100010][3]; // a[i],b[i],c[i]をそれぞれまとめてa[i][0],a[i][1],a[i][2]にする。
ll dp[100010][3];

int main(){
  cin>>n;
  for(int i=0;i<n;++i)for(int j=0;j<3;++j)cin>>a[i][j];
  for(int i=0;i<n;++i){
    for(int j=0;j<3;++j){
      for(int k=0;k<3;++k){
        if(j==k)continue;
        chmax(dp[i+1][k],dp[i][j]+a[i][k]);
      }
    }
  }
  ll res=0;
  for(int j=0;j<3;++j)chmax(res,dp[n][j]);
  cout<<res;
}

Compiler output:
a.cc: In function 'bool chmax(T&, T)':
a.cc:19:84: error: expected ';' before '}' token
   19 | template<class T>inline bool chmax(T& a, T b){if(a<b){a=b;return true;}return false}
      |                                                                                    ^
      |                                                                                    ;
a.cc: In function 'bool chmin(T&, T)':
a.cc:20:84: error: expected ';' before '}' token
   20 | template<class T>inline bool chmin(T& a, T b){if(a>b){a=b;return true;}return false}
      |                                                                                    ^
      |                                                                                    ;
Language: Java

import java.util.*;
import java.lang.*;
import java.io.*;
public class main{
	static int[][]dp=new int[10001][10001];
	static int solve(int[][]arr,int n){
		dp[1][0]=arr[1][0];
		dp[1][1]=arr[1][1];
		dp[1][2]=arr[1][2];

		for(int i=2;i<=n;i++){
			dp[i][0]=arr[i][0]+Math.max(dp[i-1][1],dp[i-1][2]);
			dp[i][1]=arr[i][1]+Math.max(dp[i-1][0],dp[i-1][2]);
			dp[i][2]=arr[i][2]+Math.max(dp[i-1][0],dp[i-1][1]);
		}
		return Math.max(dp[n][0],Math.max(dp[n][1],dp[n][2]));
	}
	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		int n=in.nextInt();
		int[][]arr=new int[n+1][3];
		for(int i=1;i<=n;i++){
			for(int j=0;j<=2;j++){
				arr[i][j]=in.nextInt();
			}
		}	
		System.out.println(solve(arr,n));
	}
}


Compiler output:
Main.java:4: error: class main is public, should be declared in a file named main.java
public class main{
       ^
1 error
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#define rep(i,n) for(int i = 0;i < n;i++)
using namespace std;
using ll = long long;

vector<vector<int>>vac;
ll dpa[100010], dpb[100010], dpc[100010];

ll select(ll dp, int& s,int index) {
	vector<int> abc = { 0,1,2 };
	abc.erase(abc.begin() + s);
	int v1 = vac[index][abc[0]], v2 = vac[index][abc[1]];
	if (v1 => v2) {
		s = abc[0];
		cout << s;
		return dp + v1;
	}
	else {
		s = abc[1];
		cout << s;
		return dp + v2;
	}
}

int main() {
	int n,a,b,c;
	cin >> n;
	vac.resize(n);
	rep(i, n) {
		cin >> a >> b >> c;
		vac[i].push_back(a);vac[i].push_back(b);vac[i].push_back(c);
	}
	a = 0, b = 1, c = 2;
	dpa[0] = vac[0][0];dpb[0] = vac[0][1];dpc[0] = vac[0][2];
	for (int i = 1; i < n; i++) {
		printf("i=%d ", i);
		dpa[i] = select(dpa[i - 1], a, i);
		dpb[i] = select(dpb[i - 1], b, i);
		dpc[i] = select(dpc[i - 1], c, i);
		printf("\n");
	}
	cout << max(max(dpa[n - 1], dpb[n - 1]), dpc[n - 1]) << endl;
	return 0;
}

Compiler output:
a.cc: In function 'll select(ll, int&, int)':
a.cc:15:17: error: expected primary-expression before '>' token
   15 |         if (v1 => v2) {
      |                 ^
a.cc:25:1: warning: control reaches end of non-void function [-Wreturn-type]
   25 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespce std;
int main()
{
int n;
  cin>>n;
  int a[3];
  cin>>a[0]>>a[1]>>a[2];
  for(int i=1;i<n;i++)
  {
    int x,y,z;
    cin>>x>>y>>z;
    a[0]=x+max(a[1],a[2]);
    a[1]=y+max(a[0],a[2]);
    a[2]=z+max(a[1],a[0]);
  }
  cout<<max(a[0],a[1],a[2]);
}
  

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namespce'
    2 | using namespce std;
      |       ^~~~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin>>n;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 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:13:12: error: 'max' was not declared in this scope; did you mean 'std::max'?
   13 |     a[0]=x+max(a[1],a[2]);
      |            ^~~
      |            std::max
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/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:17:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   17 |   cout<<max(a[0],a[1],a[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:17:9: error: 'max' was not declared in this scope; did you mean 'std::max'?
   17 |   cout<<max(a[0],a[1],a[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)
      |     ^~~
Language: C++

/*
            _           __                _      _____ _____ _____ 
  ___ _   _| |__   ___ / _|_ __ ___  __ _| | __ |___  |___  |___  |
 / __| | | | '_ \ / _ \ |_| '__/ _ \/ _` | |/ /    / /   / /   / / 
| (__| |_| | |_) |  __/  _| | |  __/ (_| |   <    / /   / /   / /  
 \___|\__,_|_.__/ \___|_| |_|  \___|\__,_|_|\_\  /_/   /_/   /_/   

*/
#include<bits/stdc++.h>
using namespace std;
typedef long long ll ;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<ll> vi;
typedef vector<pll> vpll;
typedef unordered_map <ll,ll> umap ; 
//#pragma GCC optimize "trapv"
#define loop(i,a,b) for(ll i=a ;i<b;i++)
#define For(i,n) for(int i=0;i<(ll)n;i++)
#define Rev(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,n) for(int i=1;i<=n;++i)
#define F first
#define S second
#define pb push_back
#define em emplace_back
#define all(v) (v).begin(),(v).end()
#define mems(x, y) memset(x, y, sizeof(x))
#define sz(v) (v).size()
#define mp(a,b) make_pair(a,b)
#define pf(n) cout<<n<<"\n"
#define pff(n) cout << n << " " ; 
#define ar array
#define endl "\n" 
#define int ll 
#define time        cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
long const M=1e9+7;
const long mxN =1e5+2 ;
int n,p1,p2,p3;
vector<ar<int,3>>A ;
int dp[mxN][3] ;
void solve(){
  cin >> n  ;
  For(i,n){
    ar<int,3>p ;
    cin >> p[0] >> p[1] >> p[2]  ;
    A.pb(p) ;
  }
  // dp[i][j]--> maximum cost if we chose jth activity on ith day 
  For(i,3)
    dp[0][i]=A[0][i] ;
  for(int i=1;i<n;i++)
    for(int j=0;j<3;++j)
      dp[i][j]=max(dp[i-1][(j+1)%3]+A[i][j],dp[i-1][(j+2)%3]+A[i][j])
  cout << max({dp[n-1][0],dp[n-1][1],dp[n-1][2]}) << endl ;
}
signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    //cout << setprecision(20) << fixed ;
    solve() ;
    //ll t ; cin >> t ; while(t--)solve();
	return 0;
}
  

Compiler output:
a.cc: In function 'void solve()':
a.cc:53:70: error: expected ';' before 'cout'
   53 |       dp[i][j]=max(dp[i-1][(j+1)%3]+A[i][j],dp[i-1][(j+2)%3]+A[i][j])
      |                                                                      ^
      |                                                                      ;
   54 |   cout << max({dp[n-1][0],dp[n-1][1],dp[n-1][2]}) << endl ;
      |   ~~~~                                                                
a.cc:54:49: error: expected primary-expression before ')' token
   54 |   cout << max({dp[n-1][0],dp[n-1][1],dp[n-1][2]}) << endl ;
      |                                                 ^
Language: C++

#include <bits/stdc++.h> 
using namespace std;

int main() {
	int n;
	cin>>n;
int nums [100005][3];

	for(int i=0; i<n; i++){
	cin>>nums[i][0]>>nums[i][1]>>nums[i][2];
	}
	vector<int> temp(3,0);
	vector<int> dp(3,0);
	
	for(int i=0; i<n; i++){
		temp=dp;
		temp[0]=nums[i][0]+max(dp[1],dp[2]);
		temp[1]=nums[i][1]+max(dp[0],dp[2]);
		temp[2]=nums[i][2]+max(dp[0],dp[1]);
		dp=temp;
	}
	cout<<max(dp[0],dp[1],dp[2]);
	
}

Compiler output:
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:22:11:   required from here
   22 |         cout<<max(dp[0],dp[1],dp[2]);
      |               ~~~^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:306:17: error: '__comp' cannot be used as a function
  306 |       if (__comp(__a, __b))
      |           ~~~~~~^~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
#include <string> 
using namespace std;
#define int long long
int main()
{
  int ans=0;
  int N;
  int A[3][100010];
  int DP[3][100010];
  cin>>N;

  for(int i=0;i<N;i++){
    cin>>A[0][i]>>A[1][i]>>A[2][i];
  }

  for(int i=0;i<N;i++){
    for(int j=0;j<3;j++){
      for(int k=0;k<3;k++){
        if(j==k)continue;
        DP[j][i+1]=max(DP[k][i]+A[j][i],DP[j][i+1]);
      }
    }
  }

  for(int i=0;i<3;i++){
    if(ans<DP[i][N])ans=DP[i][N];
  }
  cout<<ans;
 
  return 0;
}


Compiler output:
cc1plus: error: '::main' must return 'int'
Language: Java

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Frog1 {

	static Scanner sc =new Scanner(System.in);
	public static void main(String[] args) {
		
		int N=sc.nextInt();
		//int k=sc.nextInt();
		int a[][]=new int[N][3];
		for(int i=0;i<N;i++)
			for(int j=0;j<3;j++)a[i][j]=sc.nextInt();

		
		int dp[]=new int[3];
		dp[0]=a[0][0];
		dp[1]=a[0][1];
		dp[2]=a[0][2];
		int key=0;
	
		
		
		int f=0;
		if(N==1)	{int max=Math.max(dp[0], dp[1]);
		max=Math.max(max, dp[2]);
		System.out.println(max);}
		else {
		
			int m[]=new int[3];
		for(int i=1;i<N;i++) {

			
			
			
			//for(int j=1;j<;j++) {if(f==a[i-1][j]) {key=j;break;}}
			m[0]=a[i][0]+Math.max(dp[2],dp[1]);
			m[1]=a[i][1]+Math.max(dp[2],dp[0]);
			m[2]=a[i][2]+Math.max(dp[1],dp[0]);
		//	System.out.println(m[2]);
	//		System.out.println(m[1]);
			
			for(int j=0;j<3;j++) {
				dp[i]=m[i];
			}
			
		}
		int max=Math.max(dp[0], dp[1]);
		max=Math.max(max, dp[2]);
		System.out.println(max);
	}
		
}
	}


Compiler output:
Main.java:6: error: class Frog1 is public, should be declared in a file named Frog1.java
public class Frog1 {
       ^
1 error
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main() {
  int n;
  vector<long long> dp(3, 0);

  cin >> n;

  for(int days = 0; days < n; i++){
    vector<int> c(3, 0);
    vector<long long> new_dp(3, 0);
    for(int i = 0; i < 3; i++){
      cin >> c[i];
    }
    for(int i = 0; i < 3; i++){
      for(int j = 0; j < 3; j++){
        if(i != j){
          new_dp[j] = max(dp[i] + c[j], new_dp[j]);
        }
      }
    }
    dp = new_dp;
  }
  cout << max(max(dp[0], dp[1]), dp[2]) << "\n";
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:31: error: 'i' was not declared in this scope
   12 |   for(int days = 0; days < n; i++){
      |                               ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
	int n;
  	cin>>n;
  	int a,b,c;
  	int v1[n],v2[n],v3[n];
  for(int i=0;i<n;i++){
  	cin>>v[i]>>v2[i]>>v3[i];
  	}
  a=v1[0];
  b=v2[0];
  c=v3[0];
  for(int i=1;i<n;i++){
  		int t1=a;int t2=b;int t3=c;
    	a=t1+v1[i]+max(t3,t2);
    b=t2+v2[i]+max(t1,t3);
    c=t3+v3[i]+max(t1,t2);
  }
  int ans=max(a,max(b,c));
  cout<<ans<<endl;




}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: 'v' was not declared in this scope
   10 |         cin>>v[i]>>v2[i]>>v3[i];
      |              ^
Language: C++

#include <iostream>
#define maxn 110000

int main(){
	int dp[maxn][3], a[maxn], b[maxn], c[maxn];
	int n;

	scanf("%d", &n);

	for(int i = 0; i < n; i++){
		scanf("%d%d%d", &a[i], &b[i], &c[i]);
	}
	for(int i = 0; i < n; i++){
		for(int j = 0; j < 3; j++){
			if(i == 0){
				if(j == 0) dp[i][j] = a[i];
				if(j == 1) dp[i][j] = b[i];
				if(j == 2) dp[i][j] = c[i];
			}
			else{
				for(int k = 0; k < 3; k++){
					if(j == k) continue;
					if(j == 0){
						dp[i][j] = max(dp[i][j], dp[i - 1][k] + a[i]);
					}
					else if(j == 1){
						dp[i][j] = max(dp[i][j], dp[i - 1][k] + b[i]);
					}
					else{
						dp[i][j] = max(dp[i][j], dp[i - 1][k] + c[i]);
					}
				}
			}
		}
	}
	int aux = 0;
	aux = max(aux, dp[n - 1][0]);
	aux = max(aux, dp[n - 1][1]);
	aux = max(aux, dp[n - 1][2]);

	printf("%d\n", aux);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:60: error: 'max' was not declared in this scope; did you mean 'std::max'?
   24 |                                                 dp[i][j] = max(dp[i][j], dp[i - 1][k] + a[i]);
      |                                                            ^~~
      |                                                            std::max
In file included from /usr/include/c++/14/string:51,
                 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/stl_algobase.h:303:5: note: 'std::max' declared here
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
a.cc:27:60: error: 'max' was not declared in this scope; did you mean 'std::max'?
   27 |                                                 dp[i][j] = max(dp[i][j], dp[i - 1][k] + b[i]);
      |                                                            ^~~
      |                                                            std::max
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: 'std::max' declared here
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
a.cc:30:60: error: 'max' was not declared in this scope; did you mean 'std::max'?
   30 |                                                 dp[i][j] = max(dp[i][j], dp[i - 1][k] + c[i]);
      |                                                            ^~~
      |                                                            std::max
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: 'std::max' declared here
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
a.cc:37:15: error: 'max' was not declared in this scope; did you mean 'std::max'?
   37 |         aux = max(aux, dp[n - 1][0]);
      |               ^~~
      |               std::max
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: 'std::max' declared here
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const ll INF = 1LL << 60;
#define rep1(i, n) for (ll i=0; i<(n); i++) 
#define rep2(i, k, n) for (ll i=k; i<(n); i++)
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }


// 入力
int N;
ll a[10010][3];

// DP テーブル
ll dp[100010][3];

int main() {
    int N; cin >> N;
    rep1(i, N) rep1(j, 3) cin >> a[i][j];

    // ループ
    rep1(i, N) {
        rep1(j, 3) {
            rep1(k, 3) {
                if (j == k) continue;
                chmax(dp[i+1][k], dp[i][j]+a[i][k])
            }
        }
    }
    ll ans = 0;
    rep1(i,3) chmax(ans, dp[N][i]);
    // 答え
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:52: error: expected ';' before '}' token
   29 |                 chmax(dp[i+1][k], dp[i][j]+a[i][k])
      |                                                    ^
      |                                                    ;
   30 |             }
      |             ~
Language: Java

//package april2020;

import java.util.*;
import java.lang.*;
import java.math.*;
import java.io.*;

public class dp_atcoder {
	static int n, in[][];
	static Integer[][] dp;
	public static void main(String[] args) {
		FastReader scn = new FastReader();
		
		n = scn.nextInt();
		
		in = new int[n][3];
		for(int i=0;i<n;i++) {
			for(int j=0;j<3;j++) {
				in[i][j] = scn.nextInt();
			}
		}
		
		dp = new Integer[n+1][5];
		
		int res = search(0,4);
		System.out.println(res);
	}
	public static int search(int d, int prev) {
		if(d>=n) {
			return 0;
		}
		if(dp[d][prev]!=null) {
			return dp[d][prev];
		}
		int ans = Integer.MIN_VALUE;
//		int mp = -1;
		for(int i =0;i<3;i++) {
			if(i!=prev) {
				int ta = search(d+1,i)+in[d][i];
				if(ta>ans) {
					ans= ta;
//					mp = i;
				}
			}
		}
//		System.out.println(in[d][mp]+" "+(d==0?-1:in[d-1][prev]));
		return dp[d][prev]=ans;
	}
	static class FastReader 
    { 
        BufferedReader br; 
        StringTokenizer st; 
  
        public FastReader() 
        { 
            br = new BufferedReader(new
                     InputStreamReader(System.in)); 
        } 
  
        String next() 
        { 
            while (st == null || !st.hasMoreElements()) 
            { 
                try
                { 
                    st = new StringTokenizer(br.readLine()); 
                } 
                catch (IOException  e) 
                { 
                    e.printStackTrace(); 
                } 
            } 
            return st.nextToken(); 
        } 
  
        int nextInt() 
        { 
            return Integer.parseInt(next()); 
        } 
  
        long nextLong() 
        { 
            return Long.parseLong(next()); 
        } 
  
        double nextDouble() 
        { 
            return Double.parseDouble(next()); 
        } 
  
        String nextLine() 
        { 
            String str = ""; 
            try
            { 
                str = br.readLine(); 
            } 
            catch (IOException e) 
            { 
                e.printStackTrace(); 
            } 
            return str; 
        } 
    }
}


Compiler output:
Main.java:8: error: class dp_atcoder is public, should be declared in a file named dp_atcoder.java
public class dp_atcoder {
       ^
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main() {
	int a[N][3];
	int dp[N][3];
	int n;
    scanf("%d", &n);
 
    for (int i = 1; i <= n; ++i) {
        scanf("%d%d%d", &a[i][0], &a[i][1], &a[i][2]);
    }
 
    for (int i = 1; i <= n; ++i) {
        dp[i][0] = std::max(dp[i - 1][1], dp[i - 1][2]) + a[i][0];
        dp[i][1] = std::max(dp[i - 1][0], dp[i - 1][2]) + a[i][1];
        dp[i][2] = std::max(dp[i - 1][0], dp[i - 1][1]) + a[i][2];
    }
 
    printf("%lld\n", std::max(std::max(dp[n][0], dp[n][1]), dp[n][2]));
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:15: error: 'N' was not declared in this scope
    5 |         int a[N][3];
      |               ^
a.cc:11:26: error: 'a' was not declared in this scope
   11 |         scanf("%d%d%d", &a[i][0], &a[i][1], &a[i][2]);
      |                          ^
a.cc:15:9: error: 'dp' was not declared in this scope; did you mean 'dup'?
   15 |         dp[i][0] = std::max(dp[i - 1][1], dp[i - 1][2]) + a[i][0];
      |         ^~
      |         dup
a.cc:15:59: error: 'a' was not declared in this scope
   15 |         dp[i][0] = std::max(dp[i - 1][1], dp[i - 1][2]) + a[i][0];
      |                                                           ^
a.cc:20:40: error: 'dp' was not declared in this scope; did you mean 'dup'?
   20 |     printf("%lld\n", std::max(std::max(dp[n][0], dp[n][1]), dp[n][2]));
      |                                        ^~
      |                                        dup
Language: C++

#inckude<bits/stdc++.h>
using namespace std;
int main()
{
  long long n,i,j,k;
  cin>>n;
  long long a[n][3];
  for(i=0;i<n;i++)
  {
    cin>>a[i][0]>>a[i][1]>>a[i][2];
  }
  long long dp[n][3];
  dp[0][0]=a[0][0];
  dp[0][1]=a[0][1];
  dp[0][2]=a[0][2];
  for(i=1;i<n;i++)
  {
    dp[i][0]=max(dp[i-1][1],dp[i-1][2])+a[i][0];
    dp[i][1]=max(dp[i-1][0],dp[i-1][2])+a[i][1];
    dp[i][2]=max(dp[i-1][1],dp[i-1][0])+a[i][2];
  }
  long long ans=max(dp[n-1][0],max(dp[n-1][1],dp[n-1][2]));
  cout<<ans;
 
}


Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inckude; did you mean #include?
    1 | #inckude<bits/stdc++.h>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin>>n;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #inckude<bits/stdc++.h>
a.cc:18:14: error: 'max' was not declared in this scope
   18 |     dp[i][0]=max(dp[i-1][1],dp[i-1][2])+a[i][0];
      |              ^~~
a.cc:22:32: error: 'max' was not declared in this scope
   22 |   long long ans=max(dp[n-1][0],max(dp[n-1][1],dp[n-1][2]));
      |                                ^~~
a.cc:22:17: error: 'max' was not declared in this scope
   22 |   long long ans=max(dp[n-1][0],max(dp[n-1][1],dp[n-1][2]));
      |                 ^~~
a.cc:23:3: error: 'cout' was not declared in this scope
   23 |   cout<<ans;
      |   ^~~~
a.cc:23:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include<bits/stdc++.h>
using namespace std;'
int main()
{
  long long n,i,j,k;
  cin>>n;
  long long a[n][3];
  for(i=0;i<n;i++)
  {
    cin>>a[i][0]>>a[i][1]>>a[i][2];
  }
  long long dp[n][3];
  dp[0][0]=a[0][0];
  dp[0][1]=a[0][1];
  dp[0][2]=a[0][2];
  for(i=1;i<n;i++)
  {
    dp[i][0]=max(dp[i-1][1],dp[i-1][2])+a[i][0];
    dp[i][1]=max(dp[i-1][0],dp[i-1][2])+a[i][1];
    dp[i][2]=max(dp[i-1][1],dp[i-1][0])+a[i][2];
  }
  long long ans=max(dp[n-1][0],max(dp[n-1][1],dp[n-1][2]));
  cout<<ans;
 
}


Compiler output:
a.cc:2:21: warning: missing terminating ' character
    2 | using namespace std;'
      |                     ^
a.cc:2:21: error: missing terminating ' character
Language: C++

#inckude<bits/stdc++.h>
using namespace std;'
int main()
{
  long long n,i,j,k;
  cin>>n;
  long long a[n][3];
  for(i=0;i<n;i++)
  {
    cin>>a[i][0]>>a[i][1]>>a[i][2];
  }
  long long dp[n][3];
  dp[0][0]=a[0][0];
  dp[0][1]=a[0][1];
  dp[0][2]=a[0][2];
  for(i=1;i<n;i++)
  {
    dp[i][0]=max(dp[i-1][1],dp[i-1][2])+a[i][0];
    dp[i][1]=max(dp[i-1][0],dp[i-1][2])+a[i][1];
    dp[i][2]=max(dp[i-1][1],dp[i-1][0])+a[i][2];
  }
  long long ans=max(dp[n-1][0],max(dp[n-1][1],dp[n-1][2]));
  cout<<ans;
 
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inckude; did you mean #include?
    1 | #inckude<bits/stdc++.h>
      |  ^~~~~~~
      |  include
a.cc:2:21: warning: missing terminating ' character
    2 | using namespace std;'
      |                     ^
a.cc:2:21: error: missing terminating ' character
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin>>n;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #inckude<bits/stdc++.h>
a.cc:18:14: error: 'max' was not declared in this scope
   18 |     dp[i][0]=max(dp[i-1][1],dp[i-1][2])+a[i][0];
      |              ^~~
a.cc:22:32: error: 'max' was not declared in this scope
   22 |   long long ans=max(dp[n-1][0],max(dp[n-1][1],dp[n-1][2]));
      |                                ^~~
a.cc:22:17: error: 'max' was not declared in this scope
   22 |   long long ans=max(dp[n-1][0],max(dp[n-1][1],dp[n-1][2]));
      |                 ^~~
a.cc:23:3: error: 'cout' was not declared in this scope
   23 |   cout<<ans;
      |   ^~~~
a.cc:23:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include <bits/stdc++.h>
#define mod 1000000007
using namespace std;
typedef long long int ll ;

ll max(ll a , ll b)
{
  return (a > b) ? a: b;
}
ll min(ll a , ll b)
{
  return (a < b) ? a : b;
}
void memset(int *arr , int n , int value)
{
    for(int i= 0; i<n ; i++)
    {
        arr[i] = value;
    }
}
/* int vacation(int **arr , int i , int n , int last , int **dp)
 {
     if(i == n)
     {
         return 0;
     }
     if(dp[i][last] != -1)
     {
         return dp[i][last] ;
     }

     int opsn1 = -1e9+7 ;
     int opsn2 = -1e9+7 ;
     int opsn3 = -1e9+7 ;

     if(last !=0)
     {
         opsn1 = arr[i][0] + vacation(arr , i+1 , n , 0 , dp);
     }
     if(last !=1)
     {
         opsn2 = arr[i][1] + vacation(arr , i+1  , n , 1 ,dp);
     }
     if(last !=2)
     {
         opsn3 = arr[i][2] + vacation(arr , i+1  , n , 2 ,dp);
     }
     return dp[i][last] = max(opsn1 , max(opsn2 , opsn3)) ;
}
*/
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin>>n;
    int **arr = new int*[n];
    for(int i= 0; i<n ; i++)
    {
        arr[i] = new int[3] ;
    }
    for(int i= 0; i<n ; i++)
    {
        for(int j= 0; j<3 ; j++)
        {
            cin>>arr[i][j];
        }
    }
    int **dp = new int*[n];
    for(int i=0 ; i<n ; i++)
    {
        dp[i]= new int[3];
    }
    for(int i= 0; i<n ; i++)
    {
        for(int j=0; j<3 ; j++)
        {
            dp[i][j] = -1 ;
        }
    }
    for(int i=0 ; i<3 ; i++)
    {
        dp[0][i] = arr[0][i] ;
    }
    for(int i=1 ; i<n ; i++)
    {
        for(int j = 0 ; j<3 ; j++)
        {
            for(int k= 0; k<3 ; k++)
            {
                if(j !=k)
                {
                    dp[i][j] = max(dp[i][j] , dp[i-1][k] + arr[i][j]);
                }
            }
        }
    }
    int ans = 0;
    for(int i= 0; i<3 ; i++)
    {
        ans = max(dp[n-1][i] , ans) ;
    }
    cout<<ans<<endl;7

    //cout<<vacation(arr , 0 , n , 4 , dp);

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:103:22: error: expected ';' before 'return'
  103 |     cout<<ans<<endl;7
      |                      ^
      |                      ;
......
  107 |     return 0;
      |     ~~~~~~
Language: C++

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

int main() {
	using std::cin; using std::cout; using std::endl;
	
	int n = 0; cin >> n;
	int matrix[n][3] {};

	int input;
	for (size_t i = 0; i < n; i++) {
		for (size_t j = 0; j < 3; j++) {
			cin >> input;
			matrix[i].push_back(input);
		}
	}
	int last = -1; int result = 0;
	for (size_t i = 0; i < n; i++) {
		std::pair<int, int> max; int prevMax = 0;
		for (size_t j = 0; j < 3; j++) {
			if (last == j)
				continue;

			max.first = std::max(max.first, matrix[i][j]);
			if (max.first > prevMax) {
				prevMax = max.first;
				max.second = j;
			}
		}
		result += max.first;
		last = max.second;
	}

	cout << result << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:35: error: request for member 'push_back' in 'matrix[i]', which is of non-class type 'int [3]'
   15 |                         matrix[i].push_back(input);
      |                                   ^~~~~~~~~
Language: C

using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

// 入力
int N;
long long a[100010][3]; // a[i], b[i], c[i] をそれぞれまとめて a[i][0], a[i][1], a[i][2] にしてしまう

// DP テーブル
long long dp[100010][3];

int main() {
    int N; cin >> N;
    for (int i = 0; i < N; ++i) for (int j = 0; j < 3; ++j) cin >> a[i][j];

    // 初期化は既に 0 に初期化される
    // 初期条件も既に 0 で OK

    // ループ
    for (int i = 0; i < N; ++i) {
        for (int j = 0; j < 3; ++j) {
            for (int k = 0; k < 3; ++k) {
                if (j == k) continue;
                chmax(dp[i + 1][k], dp[i][j] + a[i][k]);
            }
        }
    }

    // 答え
    long long res = 0;
    for (int j = 0; j < 3; ++j) chmax(res, dp[N][j]);
    cout << res << endl;
}

Compiler output:
main.c:1:1: error: unknown type name 'using'
    1 | using namespace std;
      | ^~~~~
main.c:1:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
    1 | using namespace std;
      |                 ^~~
main.c:2:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    2 | template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
      |         ^
main.c:3:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    3 | template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
      |         ^
main.c: In function 'main':
main.c:13:12: error: 'cin' undeclared (first use in this function)
   13 |     int N; cin >> N;
      |            ^~~
main.c:13:12: note: each undeclared identifier is reported only once for each function it appears in
main.c:24:17: error: implicit declaration of function 'chmax' [-Wimplicit-function-declaration]
   24 |                 chmax(dp[i + 1][k], dp[i][j] + a[i][k]);
      |                 ^~~~~
main.c:32:5: error: 'cout' undeclared (first use in this function)
   32 |     cout << res << endl;
      |     ^~~~
main.c:32:20: error: 'endl' undeclared (first use in this function)
   32 |     cout << res << endl;
      |                    ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int N;
    cin >> N;
    vector<int> dp(3);
    for(int i = 0;i  < N;i++){
        vector<int> new_dp(3);
        vector<int> c(3);
        for(int i1 = 0;i1 < 3;i1++) scanf("%d",&c[i1]);
        for(int y = 0;x < 3;x++){
            for(int x = 0;y < 3;y++){
                if(x != y){
                    new_dp[x] = max(new_dp[x], dp[y] + c[x]);
                }
            }
        }
        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:14:23: error: 'x' was not declared in this scope
   14 |         for(int y = 0;x < 3;x++){
      |                       ^