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

using System;

class Program {

    public static int max(int a, int b) {
        if (a > b) {
            return a;
        }
        else {
            return b;
        }

    }

    public static int max3(int a, int b, int c) {
        if (a > max(b, c)) {
            return a;
        }
        else {
            return max(b, c);
        }
    }

    static void Main(string[] args) {

        int n = int.Parse(Console.ReadLine());

        int[,] f = new int[n, 3];

        for (int i = 0; i < n; i++) {
            string[] aux = Console.ReadLine().Split(' ');
            for (int j = 0; j < 3; j++) {
                f[i, j] = int.Parse(aux[j]);
            }
        }

        for (int i = 0; i < n; i++) {
            for (int j = 0; j < 3; j++) {
                if (j == 0) {
                    f[i, 0] += max(f[i - 1, 1], f[i - 1, 2]);
                }
                else {
                    if (j == 1) {
                        f[i, 1] += max(f[i - 1, 0], f[i - 1, 2]);
                    }
                    else {
                        if (j == 2) {
                            f[i, 2] += max(f[i - 1, 0], f[i - 1, 1]);
                        }
                    }
                }
            }
        }

        Console.WriteLine(max3(f[n - 1, 0], f[n - 1, 1], f[n - 1, 2]));


    }
}


Compiler output:
main.c:1:1: error: unknown type name 'using'
    1 | using System;
      | ^~~~~
main.c:3:1: error: unknown type name 'class'
    3 | class Program {
      | ^~~~~
main.c:3:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    3 | class Program {
      |               ^
Language: C++

#include <bits/stdc++.h>      
using namespace std;
const int N = 1e5 + 100;
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define ull unsigned long long
#define ll long long
#define pii pair <int,int>
#define forn(l,i,n) for(int i = l;i <= n;++i)   
#define FOR(l,i,n) for(int i = l;i < n;++i)
#define all(v) v.begin(), v.end()
#define pll pair <ll,ll>
const ll inf = 1e9 + 7;
const ll ll_inf = 1e17 + 100;   
const double pi = 3.14159265358979323;
inline void fr(){
    freopen("gcd.in", "r", stdin);
    freopen("gcd.out", "w", stdout);
}
void boost()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
}
 
ll binpow (ll a, ll n)
{
    ll res = 1;
    while (n) {
        if (n & 1)
        {
            res *= a;
            res %= inf;
        }
        a *= a;
        n >>= 1;
        a %= inf;
    }
    return res;
}
        
int n;
int a[N],b[N],c[N];
int dp[N][5];
 
main()	
{                                                                        
	cin >> n;
	for (int i = 1;i <= n;++i)
	{
		cin >> a[i] >> b[i] >> c[i];
	}

	dp[1][1] = a[1];
	dp[1][2] = b[1];
	dp[1][3] = c[1];
	for (int i = 2;i <= n;++i)
	{
		dp[i][1] = max(dp[i - 1][2],dp[i - 1][3]) + a[i];
		dp[i][2] = max(dp[i - 1][1],dp[i - 1][3]) + b[i];
		dp[i][3] = max(dp[i - 1][1],dp[i - 1][2]) + c[i];
	}
	cout << max(dp[n][1],max(dp[n][2],dp[n][3]));
}	 
v

Compiler output:
a.cc:49:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   49 | main()
      | ^~~~
a.cc:68:1: error: 'v' does not name a type
   68 | v
      | ^
Language: C++

#include <bits/stdc++.h>
#define pb push_back
#define ll long long
using namespace std;

//can use O(1) memory 

int T, n;
const int maxn = 100000+5;

int dpa, dpb, dpc, a, b, c;
int ta, tb, tc;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	cin >> n;
	dpa = dpb = dpc = 0
	for(int i = 0; i < n; i++)
	{
		cin >> a >> b >> c;
		ta = max(dpb, dpc)+a;
		tb = max(dpa, dpc)+b;
		tc = max(dpb, dpa)+c;
		dpa = ta;
		dpb = tb;
		dpc = tc;
	}
	cout << max(max(dpa, dpb), dpc);
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:28: error: expected ';' before 'for'
   18 |         dpa = dpb = dpc = 0
      |                            ^
      |                            ;
   19 |         for(int i = 0; i < n; i++)
      |         ~~~                 
a.cc:19:24: error: 'i' was not declared in this scope
   19 |         for(int i = 0; i < n; i++)
      |                        ^
Language: Java

#include<iostream>

using namespace std;

int main(){
	int n;
	int blockCol;
	int pts = 0;
	int p = 0;
	int aux;
	
	scanf("%d", &n);
	
	int m[n][3];
	
	for(int i = 0; i < n; i++){
		p = 0;
		for(int j = 0; j < 3; j++){
			scanf("%d", &m[i][j]);
			if(m[i][j] > p && ( i == 0 || (i > 0 && blockCol != j))){
				p = m[i][j];
				aux = j;
			}
		}
		blockCol = aux;
		pts += p;
	}
	
	printf("%d",pts);
}

Compiler output:
Main.java:1: error: illegal character: '#'
#include<iostream>
^
Main.java:1: error: class, interface, enum, or record expected
#include<iostream>
        ^
Main.java:14: error: not a statement
	int m[n][3];
	      ^
Main.java:5: error: unnamed classes are a preview feature and are disabled by default.
int main(){
^
  (use --enable-preview to enable unnamed classes)
Main.java:12: error: illegal start of expression
	scanf("%d", &n);
	            ^
Main.java:14: error: ';' expected
	int m[n][3];
	       ^
Main.java:19: error: illegal start of expression
			scanf("%d", &m[i][j]);
			            ^
7 errors
Language: C++

#include <bits/stdc++.h>
using namespace std;
const long double PI = acos(-1);
typedef long long ll;
typedef pair<int64_t,int64_t> pll;
int dx[]={1,-1,0,0,1,-1,1,-1};
int dy[]={0,0,1,-1,1,-1,-1,1};
#define INF (2147483647)
#define mod (1000000007)
#define limit (7368791)
#define rep(i,a,b) for (int64_t i = (a); i < (b); i++)
#define REP(i,n) rep(i,0,n)
#define ALL(a) begin(a),end(a)
#define sz(s) (s).size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
 
void solve()
{
    int n;cin>>n;
    int abc[n][3];
    REP(i,n)cin>>abc[i][0]>>abc[i][1]>>abc[i][2];
    vector<vector<int> >dp(n,vector<int>(3,0));
    dp[0][0]=abc[0][0];dp[0][1]=abc[0][1];dp[0][2]=abc[0][2];
    REP(i,1,n)REP(j,3)rep(k,1,3){
        dp[i][j]=max(dp[i][j],dp[i-1][(j+k)%3]+abc[i][j]);
    }
    cout<<max(dp[n-1][0],max(dp[n-1][1],dp[n-1][2]))<<endl;
}

int main()
{
    cin.tie(0);
	ios::sync_with_stdio(false);
    solve();
    return 0;
}

Compiler output:
a.cc:27:14: error: macro "REP" passed 3 arguments, but takes just 2
   27 |     REP(i,1,n)REP(j,3)rep(k,1,3){
      |              ^
a.cc:12:9: note: macro "REP" defined here
   12 | #define REP(i,n) rep(i,0,n)
      |         ^~~
a.cc: In function 'void solve()':
a.cc:27:5: error: 'REP' was not declared in this scope
   27 |     REP(i,1,n)REP(j,3)rep(k,1,3){
      |     ^~~
a.cc:27:19: error: 'j' was not declared in this scope
   27 |     REP(i,1,n)REP(j,3)rep(k,1,3){
      |                   ^
a.cc:11:42: note: in definition of macro 'rep'
   11 | #define rep(i,a,b) for (int64_t i = (a); i < (b); i++)
      |                                          ^
a.cc:27:15: note: in expansion of macro 'REP'
   27 |     REP(i,1,n)REP(j,3)rep(k,1,3){
      |               ^~~
a.cc:27:27: error: 'k' was not declared in this scope
   27 |     REP(i,1,n)REP(j,3)rep(k,1,3){
      |                           ^
a.cc:11:42: note: in definition of macro 'rep'
   11 | #define rep(i,a,b) for (int64_t i = (a); i < (b); i++)
      |                                          ^
Language: C

#include<stdio.h>
#define INFINITO 1000000000
  
long long int min(long long a, long long b) { return (a < b)? a : b; }
long long int max2(long long a, long long b) { return (a > b)? a : b; } 
long long int max3(long long a, long long b, long long c) {
	if(a>=b && b>=c) return a;
	else if(b>=a && b>=c) return b;
	else if(c>=a && c>=b) return c;
}

int main() {
	long long n, i, j;
	scanf("%lld", &n);
	long long a[n+10][3], dp[n+10][3];
		
	for(i = 1; i <= n; i++) {
		scanf("%lld", &vet[i][0]);
		scanf("%lld", &vet[i][1]);
		scanf("%lld", &vet[i][2]);
	}
	dp[1][0] = vet[1][0];
	dp[1][1] = vet[1][1];
	dp[1][2] = vet[1][2];

	for(i = 2; i <= n; i++)
		for(j = 0; j < 3; j++)
			dp[i][j] = max2( dp[i-1][(j+2)%3] + vet[i][j] , dp[i-1][(j+1)%3] + vet[i][j] );

	printf("%lld\n", max3(dp[n][0], dp[n][1], dp[n][2]));

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:18:32: error: 'vet' undeclared (first use in this function)
   18 |                 scanf("%lld", &vet[i][0]);
      |                                ^~~
main.c:18:32: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#define INFINITO 1000000000
  
long long int min(long long a, long long b) { return (a < b)? a : b; }
long long int max2(long long a, long long b) { return (a > b)? a : b; } 
long long int max3(long long a, long long b, long long c) {
	if(a>=b && b>=c) return a;
	else if(b>=a && b>=c) return b;
	else if(c>=a && c>=b) return c;
}

int main() {
	long long n, i, j;
	scanf("%lld", &n);
	long long a[n+10][3], dp[n+10][3];
		
	for(i = 1; i <= n; i++) {
		scanf("%lld", &vet[i][0]);
		scanf("%lld", &vet[i][1]);
		scanf("%lld", &vet[i][2]);
	}
	dp[1][0] = vet[1][0];
	dp[1][1] = vet[1][1];
	dp[1][2] = vet[1][2];

	for(i = 2; i <= n; i++)
		for(j = 0; j < 3; j++)
			dp[i][j] = max( dp[i-1][(j+2)%3] + vet[i][j] , dp[i-1][(j+1)%3] + vet[i][j] );

	printf("%lld\n", max3(dp[n][0], dp[n][1], dp[n][2]));

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:18:32: error: 'vet' undeclared (first use in this function)
   18 |                 scanf("%lld", &vet[i][0]);
      |                                ^~~
main.c:18:32: note: each undeclared identifier is reported only once for each function it appears in
main.c:28:36: error: implicit declaration of function 'max'; did you mean 'max3'? [-Wimplicit-function-declaration]
   28 |                         dp[i][j] = max( dp[i-1][(j+2)%3] + vet[i][j] , dp[i-1][(j+1)%3] + vet[i][j] );
      |                                    ^~~
      |                                    max3
Language: C

#include <iostream>
using namespace std;

int main() {
  int n, max, sum = 0;

  cin>>n;

  int agenda[n][3];

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

  int j,i,maiorI,maiorJ;
  for(i = 0; i < n; i++){
    max = -1;
    for(j = 0; j < 3; j++){
      if(agenda[i][j] > max){
        max = agenda[i][j];
        maiorI = i;
        maiorJ = j;
      }
    }
    sum += max;
    agenda[maiorI+1][maiorJ] = -1;
  }

  cout<<sum<<endl;
}


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

#include <iostream>
#include <fstream>
#include <bits/stdc++.h>
#include <map>
#define pb push_back
#define ll long long
using namespace std;
int n;
int mem[100010];
typedef struct
{
    int a,b,c;
}triplet;
int  v[100010][4],dp[100010][4];
int solve(triplet t,int &param)
{
    int ans=(max(max(t.a,t.b),t.c));
    if(ans==t.a)
    {
        param=1;
    }
    else if(ans==t.b)
    {
        param=2;
    }
    else
    {
        param=3;
    }
    return ans;
}
int maximal(int a,int b,int c)
{
    return max(max(a,b),c);
}
int main()
{
    int i,a,b,c,rez=0,maxim=-1;
    cin>>n;
    for(i=1;i<=n;i++)
    {
        triplet t;
        maxim=-1;
        cin>>t.a>>t.b>>t.c;
        v[i][0]=t.a;
        v[i][1]=t.b;
        v[i][2]=t.c;
    }
    dp[1][0]=v[1][0];
    dp[1][1]=v[1][1];
    dp[1][2]=v[1][2];
    int first,second;
    maximal(dp[1][0],dp[1][1],d[1][2],first);
    for(i=2;i<=n;i++)
    {
        int aux=maximal(dp[i-1][0],dp[i-1][1],dp[i-1][2],second);
        if(first==second)
        {
            
        }
        dp[i][0]=aux+v[i][0];
        dp[i][1]=aux+v[i][1];
        dp[i][2]=aux+v[i][2];
    }
    cout<<maximal(dp[n][0],dp[n][1],dp[n][2]);

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:53:31: error: 'd' was not declared in this scope
   53 |     maximal(dp[1][0],dp[1][1],d[1][2],first);
      |                               ^
a.cc:56:24: error: too many arguments to function 'int maximal(int, int, int)'
   56 |         int aux=maximal(dp[i-1][0],dp[i-1][1],dp[i-1][2],second);
      |                 ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:32:5: note: declared here
   32 | int maximal(int a,int b,int c)
      |     ^~~~~~~
Language: C++

#include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>
using namespace std;
using ll = long long;
using VL=vector<ll>;
typedef vector<ll> VL;
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
const long long INF = 999999999;
ll N,a[100010],b[100010],c[100010],dp[100010][3],ans;
// dp[i][0]はAを選んでいる dp[i][1]はBを選んでいる　dp[i][2]はCを選んでいる
int main(){
  cin >> N;
  REP(i,N){
    scanf("%lld %lld %lld",&a[i],&b[i],&c[i]);
  }
  dp[0][0]=a[0];
  dp[0][1]=b[0];
  dp[0][2]=c[0];
  FOR(i,1,N){
    dp[i][0]=a[i]+max(b[i],c[i]);
    dp[i][1]=b[i]+max(a[i],c[i]);
    dp[i][2]=c[i]+max(a[i],b[i]);
  }
  ans=max(dp[N-1][0],dp[N-1][1],dp[N-1][2]);
}

Compiler output:
In file included from /usr/include/c++/14/bits/stl_tree.h:63,
                 from /usr/include/c++/14/set:62,
                 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 = long long int; _Compare = long long int]':
a.cc:48:10:   required from here
   48 |   ans=max(dp[N-1][0],dp[N-1][1],dp[N-1][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 <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>
using namespace std;
using ll = long long;
using VL
typedef vector<ll> VL;
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
const long long INF = 999999999;
ll N,a[100010],b[100010],c[100010],dp[100010][3],ans;
// dp[i][0]はAを選んでいる dp[i][1]はBを選んでいる　dp[i][2]はCを選んでいる
int main(){
  cin >> N;
  REP(i,N){
    scanf("%lld %lld %lld",&a[i],&b[i],&c[i]);
  }
  dp[0][0]=a[0];
  dp[0][1]=b[0];
  dp[0][2]=c[0];
  FOR(i,1,N){
    dp[i][0]=a[i]+max(b[i],c[i]);
    dp[i][1]=b[i]+max(a[i],c[i]);
    dp[i][2]=c[i]+max(a[i],b[i]);
  }
  ans=max(dp[N-1][0],dp[N-1][1],dp[N-1][2]);
}

Compiler output:
a.cc:27:7: error: expected nested-name-specifier before 'VL'
   27 | using VL
      |       ^~
In file included from /usr/include/c++/14/bits/stl_tree.h:63,
                 from /usr/include/c++/14/set:62,
                 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 = long long int; _Compare = long long int]':
a.cc:48:10:   required from here
   48 |   ans=max(dp[N-1][0],dp[N-1][1],dp[N-1][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 <iostream>
using namespace std;
int max_arr(int arr[],int len){
  int ans=arr[0];
  for(int i=1;i<len;i++){
    ans=max(ans,arr[i]);
  }
  return ans;
}
int main(){
  int n,i,j;
  cin>>n;
  int p[n][3];
  for(i=0;i<n;i++){
    cin<>p[i][0]>>p[i][1]>>p[i][2];
  }
  int dp[n][3];
  dp[0][0]=p[0][0];
  dp[0][1]=p[0][1];
  dp[0][2]=p[0][2];
  for(i=1;i<n;i++){
    dp[i][0]=max(dp[i-1][1],dp[i-1][2])+p[i][0];
    dp[i][1]=max(dp[i-1][0],dp[i-1][2])+p[i][1];
    dp[i][2]=max(dp[i-1][0],dp[i-1][1])+p[i][2];
  }
  cout<<max_arr(dp[n-1],3);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: expected primary-expression before '>' token
   15 |     cin<>p[i][0]>>p[i][1]>>p[i][2];
      |         ^
Language: C++

#include <bits//stdc++.h>

using namespace std;
#define MX 500
int dp[MX][MX];
char a[MX], b[MX];

int LCSLength(int m , int n){
	int i, j;

	for (i = 0; i <= m; ++i)
		dp[i][0] = 0;

	for (j = 0; j <= n; ++j)
		dp[0][j] = 0;

	for (i = 1; i <= m; ++i){
		for (j = 1; j <= n; ++j){
			if (a[i-1] == b[j-1]){
				dp[i][j] = dp[i-1][j-1] + 1;
			}
			else if (dp[i-1][j] >= dp[i][j-1]){
				dp[i][j] = dp[i-1][j];
			}
			else{
				dp[i][j] = dp[i][j-1];
			}
		}
	}
	return dp[m][n];
}

int main()
{
    int m, n, kases = 0;
    while(gets(a))
    {
        // loop breaks when input is '#'
        if(strcmp(a, "#")==0) break;
        gets(b);
        m = strlen(a);
        n = strlen(b);
        LCSLength(m, n);
        printf("Case #%d: you can visit at most %d cities.\n", ++kases, dp[m][n]);
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:11: error: 'gets' was not declared in this scope; did you mean 'getw'?
   36 |     while(gets(a))
      |           ^~~~
      |           getw
Language: C++

#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>

using namespace std;

#define MAX 105
char A[MAX], B[MAX];
int dp[MAX][MAX];
bool visited[MAX][MAX];
int lenA, lenB;

int calcLCS(int i, int j)
{
    if(A[i] == '\0' || B[j] == '\0') return 0;
    if(visited[i][j]) return dp[i][j];
    int ans = 0;
    if(A[i] == B[j]) ans = 1 + calcLCS(i+1, j+1);
    else
    {
        int val1 = calcLCS(i+1, j);
        int val2 = calcLCS(i, j+1);
        ans = max(val1, val2);
    }
    visited[i][j] = 1;
    dp[i][j] = ans;
    return dp[i][j];
}

int main()
{
    int kases = 0;
    while(gets(A)){
        lenA = strlen(A);
        if(A[0] == '#' && lenA == 1) {
                break;
        }
        gets(B);
        lenB = strlen(B);
        memset(visited, 0, sizeof(visited));
        printf("%d: ", ++kases, calcLCS(0, 0));
    }
     return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:11: error: 'gets' was not declared in this scope; did you mean 'getw'?
   35 |     while(gets(A)){
      |           ^~~~
      |           getw
Language: C++

const int maxn = 1e5 + 5;
int dp[maxn][5] , a[maxn][4];
int main(){
	int n;
	scanf("%d",&n);
	for(int i = 1;i <= n;i++){
		for(int j = 1;j <= 3;j++){
			scanf("%d",&a[i][j]);
		}
	}
	for(int i = 1;i <= 3;i++)dp[1][i] = a[1][i];
	for(int i = 2;i <= n;i++){
		dp[i][1] = max(dp[i - 1][2] + a[i][1], dp[i-1][3]+a[i][1]);
		dp[i][2] = max(dp[i - 1][1] + a[i][2], dp[i-1][3]+a[i][2]);
		dp[i][3] = max(dp[i - 1][2] + a[i][3],dp[i-1][1]+a[i][3]);
	}
	int ans = 0;
	for(int i = 1;i <= 3;i++)ans = max(dp[n][i],ans);
	printf("%d\n",ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'scanf' was not declared in this scope
    5 |         scanf("%d",&n);
      |         ^~~~~
a.cc:13:28: error: 'max' was not declared in this scope; did you mean 'maxn'?
   13 |                 dp[i][1] = max(dp[i - 1][2] + a[i][1], dp[i-1][3]+a[i][1]);
      |                            ^~~
      |                            maxn
a.cc:18:40: error: 'max' was not declared in this scope; did you mean 'maxn'?
   18 |         for(int i = 1;i <= 3;i++)ans = max(dp[n][i],ans);
      |                                        ^~~
      |                                        maxn
a.cc:19:9: error: 'printf' was not declared in this scope
   19 |         printf("%d\n",ans);
      |         ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | const int maxn = 1e5 + 5;
Language: C++

#include<cstdio>
#include<algorithm>
using namespace std;
const int maxn = 1e5 + 5;

int a[maxn][4];
int dp[maxn][4];//d[i][j] i day choose j thing 's max happy

int main(){
	int n;scanf("%d",&n);
	for(int i = 1 ; i <= n ; i++){
		for(int j = 1 ; j <= 3 ; j++){
			scanf("%d",&a[i][j]);
		}
	}

	memset(dp, 0, sizeof dp);

	for(int i = 1 ; i <= 3 ; i++) dp[1][i] = a[1][i];

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

	int ans = 0;
	for(int i = 1 ; i <= 3 ; i++)ans = max(dp[n][i],ans);
	printf("%d\n",ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:9: error: 'memset' was not declared in this scope
   17 |         memset(dp, 0, sizeof dp);
      |         ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<algorithm>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rp(i,s,e) for(int i=(s);i<(e);++i)
 
int main(){
 int n;
  cin>>n;
  vector<vector<int>> a(3,vector<int>(n));
  for(int i=0;i<n;i++){
    cin>>a[i][0]>>a[i][1]>>a[i][2];
  }
  int dp[3][100010];
  dp[0][0]=a[0];
  dp[0][1]=a[1];
  dp[0][2]=a[2];
  for(int i=0;i<n-1;i++){
    for(int j=0;j<3;j++){
      for(int k=0;k<3;k++){
        if(k==j) continue;
        dp[i+1][j]=max(dp[i][k]+a[i+1][j],dp[i+1][j]);
      }
    }
  }
  cout<<max(dp[n-1][0],max(dp[n-1][1],dp[n-1][2]))<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:15: error: cannot convert '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} to 'int' in assignment
   13 |   dp[0][0]=a[0];
      |               ^
a.cc:14:15: error: cannot convert '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} to 'int' in assignment
   14 |   dp[0][1]=a[1];
      |               ^
a.cc:15:15: error: cannot convert '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} to 'int' in assignment
   15 |   dp[0][2]=a[2];
      |               ^
Language: C++

#include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define do long double
using namespace std;
//桁
int kt(int a){
  double b=a;
  b=log10(b);
  int c=b;
  return c+1;
 }
int lcm(int a,int b){
  int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return d*e/f;
    }
  int gcm(int a,int b){
      int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return f;
  }
signed main(){
  int a;
  cin>>a;
  int b[100010][3];
  rep(i,100010){
  rep(j,3){
  cin>>b[i][j];
  }
  }
  int dp[100010][3];
    
for(int i = 0; i < a; ++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] + b[i][k]);
            }
        }
    }
  cout<<dp[a-1]<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:67:17: error: 'chmax' was not declared in this scope
   67 |                 chmax(dp[i + 1][k], dp[i][j] + b[i][k]);
      |                 ^~~~~
Language: C

#include <stdio.h>
#include <math.h>

int n,;

int main() {
  scanf("%d", &n);
  double a[n];
  double b[n];
  double c[n];
  for (size_t i = 0; i < n; i++) {
    scanf("%lf%lf%lf", &a[n], &b[n], &c[n]);
  }
  double score[n][2];
  score[0][0] = 0;
  score[0][1] = 0;
  score[0][2] = 0;
  for (size_t i = 0; i < n; i++) {
    score[i + 1][0] = fmax(score[i][1] + b[i], score[i][2] + c[i]);
    score[i + 1][1] = fmax(score[i][0] + a[i], score[i][2] + c[i]);
    score[i + 1][2] = fmax(score[i][0] + a[i], score[i][1] + b[i]);
  }
  printf("%d", (int)fmin(score[n - 1][0], fmin(score[n - 1][1], score[n - 1][2])));
  return 0;
}


Compiler output:
main.c:4:7: error: expected identifier or '(' before ';' token
    4 | int n,;
      |       ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
/* Author : Ravikumar Navale */
#define fastIo() ios_base :: sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr)
#define pb push_back
#define endl  "\n"
typedef long long int ll;
vector<pair<ll,ll> >v1, v2, v3;
const ll MOD = 1e9 + 7;
const double peek = 1e7 ;

int main()
{
    fastIo();
    ll N, K;
    cin>> N ;
    ll A[N+1][4];
    ll DP[N+1][4];
    
    
    for(ll i= 1; i<=N ;i++)
        cin >> A[i][1] >> A[i][2] >>A[i][3];
    
    DP[1][1] = A[1][1];
    DP[1][2] = A[1][2];
    DP[1][3] = A[1][3];
    
    for(ll i= 2; i <= N ; i++)
    {
        DP[i][1] = max(D[i-1][2],DP[i-1][3]) + A[i][1];
        DP[i][2] = max(D[i-1][1],DP[i-1][3]) + A[i][2];
        DP[i][3] = max(D[i-1][2],DP[i-1][1]) + A[i][3];
        
    }
    
    cout << max(DP[N][1],max(DP[N][2],DP[N][3]));
    
    
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:24: error: 'D' was not declared in this scope
   30 |         DP[i][1] = max(D[i-1][2],DP[i-1][3]) + A[i][1];
      |                        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rp(i,s,e) for(int i=(s);i<(e);++i)
 
int main(){
  int n;
  vector<vector<int>> a(n,vector<int>(3));
  for(int i=0;i<n;i++){
    cin>>a[i][0]>>a[i][1]>>a[i][2];
  }
  vector<vector<int>> dp(n+100,vector<int>(3));
  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[i+1][j]=max(dp[i+1][j],dp[i][j]+a[i][k])
      }
    }
  }
  int t=0;
  for(int i=0;i<3;i++){
    t=max(t,dp[n-1][i]);
  }
  cout<<t<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:15: error: 'K' was not declared in this scope
   15 |         if(j==K){
      |               ^
a.cc:18:52: error: expected ';' before '}' token
   18 |         dp[i+1][j]=max(dp[i+1][j],dp[i][j]+a[i][k])
      |                                                    ^
      |                                                    ;
   19 |       }
      |       ~
Language: C

#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <vector>
#define rep(i,x,n) for(int i=x;i<n;i++)
#define repd(i,x,n) for(int i=x;i<=n;i++)
#define pii pair<int,int>
#define pll pair<long long ,long long>
#define gbtb ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define MS0(X) memset((X), 0, sizeof((X)))
#define MSC0(X) memset((X), '\0', sizeof((X)))
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define gg(x) getInt(&x)
using namespace std;
typedef long long ll;
inline void getInt(int* p);
const int maxn=1000010;
const int inf=0x3f3f3f3f;
/*** TEMPLATE CODE * * STARTS HERE ***/
ll n;
ll a[maxn];
ll b[maxn];
ll c[maxn];
ll dp[maxn][5];

int main()
{
    gbtb;
    cin>>n;
    repd(i,1,n)
    {
        cin>>a[i]>>b[i]>>c[i];
    }
    dp[1][1]=a[1];
    dp[1][2]=b[1];
    dp[1][3]=c[1];
    repd(i,2,n)
    {
        dp[i][1]+=max(dp[i-1][2],dp[i-1][3])+a[i];
        dp[i][2]+=max(dp[i-1][1],dp[i-1][3])+b[i];
        dp[i][3]+=max(dp[i-1][1],dp[i-1][2])+c[i];
    }
    cout<<max(dp[n][3],max(dp[n][1],dp[n][2]));
    return 0;
}

inline void getInt(int* p) {
    char ch;
    do {
        ch = getchar();
    } while (ch == ' ' || ch == '\n');
    if (ch == '-') {
        *p = -(getchar() - '0');
        while ((ch = getchar()) >= '0' && ch <= '9') {
            *p = *p * 10 - ch + '0';
        }
    }
    else {
        *p = ch - '0';
        while ((ch = getchar()) >= '0' && ch <= '9') {
            *p = *p * 10 + ch - '0';
        }
    }
}


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

#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
int main()
{
    int n,i,j,k;
    int a[100005][5];
    scanf("%d",&n);
    for(i = 1;i <= n;i++)
    scanf("%d %d %d",&a[i][1],&a[i][2],&a[i][3]);
    int dp[100005][5];
    memset(dp,0,sizeof(dp));
    dp[1][1] = a[1][1];
    dp[1][2] = a[1][2];
    dp[1][3] = a[1][3];
    for(i = 2;i <= n;i++)
    {
        for(j = 1;j < 4;j++)
        {
            for(k = 1;k < 4;k++)
            {
                if(k != j)
                {
                    if(dp[i][j] < dp[i - 1][k] + a[i][j])
                    dp[i][j] = dp[i - 1][k] + a[i][j];
                }
            }
        }
    }
    printf("%d\n",max(dp[n][1],max(dp[n][2],dp[n][3])));
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:32: error: 'max' was not declared in this scope; did you mean 'std::max'?
   31 |     printf("%d\n",max(dp[n][1],max(dp[n][2],dp[n][3])));
      |                                ^~~
      |                                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:31:19: error: 'max' was not declared in this scope; did you mean 'std::max'?
   31 |     printf("%d\n",max(dp[n][1],max(dp[n][2],dp[n][3])));
      |                   ^~~
      |                   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;
long long a[100000][3],f[100000][3],n;
int main()
{
    cin>>n;
    for (long i=1;i<=n;i++)
    for (long j=1;j<=3;j++) cin>>a[i][j];
    for (long i=1;i<=n;i++)
    {
        for (long j=1;j<=3;j++)
        {
                if (j==1) f[i][j]=max(f[i-1][2]+a[i][j],f[i-1][3]+a[i][j]);
                if (j==2) f[i][j]=max(f[i-1][1]+a[i][j],f[i-1][3]+a[i][j]);
                if (j==3) f[i][j]=max(f[i-1][1]+a[i][j],f[i-1][2]+a[i][j]);
        }
    }
    cout<<max(f[n][1],max(f[n][2],f[n][3]));
    return 0;
}


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

#include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;
long long i,j,n,smax,f[10005][5],a[10005][5];
int main()
    {
        cin>>n;
        for (i=1;i<=n;i++)
            for (j=1;j<=3;j++) cin>>a[i][j];
       ` f[1][1]=a[1][1];
 `       f[1][2]=a[1][2];
   `     f[1][3]=a[1][3];
        for (i=2;i<=n;i++)
            for (j=1;j<=3;j++)
        {
            if (j==1) f[i][j]=max(f[i-1][2],f[i-1][3]);
            if (j==2) f[i][j]=max(f[i-1][1],f[i-1][3]);
            if (j==3) f[i][j]=max(f[i-1][1],f[i-1][2]);
            f[i][j]=f[i][j]+a[i][j];
            smax=max(smax,f[i][j]);
        }
        cout<<smax;
        return 0;
    }


Compiler output:
a.cc:11:8: error: stray '`' in program
   11 |        ` f[1][1]=a[1][1];
      |        ^
a.cc:12:2: error: stray '`' in program
   12 |  `       f[1][2]=a[1][2];
      |  ^
a.cc:13:4: error: stray '`' in program
   13 |    `     f[1][3]=a[1][3];
      |    ^
Language: C

//
// Created by Pulak on 02-11-2019.
//
#include <bits/stdc++.h>
#include <iostream>

int n;

int solve(int day, int taken);

int a[100005], b[100005], c[100005];
using namespace std;

int main() {
    //lets say on last day the guy does activity a
    cin >> n;
    // int a[n], b[n], c[n];
    for (int i = 0; i < n; ++i) {
        cin >> a[i] >> b[i] >> c[i];
    }
    int ans1 = a[0] + solve(1, 'a');
    int ans2 = b[0]+solve(1, 'b');
   int ans3 = c[0]+solve(1, 'c');
    printf("%d", max(ans1,max( ans2,ans3)));
    
}

int solve(int day, int taken) {
    if(day > n - 1) return 0;
    if (day == n - 1) {
        if (taken == 'a')
            return max(b[n - 1], c[n - 1]);
        if (taken == 'b')
            return max(a[n - 1], c[n - 1]);
        return max(a[n - 1], b[n - 1]);
    }
    if (taken == 'a')
        return max(b[day] + solve(day + 1, 'b'), c[day] + solve(day + 1, 'c'));
    if (taken == 'b')
        return max(a[day] + solve(day + 1, 'a'), c[day] + solve(day + 1, 'c'));
    return max(a[day] + solve(day + 1, 'a'), b[day] + solve(day + 1, 'b'));
 
}


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

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

int arr[100001][3];
int dp[100001];

int solve (int n, int i, int cost) {
  if (i == n)
    return dp[i] = cost;
  if (dp[i] != -1)
    return dp[i];
  int mx = -1;
  for (int j = 0; j < 3; j++)
    mx = max(solve(n, i+1, cost+arr[i][j]));
  return dp[i] = mx;
}

int main () {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> arr[i][0] >> arr[i][1] >> arr[i][2];
  }
  memset(dp, -1, (n+1)*sizeof(int));
  cout << solve(n, 0, 0) << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int solve(int, int, int)':
a.cc:14:13: error: no matching function for call to 'max(int)'
   14 |     mx = max(solve(n, i+1, cost+arr[i][j]));
      |          ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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: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:
/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:
a.cc:14:13: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   14 |     mx = max(solve(n, i+1, cost+arr[i][j]));
      |          ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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
Language: C++

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

int arr[100001][3];
int dp[100001];

int solve (int n, int i, int cost) {
  if (i == n)
    return dp[i] = cost;
  if (dp[i] != -1)
    return dp[i];
  int mx = -1;
  for (int j = 0; j < 3; j++)
    mx = max(solve(i+1, cost+arr[i][j]));
  return dp[i] = mx;
}

int main () {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> arr[i][0] >> arr[i][1] >> arr[i][2];
  }
  memset(dp, -1, (n+1)*sizeof(int));
  cout << solve(n, 0, 0) << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int solve(int, int, int)':
a.cc:14:19: error: too few arguments to function 'int solve(int, int, int)'
   14 |     mx = max(solve(i+1, cost+arr[i][j]));
      |              ~~~~~^~~~~~~~~~~~~~~~~~~~~
a.cc:7:5: note: declared here
    7 | int solve (int n, int i, int cost) {
      |     ^~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;
using ll =long long;
using db = double;

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

#define che(a,string) cout<<"//"<<string <<"=="<<(a)<<"//" <<endl;
#define SORT(a) sort((a).begin(),(a).end())
#define rSORT(a) reverse((a).begin(),(a).end())
#define For(i, a, b)    for(int i = (a) ; i < (b) ; ++i)
#define rep(i, n)       For(i, 0, n)
#define leftunique(v) SORT(v);(v).erase(unique((v).begin(),(v).end()),(v).end())
//leftuniqueは配列から同じ要素のものを取り除く 例 4 6 2 1 3 4 1 2 なら 1 2 3 4 6 になる
bool IsInt(double a){int b = a/1;if(a==b){return true;}else {return false;}}
bool coY() {cout <<"Yes"<<endl;}
bool coN(){cout <<"No"<<endl;}
const int mod = 1e9 + 7;
const ll INF = 1LL << 60;

//ここから書き始める
int main()
{
	cout << setprecision(10);
	int n;
	cin >> n;
	int a[100100][2];
	rep(i,n){
		cin >> a[i][0] >> a[i][1] >> a[i][2] ;
	}
	ll dp[100100][2];
	
	rep(i,n){
		rep(j,3){
			rep(k,3){
				if(j != k){
					chmax(dp[i+1][j], dp[i] + a[i][k] );
				}
			}
		}
	}
	ll ans = 0;
	rep(i,3){
		chmax( ans, dp[n][i] );
	}
	cout << ans << endl;
	

}


Compiler output:
a.cc: In function 'bool coY()':
a.cc:18:32: warning: no return statement in function returning non-void [-Wreturn-type]
   18 | bool coY() {cout <<"Yes"<<endl;}
      |                                ^
a.cc: In function 'bool coN()':
a.cc:19:30: warning: no return statement in function returning non-void [-Wreturn-type]
   19 | bool coN(){cout <<"No"<<endl;}
      |                              ^
a.cc: In function 'int main()':
a.cc:39:46: error: no matching function for call to 'chmax(ll&, ll*)'
   39 |                                         chmax(dp[i+1][j], dp[i] + a[i][k] );
      |                                         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:8:31: note: candidate: 'template<class T> bool chmax(T&, T)'
    8 | template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
      |                               ^~~~~
a.cc:8:31: note:   template argument deduction/substitution failed:
a.cc:39:46: note:   deduced conflicting types for parameter 'T' ('long long int' and 'll*' {aka 'long long int*'})
   39 |                                         chmax(dp[i+1][j], dp[i] + a[i][k] );
      |                                         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C

#include <bits/stdc++.h>

using namespace std;
using ll =long long;
using db = double;

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

#define che(a,string) cout<<"//"<<string <<"=="<<(a)<<"//" <<endl;
#define SORT(a) sort((a).begin(),(a).end())
#define rSORT(a) reverse((a).begin(),(a).end())
#define For(i, a, b)    for(int i = (a) ; i < (b) ; ++i)
#define rep(i, n)       For(i, 0, n)
#define leftunique(v) SORT(v);(v).erase(unique((v).begin(),(v).end()),(v).end())
//leftuniqueは配列から同じ要素のものを取り除く 例 4 6 2 1 3 4 1 2 なら 1 2 3 4 6 になる
bool IsInt(double a){int b = a/1;if(a==b){return true;}else {return false;}}
bool coY() {cout <<"Yes"<<endl;}
bool coN(){cout <<"No"<<endl;}
const int mod = 1e9 + 7;
const ll INF = 1LL << 60;

//ここから書き始める
int main()
{
	cout << setprecision(10);
	int n; cin >> n;
	ll a[100100][3];
	rep(i,n){ 
		cin >> a[i][0] >> a[i][1] >> a[i][2];
	}
	vector<vector<ll>> dp(100100,vector<ll> (3));
	dp[0][0] = dp[0][1] = dp[0][2] = 0;
	for(int i =  1; i < n + 1 ; i ++){
		rep(j,3){
			rep(k,3){
				if(j!=k){
					chmax(dp[i][j],dp[i-1][k]+a[i-1][j]);
				}
			}
		}
	}
//	for(int i = 0 ; i <= n ; i++){
//		cout << "dp["<<i<<"]= " ;
//		for(int j = 0 ; j < 3 ;j ++){
//			cout << dp[i][j]<<" ";
//		}
//		cout << endl;
//	}
	ll ans = 0;
	rep(i,3){
		chmax(ans, dp[n][i]);
	}
	cout << ans << endl;

	

}


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;
#define ll int
int main(void)
{
 ll i,j,k,t,n;
 cin>>n;
 ll a[n+1][3];
 ll dp[n+1][3];
 for(i=1;i<=n;i++)
    {
     cin>>a[i][0]>>a[i][1]>>a[i][2];
	}
 dp[1][0]=a[1][0];
 dp[1][1]=a[1][1];
 dp[1][2]=a[1][2];
 for(i=2;i<=n;i++)
    {
     dp[i][0]=a[i][0]+max(dp[i-1][1],dp[i-1][2]);
     dp[i][1]=a[i][1]+max(dp[i-1][0],dp[i-1][2]);
     dp[i][2]=a[i][2]+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:23:11:   required from here
   23 |  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: Java

import java.util.*;
import java.io.*;
import java.lang.*;
// ArrayList<Integer>[] arr=new ArrayList[n];
public class Main_c{	
public static void main(String[] args) throws FileNotFoundException, IOException{
        Scanner s = new Scanner(System.in);
         StringBuilder sb=new StringBuilder();
         BufferedWriter out=new BufferedWriter(new OutputStreamWriter(System.out));
         int n=s.nextInt();
        int[][] act=new int[n+1][3];
        int[][] dp=new int[n+1][2]; dp[0][0]=5;
        for(int i=1;i<=n;i++){
            act[i][0]=s.nextInt();act[i][1]=s.nextInt();act[i][2]=s.nextInt();
        }
        for(int i=1;i<=n;i++){
            for(int j=0;j<3;j++){
                if(j!=dp[i-1][0]&&dp[i-1][1]+act[i][j]>dp[i][1]){
                        dp[i][1]=dp[i-1][1]+act[i][j];
                        dp[i][0]=j;
                }
            }
        }

        System.out.println(dp[n][1]);
    }
}

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

#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
typedef long long ll;
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define REP(i,num,n) for(ll i=num, i##_len=(n); i<i##_len; ++i)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define print(x) cout << (x) << endl;
#define pb push_back
#define mp make_pair
#define sz(x) int(x.size())
 
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
const int INF = 1e9;
const ll LLINF = 1e16;

template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value!=0>::type
fill_v(U &u,const V... v){u=U(v...);}

template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value==0>::type
fill_v(U &u,const V... v){
  for(auto &e:u) fill_v<T>(e,v...);
}
 
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, -1, 1, -1};


ll dp[100100][3];

int main(void){
    cout.tie(0);
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout<<fixed<<setprecision(10);
    ll N;
    cin >> N;
    vector<ll> a(N);
    vector<ll> b(N);
    vector<ll> c(N);
    rep(i,N) cin >> a[i] >> b[i] >> c[i];
    dp[0][0] = a[i];
    dp[0][1] = b[i];
    dp[0][2] = c[i];
    rep(i,N){
      dp[i+1][0] = max(dp[i][1] + a[i], dp[i][2] + a[i]);
      dp[i+1][1] = max(dp[i][0] + b[i], dp[i][2] + b[i]);
      dp[i+1][2] = max(dp[i][0] + c[i], dp[i][1] + c[i]);
    }
    ll ans = 0;
    rep(i,3) chmax(ans, dp[N-1][i]);
    print(ans);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:55:18: error: 'i' was not declared in this scope
   55 |     dp[0][0] = a[i];
      |                  ^
Language: C++

#include <iostream>
using namespace std;

constexpr int MAXN = 1e5 + 1;
int days[MAXN][3];
int happiness[MAXN][3];
// happiness[i][j]: happiness in first i days, not choosing j on the ith day

int main(void)
{
  int N;
  cin >> N;
  for (int i = 0; i < N; i++)
    cin >> days[i][0] >> days[i][1] >> days[i][2];

  for (int i = 0; i < N; i++)
    for (int j = 0; j < 3; j++)
      for (int k = 0; k < 3; k++)
        if (j != k)
          happiness[i + 1][j] =
              max(happiness[i + 1][j], happiness[i][k] + days[i][k]);

  int ans = max({happiness[N][0], happiness[N][1], happiness[N][2]});
  cout << ans << "\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:16: error: no matching function for call to 'max(<brace-enclosed initializer list>)'
   23 |   int ans = max({happiness[N][0], happiness[N][1], happiness[N][2]});
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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: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
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include <cmath>
#include <limits>
#include <utility>
#include <map>
#include <iomanip>
#include <queue>
#include <cctype>
#include <stack>
#include <random>
#include <list>
#include <numeric>
#include <chrono>
#include <set>


#define rep(i,p,q) for(ll i = p;i < q;i++)
#define ll long long

using namespace std;

vector<vector<ll>> graph;
vector<ll> query;
vector<ll> ans;
vector<ll> visited;


const long long MAX_N = 1 << 17;

long long dat[2 * MAX_N - 1];

ll ecd(ll a, ll b) {
	if (a < b) swap(a, b);
	if (b == 0) return a;
	else {
		return ecd(b, a % b);
	}
}

ll pow(ll a, ll b) {
	vector<ll> d = vector<ll>((ll)(log(b)) + 2);
	d[0] = a;
	rep(i, 1, d.size()) d[i] = d[i - 1] * d[i - 1];
	ll ret = 1;
	rep(i, 0, log(b) + 1) {
		if (b & 1 << i) ret *= d[i];
	}
	return ret;
}

//C
int main(void) {
	ll n;
	cin >> n;
	vector<ll> a = vector<ll>(n), b = vector<ll>(n), c = vector<ll>(n);
	rep(i, 0, n) cin >> a[i];
	rep(i, 0, n) cin >> b[i];
	rep(i, 0, n) cin >> c[i];
	vector<ll> aDP = vector<ll>(n), vector<ll> bDP = vector<ll>(n), vector<ll> cDP = vector<ll>(n);
	aDP[0] = a[0];
	bDP[0] = b[0];
	cDP[0] = c[0];
	rep(i, 1, n) {
		aDP[i] = a[i] + max(bDP[i - 1], cDP[i - 1]);
		bDP[i] = b[i] + max(aDP[i - 1], cDP[i - 1]);
		cDP[i] = c[i] + max(bDP[i - 1], aDP[i - 1]);
	}
	cout << max(aDP[n - 1], max(bDP[n - 1], cDP[n - 1])) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:62:52: error: invalid declarator before 'bDP'
   62 |         vector<ll> aDP = vector<ll>(n), vector<ll> bDP = vector<ll>(n), vector<ll> cDP = vector<ll>(n);
      |                                                    ^~~
a.cc:64:9: error: 'bDP' was not declared in this scope; did you mean 'aDP'?
   64 |         bDP[0] = b[0];
      |         ^~~
      |         aDP
a.cc:65:9: error: 'cDP' was not declared in this scope; did you mean 'aDP'?
   65 |         cDP[0] = c[0];
      |         ^~~
      |         aDP