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

#include<cstdio>
#include<cstring>
char s[100][100];
int n,c;
bool isvalid(int i,int j)
{
	return i>=0 && i<n && j>=0 && j<n;
}

int dx[]={0,0,1,-1,1,-1,-1,1};
int dy[]={1,-1,0,0,1,-1,1,-1};


void floodfill(int i,int j)
{int k;
	if(!isvalid(i,j))
		return ;
	
	else if(s[i][j]=='0')
		return ;
	else if(s[i][j]=='1')
	{s[i][j]='0';
		c++;
		for(k=0;k<8;k++)
		{
			floodfill(i+dx[k],j+dy[k]);}	}

}

int main()
{
	int i,j,k,m;
	int x,t;
	 char st[10];
	scanf("%d",&t);
	getchar();gets(st);
	for(x=1;x<=t;x++)
	{
		i=0;
		while(gets(st))
		{
			if(strcmp(st,"")==0)
				break;
			strcpy(s[i++],st);

		}
		n=i;

		m=0;
		for(i=0;i<n;i++)
		{
			for(j=0;j<n;j++)
			{
				if(s[i][j]=='1')
				{c=0;
					floodfill(i,j);
					if(c>m)
						m=c;
				}
			}
		}
		printf("%d\n",m);
		if(x!=t)
			puts("");
	}
	return 0;
}

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

#include<cstdio>
#include<cstring>
char s[100][100];
int n,c;
bool isvalid(int i,int j)
{
	return i>=0 && i<n && j>=0 && j<n;
}

int dx[]={0,0,1,-1,1,-1,-1,1};
int dy[]={1,-1,0,0,1,-1,1,-1};


void floodfill(int i,int j)
{int k;
	if(!isvalid(i,j))
		return ;
	
	else if(s[i][j]=='0')
		return ;
	else if(s[i][j]=='1')
	{s[i][j]='0';
		c++;
		for(k=0;k<8;k++)
		{
			floodfill(i+dx[k],j+dy[k]);}	}

}

int main()
{
	int i,j,k,m;
	int x,t;
	 char st[10];
	scanf("%d",&t);
	getchar();gets(st);
	for(x=1;x<=t;x++)
	{
		i=0;
		while(gets(st))
		{
			if(strcmp(st,"")==0)
				break;
			strcpy(s[i++],st);

		}
		n=i;

		m=0;
		for(i=0;i<n;i++)
		{
			for(j=0;j<n;j++)
			{
				if(s[i][j]=='1')
				{c=0;
					floodfill(i,j);
					if(c>m)
						m=c;
				}
			}
		}
		printf("%d\n",m);
		if(x!=t)
			puts("");

	}
	return 0;

}


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

#include<cstdio>
#include<cstring>
char s[100][100];
int n,c;
bool isvalid(int i,int j)
{
	return i>=0 && i<n && j>=0 && j<n;
}

int dx[]={0,0,1,-1,1,-1,-1,1};
int dy[]={1,-1,0,0,1,-1,1,-1};

void floodfill(int i,int j)
{int k;
	if(!isvalid(i,j))
		return ;
	else if(s[i][j]=='0')
		return ;
	else if(s[i][j]=='1')
	{s[i][j]='0';
		c++;
		for(k=0;k<8;k++)
		{
			floodfill(i+dx[k],j+dy[k]);}
	}
}

int main()
{
	int i,j,k,m;
	int x,t;
	 char st[10];
	scanf("%d",&t);
	getchar();gets(st);
	for(x=1;x<=t;x++)
	{
		i=0;
		while(gets(st))
		{
			if(strcmp(st,"")==0)
				break;
			strcpy(s[i++],st);

		}
		n=i;

		m=0;
		for(i=0;i<n;i++)
		{
			for(j=0;j<n;j++)
			{
				if(s[i][j]=='1')
				{c=0;
					floodfill(i,j);
					if(c>m)
						m=c;
				}
			}
		}
		printf("%d\n",m);
		if(x!=t)
			puts("");
	}
	return 0;
}


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

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int no_of_days;
    cin >> no_of_days;

    typedef vector <int> v_int;
    v_int swim_happiness(no_of_days + 1);
    v_int bug_happiness(no_of_days + 1);
    v_int homework_happiness(no_of_days + 1);

    for(int i = 1; i <= no_of_days; i++)
        cin >> swim_happiness[i] >> bug_happiness[i] >> homework_happiness[i];

    const int NO_OF_TYPES = 3;
    vector <v_int> maximum_happiness(no_of_days + 1, v_int(NO_OF_TYPES, 0));

    const int SWIM_TODAY = 0, BUG_TODAY = 1, HOMEWORK_TODAY = 2;
    for(int i = 1; i <= no_of_days; i++)
    {
        maximum_happiness[i][SWIM_TODAY] = swim_happiness[i] + max(maximum_happiness[i - 1][BUG_TODAY], maximum_happiness[i - 1][HOMEWORK_TODAY]);

        maximum_happiness[i][BUG_TODAY] = bug_happiness[i] + max(maximum_happiness[i - 1][HOMEWORK_TODAY], maximum_happiness[i - 1][SWIM_TODAY]);

        maximum_happiness[i][HOMEWORK_TODAY] = homework_happiness[i] + max(maximum_happiness[i - 1][SWIM_TODAY], maximum_happiness[i - 1][BUG_TODAY]);
    }

    int overall_happiness = max_3(maximum_happiness[no_of_days][SWIM_TODAY], maximum_happiness[no_of_days][BUG_TODAY], maximum_happiness[no_of_days][HOMEWORK_TODAY]);

    cout << overall_happiness;
    return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:29:29: error: 'max_3' was not declared in this scope
   29 |     int overall_happiness = max_3(maximum_happiness[no_of_days][SWIM_TODAY], maximum_happiness[no_of_days][BUG_TODAY], maximum_happiness[no_of_days][HOMEWORK_TODAY]);
      |                             ^~~~~
Language: C

#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<tuple>
#include<map>
#include<queue>
#include<math.h>
#include<numeric>
#include<iomanip>
#define rep(i, n) rep2(i,0,n)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define PI acos(-1);
typedef long long ll;
using namespace std;
const int MOD = 1000000007;
//scanf("%d", &a); '\n';

int main() {
	//ios::sync_with_stdio(false);
	//cin.tie(0);
	int n;
	cin >> n;
	vector<int> dp_a(n + 1, -MOD), dp_b(n + 1, -MOD), dp_c(n + 1, -MOD);
	cin >> dp_a[0] >> dp_b[0] >> dp_c[0];
	rep2(i, 1, n) {
		int a, b, c;
		cin >> a >> b >> c;
		dp_a[i] = max(dp_b[i-1], dp_c[i-1]) + a;
		dp_b[i] = max(dp_a[i-1], dp_c[i-1]) + b;
		dp_c[i] = max(dp_a[i - 1], dp_b[i - 1]) + c;
	}
	cout << max(max(dp_a[n - 1], dp_b[n - 1]), dp_c[n - 1]);
}



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

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

int main(){
 	
  int n;
  cin>>n;
  
  int a[n],b[n],c[n];
  
  for(int i=0;i<n;i++)
      cin>>a[i]>>b[i]>>c[i];
  
  int dp[n][3];
  
  memset(dp,(int)1e9+5,sizeof dp);
  dp[i][0] = a[0];
  dp[i][1] = b[0];
  dp[i][2] = c[0];
 
  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] = min(dp[i][j],dp[i-1][k]+(k==0?a[i]:(k==1?b[i]:c[i]))); 
  }
  
  cout<<min(dp[n-1][0],min(dp[n-1][1],dp[n-1][2]));
}


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

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

int main(){
 	
  int n;
  cin>>n;
  
  int a[n],b[n],c[n];
  
  for(int i=0;i<n;i++)
      cin>>a[i]>>b[i]>>c[i];
  
  int dp[n][3];
  
  memset(dp,(int)1e9+5,sizeof dp);
  dp[i][0] = a[0];
  dp[i][1] = b[0];
  dp[i][2] = c[0];
 
  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] = min(dp[i][j],dp[i-1][k]+(k==0?a[i]:(k==1?b[i]:c[i]))); 
  }
  
  min(d[n-1][0],min(dp[n-1][1],dp[n-1][2]));
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:6: error: 'i' was not declared in this scope
   17 |   dp[i][0] = a[0];
      |      ^
a.cc:28:7: error: 'd' was not declared in this scope; did you mean 'dp'?
   28 |   min(d[n-1][0],min(dp[n-1][1],dp[n-1][2]));
      |       ^
      |       dp
Language: C++

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

int N;

int limitrofe = 1e5+5;



int diario[3][limitrofe];




int tasks[limitrofe][3];



int cosa(int a, int i){
	if(i == N){
     return 0;
     }
	if(diario[a][i] != -1) {
        return diario[a][i];
    }
	int& ans = diario[a][i];

        if(a==0){
		ans=max(ans, cosa(1, i+1)+tasks[i][0]);
		ans=max(ans, cosa(2, i+1)+tasks[i][0]);
	}
        if(a==1){
		ans=max(ans, cosa(0, i+1)+tasks[i][1]);
		ans=max(ans, cosa(2, i+1)+tasks[i][1]);
        }
	if(a==2){
		ans=max(ans, cosa(0, i+1)+tasks[i][2]);
		ans=max(ans, cosa(1, i+1)+tasks[i][2]);
	}

	return ans;
}
int main(){
	cin>>N;
	for(int i=0; i<N; i++) {
        cin>>tasks[i][0]>>tasks[i][1]>>tasks[i][2];
	}
	memset(diario, -1, sizeof diario);
	cout<<max(cosa(0,0),max(cosa(1,0),cosa(2,0)))<<"\n";
	return 0;
}


Compiler output:
a.cc:10:15: error: size of array 'diario' is not an integral constant-expression
   10 | int diario[3][limitrofe];
      |               ^~~~~~~~~
a.cc:15:11: error: size of array 'tasks' is not an integral constant-expression
   15 | int tasks[limitrofe][3];
      |           ^~~~~~~~~
Language: Java

package vacation;
import java.util.*;

public class vacation{
	public static int[][] arr;
	public static int n;
	public static int max = 0;
	public static void fn(int day, int choice, int fun){
		if (day == n){
			if (fun>max)
				max = fun;
		}
		else{
		if (choice==0){
			fn(day+1,2,fun+arr[day][choice]);
			fn(day+1,1,fun+arr[day][choice]);}
		if (choice==1){
			fn(day+1,2,fun+arr[day][choice]);
			fn(day+1,0,fun+arr[day][choice]);}
		if (choice==2){
			fn(day+1,0,fun+arr[day][choice]);
			fn(day+1,1,fun+arr[day][choice]);}
		}
	}
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		arr = new int[n][3];
		int i = 0;
		int j = 0;
		for(i=0;i<n;i+=1)
			for(j=0;j<3;j+=1)
				arr[i][j] = sc.nextInt();
		fn(0,0,0);
		fn(0,1,0);
		fn(0,2,0);
		System.out.println(max);
	}
}


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

import java.util.*;

public class main{
	public static int[][] arr;
	public static int n;
	public static int max = 0;
	public static void fn(int day, int choice, int fun){
		if (day == n){
			if (fun>max)
				max = fun;
		}
		else{
		if (choice==0){
			fn(day+1,2,fun+arr[day][choice]);
			fn(day+1,1,fun+arr[day][choice]);}
		if (choice==1){
			fn(day+1,2,fun+arr[day][choice]);
			fn(day+1,0,fun+arr[day][choice]);}
		if (choice==2){
			fn(day+1,0,fun+arr[day][choice]);
			fn(day+1,1,fun+arr[day][choice]);}
		}
	}
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		arr = new int[n][3];
		int i = 0;
		int j = 0;
		for(i=0;i<n;i+=1)
			for(j=0;j<3;j+=1)
				arr[i][j] = sc.nextInt();
		fn(0,0,0);
		fn(0,1,0);
		fn(0,2,0);
		System.out.println(max);
	}
}


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

import java.util.*;

public class vacation{
	public static int[][] arr;
	public static int n;
	public static int max = 0;
	public static void fn(int day, int choice, int fun){
		if (day == n){
			if (fun>max)
				max = fun;
		}
		else{
		if (choice==0){
			fn(day+1,2,fun+arr[day][choice]);
			fn(day+1,1,fun+arr[day][choice]);}
		if (choice==1){
			fn(day+1,2,fun+arr[day][choice]);
			fn(day+1,0,fun+arr[day][choice]);}
		if (choice==2){
			fn(day+1,0,fun+arr[day][choice]);
			fn(day+1,1,fun+arr[day][choice]);}
		}
	}
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		arr = new int[n][3];
		int i = 0;
		int j = 0;
		for(i=0;i<n;i+=1)
			for(j=0;j<3;j+=1)
				arr[i][j] = sc.nextInt();
		fn(0,0,0);
		fn(0,1,0);
		fn(0,2,0);
		System.out.println(max);
	}
}


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

#include <bits/stdc++.h>

#define mod 1000000007

#define rep(i, n) for(int i=0; i<n; ++i)

using namespace std;
typedef long long ll;
const long long INF = 1LL << 60;

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;
}

 
int main(void){
	
	int N;
	
	cin >> N;
	
	ll a[N][3];
	
	rep(i, N)
		cin >> a[i][0] >> a[i][1] >> a[i][2];
	
	ll dp[110000][3];

	rep(i, 110000)
		rep(j, 3)
			dp[i][j] = 0;

	rep(i, N){
		rep(j, 3){
			rep(k, 3){
				if(j != k)
					chmax(dp[i+1][k], dp[i][j] + a[i][k]);
			}
		}
	}
	ll ans = 0;
	rep(i, 3)
		chmax(ans, dp[N][j]);
	cout << ans << endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:54:34: error: 'j' was not declared in this scope
   54 |                 chmax(ans, dp[N][j]);
      |                                  ^
Language: C

import sys
 
stdin = sys.stdin
 
mod = 1000000007
inf = 1 << 60
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()
nas = lambda: stdin.readline().split()
 
n = ni()
 
abc = [na() for i in range(n)]
dp = [3 * [0] for i in range(n)]
dp[0][0] = abc[0][0]
dp[0][1] = abc[0][1]
dp[0][2] = abc[0][2]
 
for i in range(n - 1):
    for j in range(3):
        for k in range(3):
            if k != j:
                dp[i + 1][j] = max(dp[i + 1][j], dp[i][k] + abc[i + 1][j])
 
ans = max(dp[n - 1][0], dp[n - 1][1], dp[n - 1][2])
print(ans)

Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import sys
      | ^~~~~~
main.c:3:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'stdin'
    3 | stdin = sys.stdin
      | ^~~~~
Language: C++

#include<iostream>
#include<vector>
#include<initializer_list>
using namespace std;
void ChangeMax(int&a, int b){
  if(a < b)a = b;
}
int main(){
  int n; cin >> n;
  vector<vector<int>> v(n,vector<int>(3));
  for(auto&e:v)for(auto&ee:e)cin >> ee;
  vector<vector<int>> dp(n, vector<int>(6, 0));
  for(int i = 0; i < n - 1; ++i){
    for(int j = 0; j < 6; ++j){
      for(int k = 0; k < 3; ++k){
        if(j >= 3){
          int idx = j - 3;
          if(idx != k)ChangeMax(dp[i+1][k],dp[i][j] + v[i][k]);
        }
        else if(j == k)ChangeMax(dp[i+1][k+3], dp[i][j] + v[i][k]);
        else ChangeMax(dp[i+1][k], dp[i][j] + v[i][k]);
      }
    }
  }
  cout << max({dp[n-1][0],dp[n-1][1],dp[n-1][2],dp[n-1][3],dp[n-1][4],dp[n-1][5]}) << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:14: error: no matching function for call to 'max(<brace-enclosed initializer list>)'
   25 |   cout << max({dp[n-1][0],dp[n-1][1],dp[n-1][2],dp[n-1][3],dp[n-1][4],dp[n-1][5]}) << endl;
      |           ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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<initializer_list>
using namespace std;
void ChangeMax(int&a, int b){
  if(a < b)a = b;
}
int main(){
  int n; cin >> n;
  vector<vector<int>> v(n,vector<int>(3));
  for(auto&e:v)for(auto&ee:e)cin >> ee;
  vector<vector<int>> dp(n, vector<int>(6, 0));
  for(int i = 0; i < n - 1; ++i){
    for(int j = 0; j < 6; ++j){
      for(int k = 0; k < 3; ++k){
        if(j >= 3){
          int idx = j - 3;
          if(idx != k)ChangeMax(dp[i+1][k],dp[i][j] + v[i][k]);
        }
        else if(j == k)ChangeMax(dp[i+1][k+3], dp[i][j] + v[i][k]);
        else ChangeMax(dp[i+1][k], dp[i][j] + v[i][k])
      }
    }
  }
  cout << max({dp[n-1][0],dp[n-1][1],dp[n-1][2],dp[n-1][3],dp[n-1][4],dp[n-1][5]}) << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:55: error: expected ';' before '}' token
   21 |         else ChangeMax(dp[i+1][k], dp[i][j] + v[i][k])
      |                                                       ^
      |                                                       ;
   22 |       }
      |       ~                                                
a.cc:25:14: error: no matching function for call to 'max(<brace-enclosed initializer list>)'
   25 |   cout << max({dp[n-1][0],dp[n-1][1],dp[n-1][2],dp[n-1][3],dp[n-1][4],dp[n-1][5]}) << endl;
      |           ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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>
using namespace std;
void ChangeMax(int&a, int b){
  if(a < b)a = b;
}
int main(){
  int n; cin >> n;
  vector<vector<int>> v(n,vector<int>(3));
  for(auto&e:v)for(auto&ee:e)cin >> ee;
  vector<vector<int>> dp(n, vector<int>(6, 0));
  for(int i = 0; i < n - 1; ++i){
    for(int j = 0; j < 6; ++j){
      for(int k = 0; k < 3; ++k){
        if(j >= 3){
          int idx = j - 3;
          if(idx != k)ChangeMax(dp[i+1][k],dp[i][j] + v[i][k])
        }
        else if(j == k)ChangeMax(dp[i+1][k+3], dp[i][j] + v[i][k]);
        else ChangeMax(dp[i+1][k], dp[i][j] + v[i][k])
      }
    }
  }
  cout << max({dp[n-1][0],dp[n-1][1],dp[n-1][2],dp[n-1][3],dp[n-1][4],dp[n-1][5]}) << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:63: error: expected ';' before '}' token
   17 |           if(idx != k)ChangeMax(dp[i+1][k],dp[i][j] + v[i][k])
      |                                                               ^
      |                                                               ;
   18 |         }
      |         ~                                                      
a.cc:20:55: error: expected ';' before '}' token
   20 |         else ChangeMax(dp[i+1][k], dp[i][j] + v[i][k])
      |                                                       ^
      |                                                       ;
   21 |       }
      |       ~                                                
a.cc:24:14: error: no matching function for call to 'max(<brace-enclosed initializer list>)'
   24 |   cout << max({dp[n-1][0],dp[n-1][1],dp[n-1][2],dp[n-1][3],dp[n-1][4],dp[n-1][5]}) << endl;
      |           ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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++

n = int(input())
ABCs = [list(map(int, input().split())) for i in range(n)]

last = -1

dp = [[None]*3 for i in range(n)]
dp[0] = [0,0,0]
# print(dp)

#dp[i][j] := i日目に行動jを選択したときの幸福度の総和の最大値

for i in range(n+1):
    if i == 0:
        continue
    if i == 1:
        dp[i-1][0] = ABCs[i-1][0]
        dp[i-1][1] = ABCs[i-1][1]
        dp[i-1][2] = ABCs[i-1][2]
        continue
    for j in range(3):

        actions = ABCs[i-1]

        # j以外の選択の中で，最大の幸福をもっているやつ + j
    
        dp[i-1][j] = max([dp[i-2][k] for k in range(3) if k != j]) + ABCs[i-1][j]

print(max(dp[n-1]))

Compiler output:
a.cc:8:3: error: invalid preprocessing directive #print
    8 | # print(dp)
      |   ^~~~~
a.cc:10:2: error: invalid preprocessing directive #dp
   10 | #dp[i][j] := i日目に行動jを選択したときの幸福度の総和の最大値
      |  ^~
a.cc:24:11: error: invalid preprocessing directive #j\U00004ee5\U00005916\U0000306e\U00009078\U0000629e\U0000306e\U00004e2d\U00003067\U0000ff0c\U00006700\U00005927\U0000306e\U00005e78\U0000798f\U00003092\U00003082\U00003063\U00003066\U00003044\U0000308b\U00003084\U00003064
   24 |         # j以外の選択の中で，最大の幸福をもっているやつ + j
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:1:1: error: 'n' does not name a type
    1 | n = int(input())
      | ^
Language: C++

#include<stdio.h>
#include<string.h>
int LCS[110][110];
char mother[110],father[110];
int main()
{
    int term=1,i,j,x,y;
    while(1)
    {
        gets(mother);
        if(mother[0]=='#')break;
        gets(father);
        x = strlen(mother);
        y = strlen(father);
        memset(LCS,0,sizeof(LCS));
        for(i=1;i<=x;i++)
        {
            for(j=1;j<=y;j++)
            {
                if(mother[i-1]==father[j-1])LCS[i][j]=LCS[i-1][j-1]+1;
                else if(LCS[i][j-1]<=LCS[i-1][j])LCS[i][j] = LCS[i-1][j];
                else LCS[i][j] = LCS[i][j-1];
            }
        }
        printf("Case #%d: you can visit at most %d cities.\n",term,LCS[x][y]);
        term++;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
   10 |         gets(mother);
      |         ^~~~
      |         getw
Language: Java

import java.util.Scanner;

public class Vacation {
    private static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) {
        int N = sc.nextInt();
        int[][] vacation = new int[N][3];

        for(int i=0;i<N;++i) {
            vacation[i][0] = sc.nextInt();
            vacation[i][1] = sc.nextInt();
            vacation[i][2] = sc.nextInt();
        }

        int[][] solution = new int[N][3];
        solution[0][0] = vacation[0][0];
        solution[0][1] = vacation[0][1];
        solution[0][2] = vacation[0][2];

        for(int i=1;i<N;++i) {
            solution[i][0] = vacation[i][0] + Math.max(solution[i-1][1], solution[i-1][2]);
            solution[i][1] = vacation[i][1] + Math.max(solution[i-1][0], solution[i-1][2]);
            solution[i][2] = vacation[i][2] + Math.max(solution[i-1][0], solution[i-1][1]);
        }

        System.out.println(Math.max(Math.max(solution[N-1][0], solution[N-1][1]), solution[N-1][2]));
    }
}


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

#include<bits/stdc++.h>
#define lli long long int
using namespace std;

int main(){
  lli n;
  cin >> n;
  lli a[n], b[n], c[n];
  for(lli i = 0; i<n;i++)
    {
    cin >> a[i] >> b[i] >> c[i];
  }
  lli dp[n][3];
  dp[0][0] = a[0];
  dp[0][1] = b[0];
  dp[0][2] = c[0];
  
  for(lli i = 1; i<n: i++)
    {
    dp[i][j] = max(dp[i-1][(j+1)%3], dp[i-1][(j+2)%3]) + a[i];
                   
  }
  cout << max(dp[n-1][0], max(dp[n-1][1], dp[n-1][2]));
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:18:18: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
   18 |   for(lli i = 1; i<n: i++)
      |                  ^
a.cc:18:21: error: found ':' in nested-name-specifier, expected '::'
   18 |   for(lli i = 1; i<n: i++)
      |                     ^
      |                     ::
a.cc:18:20: error: 'n' is not a class, namespace, or enumeration
   18 |   for(lli i = 1; i<n: i++)
      |                    ^
a.cc:24:3: error: expected primary-expression before '}' token
   24 |   }
      |   ^
a.cc:23:56: error: expected ')' before '}' token
   23 |   cout << max(dp[n-1][0], max(dp[n-1][1], dp[n-1][2]));
      |                                                        ^
      |                                                        )
   24 |   }
      |   ~                                                     
a.cc:18:6: note: to match this '('
   18 |   for(lli i = 1; i<n: i++)
      |      ^
a.cc:24:3: error: expected primary-expression before '}' token
   24 |   }
      |   ^
Language: C++

  
#include <stdio.h>
#include <string.h>
int used[35][35], cnt = 0;
int n;
char g[35][35];
void dfs(int i, int j) {
    if(i >= n || i < 0 || j < 0)
        return;
    if(g[i][j] != '1' || used[i][j])  return;
    cnt++;
    used[i][j] = 1;
    dfs(i+1, j);
    dfs(i+1, j-1);
    dfs(i+1, j+1);
    dfs(i-1, j);
    dfs(i-1, j+1);
    dfs(i-1, j-1);
    dfs(i, j+1);
    dfs(i, j-1);
}
int main() {
    int t;
    scanf("%d", &t);
    gets(g[0]);
    gets(g[0]);
    while(t--) {
        n = 0;
        memset(g, 0, sizeof(g));
        while(gets(g[n])) {
            if(g[n][0] == '\0') break;
            n++;
        }
        memset(used, 0, sizeof(used));
        int ans = 0, i, j;
        for(i = 0; i < n; i++) {
            for(j = 0; g[i][j]; j++) {
                if(used[i][j] == 0 && g[i][j] == '1') {
                    cnt = 0;
                    dfs(i, j);
                    if(cnt > ans)
                        ans = cnt;
                }
            }
        }
        printf("%d\n", ans);
        if(t)
            puts("");
    }
    return 0;
}
/*
1
11000
01100
00101
10001
01011
*/

Compiler output:
a.cc: In function 'int main()':
a.cc:25:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
   25 |     gets(g[0]);
      |     ^~~~
      |     getw
Language: C++

#include <stdio.h>
#include <string.h>
int used[35][35], cnt = 0;
int n;
char g[35][35];
void dfs(int i, int j) {
    if(i >= n || i < 0 || j < 0)
        return;
    if(g[i][j] != '1' || used[i][j])  return;
    cnt++;
    used[i][j] = 1;
    dfs(i+1, j);
    dfs(i+1, j-1);
    dfs(i+1, j+1);
    dfs(i-1, j);
    dfs(i-1, j+1);
    dfs(i-1, j-1);
    dfs(i, j+1);
    dfs(i, j-1);
}
int main() {
    int t;
    scanf("%d", &t);
    gets(g[0]);
    gets(g[0]);
    while(t--) {
        n = 0;
        memset(g, 0, sizeof(g));
        while(gets(g[n])) {
            if(g[n][0] == '\0') break;
            n++;
        }
        memset(used, 0, sizeof(used));
        int ans = 0, i, j;
        for(i = 0; i < n; i++) {
            for(j = 0; g[i][j]; j++) {
                if(used[i][j] == 0 && g[i][j] == '1') {
                    cnt = 0;
                    dfs(i, j);
                    if(cnt > ans)
                        ans = cnt;
                }
            }
        }
        printf("%d\n", ans);
        if(t)
            puts("");
    }
    return 0;
}
/*
1
11000
01100
00101
10001
01011
*/

Compiler output:
a.cc: In function 'int main()':
a.cc:24:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
   24 |     gets(g[0]);
      |     ^~~~
      |     getw
Language: C++

#include <iostream>

using namespace std;

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

    int hap[n][3];
    for (int i = 0; i < n; ++i) {
        std::cin >> hap[i][0] >> hap[i][1] >> hap[i][2];
    }

    int dp[n][3];
    dp[0][0] = hap[0][0];
    dp[0][1] = hap[0][1];
    dp[0][2] = hap[0][2];

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

    std::cout << max({dp[n - 1][0], dp[n - 1][1], dp[n - 1][2]});

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:21: error: no matching function for call to 'max(<brace-enclosed initializer list>)'
   25 |     std::cout << max({dp[n - 1][0], dp[n - 1][1], dp[n - 1][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<bits/stdc++.h>
using namespace std;
int dp[100001];
int solve(int n,int a[],int b[],int c[])
{
    if(n<0)
    return 0;
    if(dp[n]!=-1)
    return dp[n];
    int ans=0,d=0,p=0,s=0;
    d=a[n];
    p=b[n];
    s=c[n];
    if(d==0)
    d=0;
    if(p==0)
    p=0;
    if(s==0)
    s=0;
    ans=max(d+solve(n-1,b,b,c),p+solve(n-1,a,c,c));
    ans=max(ans,c[n]+solve(n-1,a,b,a));
    return  dp[n]=ans;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int i,n;
    cin>>n;
    for(i=0;i<=100000;i++)
    dp[i]=-1
    int a[n],b[n],c[n];
    for(i=0;i<n;i++)
    {
        cin>>a[i];
        cin>>b[i];
        cin>>c[i];
    }
    cout<<solve(n-1,a,b,c);

}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:13: error: expected ';' before 'int'
   32 |     dp[i]=-1
      |             ^
      |             ;
   33 |     int a[n],b[n],c[n];
      |     ~~~      
a.cc:36:14: error: 'a' was not declared in this scope
   36 |         cin>>a[i];
      |              ^
a.cc:37:14: error: 'b' was not declared in this scope
   37 |         cin>>b[i];
      |              ^
a.cc:38:14: error: 'c' was not declared in this scope
   38 |         cin>>c[i];
      |              ^
a.cc:40:21: error: 'a' was not declared in this scope
   40 |     cout<<solve(n-1,a,b,c);
      |                     ^
a.cc:40:23: error: 'b' was not declared in this scope
   40 |     cout<<solve(n-1,a,b,c);
      |                       ^
a.cc:40:25: error: 'c' was not declared in this scope
   40 |     cout<<solve(n-1,a,b,c);
      |                         ^
Language: C++

#include <iostream>

using namespace std;
const int s= 1e5+5
int data[s][3];
int dp [s][3];
int n;
int vacation(int a,int i){
if(i == n) return 0;
	if(dp[i][a] != -1) return dp[i][a];
	int& ans = dp[i][a];

	if(a==0){
		ans=max(ans, vacation(1, i+1)+data[i][0]);
		ans=max(ans, vacation(2, i+1)+data[i][0]);
	}
	if(a==1){
		ans=max(ans, vacation(0, i+1)+data[i][1]);
		ans=max(ans, vacation(2, i+1)+data[i][1]);
	}
	if(a==2){
		ans=max(ans, vacation(0, i+1)+data[i][2]);
		ans=max(ans, vacation(1, i+1)+data[i][2]);
	}

	return ans;
}

int main()
{
 cin >> n;
    for(int i=0;i<n;i++){
        for(int j=0; j<3;j++){
            cin >> data[i][j];
            dp[i][j]=-1;
        }

    }
 int result = max(max(vacation(0,0),vacation(1,0)),vacation(2,0));
    cout << result << endl;
 return 0;

}

Compiler output:
a.cc:5:1: error: expected ',' or ';' before 'int'
    5 | int data[s][3];
      | ^~~
a.cc: In function 'int vacation(int, int)':
a.cc:14:51: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   14 |                 ans=max(ans, vacation(1, i+1)+data[i][0]);
      |                                                   ^
a.cc:15:51: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   15 |                 ans=max(ans, vacation(2, i+1)+data[i][0]);
      |                                                   ^
a.cc:18:51: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   18 |                 ans=max(ans, vacation(0, i+1)+data[i][1]);
      |                                                   ^
a.cc:19:51: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   19 |                 ans=max(ans, vacation(2, i+1)+data[i][1]);
      |                                                   ^
a.cc:22:51: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   22 |                 ans=max(ans, vacation(0, i+1)+data[i][2]);
      |                                                   ^
a.cc:23:51: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   23 |                 ans=max(ans, vacation(1, i+1)+data[i][2]);
      |                                                   ^
a.cc: In function 'int main()':
a.cc:34:24: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   34 |             cin >> data[i][j];
      |                        ^
Language: C++

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

}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:5: error: 'maximum' was not declared in this scope; did you mean 'fmaximum'?
   39 |     maximum=max(maximum,dp[i][j]);
      |     ^~~~~~~
      |     fmaximum
a.cc:39:31: error: 'j' was not declared in this scope
   39 |     maximum=max(maximum,dp[i][j]);
      |                               ^
a.cc:41:9: error: 'maximum' was not declared in this scope; did you mean 'fmaximum'?
   41 |   cout<<maximum<<"/n";
      |         ^~~~~~~
      |         fmaximum
Language: C++

#include <iostream>

int arr[100000][3];

int main()
{
	int n;
	int a, b, c;
	std::cin >> n;
	for (int i = 0; i < n; i++)
	{
		std::cin >> a;
		std::cin >> b;
		std::cin >> c;
		arr[i][0] = a;
		arr[i][1] = b;
		arr[i][2] = c;
	}
	for (int i = n-1; 0 <= i; i--)
	{
		for (int j = 0; j < 3; j++)
		{
			int max = INT_MIN;
			for (int k = 0; k < 3; k++)
			{
				if (k!=j) {
					if (arr[i+1][k]>max) {
						max = arr[i + 1][k];
					}
				}
			}
			arr[i][j] += max;
		}
	}
	int max = INT_MIN;
	for (int i = 0; i < 3; i++)
	{
		if (arr[0][i]>max) {
			max = arr[0][i];
		}
	}
	std::cout << max << std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:35: error: 'INT_MIN' was not declared in this scope
   23 |                         int max = 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 | 
a.cc:35:19: error: 'INT_MIN' was not declared in this scope
   35 |         int max = INT_MIN;
      |                   ^~~~~~~
a.cc:35:19: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
Language: C++

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

struct val
  {
  int a,b,c;
  };

int main()
{
 int n;
  std::vector<val> days;
  std::vector<val> dp;
  std::cin>>n;
  val cur {0,0,0};
  
  for (int i {}; i < n; i++)
    {
      std::cin>>cur.a>>cur.b>>cur.c;
    days[i]=cur;
    dp[i]={-1000000000,-1000000000,-1000000000};
    }
  
  dp[0]=days[0];
  for (int d {1}; d < n; d++)
    {
       dp[d].a=days[d].a + std::max(dp[d-1].b, dp[d-1].c);
       dp[d].b=days[d].b + std::max(dp[d-1].a, dp[d-1].c);
    dp[d].c=days[d].c + std::max(dp[d-1].b, dp[d-1].a);
    }
  
  std::cout<<std::max(dp[n-1].a, std::max(dp[n-1].b, dp[n-1].c));
  }
    }
}

Compiler output:
a.cc:35:5: error: expected declaration before '}' token
   35 |     }
      |     ^
a.cc:36:1: error: expected declaration before '}' token
   36 | }
      | ^
Language: C++

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

struct val
  {
  int a,b,c;
  }

int main()
{
 int n;
  std::vector<val> days;
  std::vector<val> dp;
  std::cin>>n;
  val cur {0,0,0};
  
  for (int i {}; i < n; i++)
    {
      std::cin>>cur.a>>cur.b>>cur.c;
    days[i]=cur;
    dp[i]={-1000000000,-1000000000,-1000000000};
    }
  
  dp[0]=days[0];
  for (int d {1}; d < n; d++)
    {
       dp[d].a=days[d].a + std::max(dp[d-1].b, dp[d-1].c);
       dp[d].b=days[d].b + std::max(dp[d-1].a, dp[d-1].c);
    dp[d].c=days[d].c + std::max(dp[d-1].b, dp[d-1].a);
    }
  
  std::cout<<std::max(dp[n-1].a, std::max(dp[n-1].b, dp[n-1].c));
  }
    }
}

Compiler output:
a.cc:8:4: error: expected ';' after struct definition
    8 |   }
      |    ^
      |    ;
a.cc:35:5: error: expected declaration before '}' token
   35 |     }
      |     ^
a.cc:36:1: error: expected declaration before '}' token
   36 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  int a[n][3];
  int c=0;
  for(int i=0;i<n;i++)
  {
    for(int j=0;j<3;j++)
    {
      cin>>a[i][j];
    }
  }
  int flag=-1;
   for(int i=0;i<n;i++)
  {     
    if(a[i][0]>a[i][1]&&flag!=0)
    {
      if(a[i][0]>a[i][2])
      {c+=a[i][0];
       flag=0;}
    }
    if(a[i][1]>a[i][0]&&flag!=1)
    {
      if(a[i][1]>a[i][2])
      {c+=a[i][1];
       flag=1;}
    }
  }
   if(a[i][2]>a[i][0]&&flag!=2)
    {
      if(a[i][2]>a[i][1])
      {c+=a[i][2];
       flag=2;}
    }
    cout<<c;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:9: error: 'i' was not declared in this scope
   31 |    if(a[i][2]>a[i][0]&&flag!=2)
      |         ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define itn int
#define int long long
#define mod 1000000007
#define INFi 2147483647
#define INFl 9223372036854775807LL
#define fi first
#define se second
#define be begin()
#define en end()
#define re reverse
int abs(int a,int b){
    return max(a,b)-min(a,b);
}
int a,b[100000][10];
int c[100000][10];
signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);    
    cin>>a;
    int d=0;
    for(int i=0;i<a;i++){
      for(int j=0;j<3;j++) cin>>b[i][j];
    }
    c[0][0]=b[0][0],c[0][1]=b[0][1],c[0][2]=b[0][2];
    for(int i=1;i<a;i++){
      c[i][0]=b[i][0]+max(c[i-1][1],c[i-1][2]);
      c[i][1]=b[i][1]+max(c[i-1][0],c[i-1][2]);
      c[i][2]=b[i][2]+max(c[i-1][0],c[i-1][1]);
    }
    for(int i=0;i<3;i++)d=max(d,c[a-1][i]);
    cout<<d<<"\n";
}
#include<bits/stdc++.h>
using namespace std;
#define itn int
#define int long long
#define mod 1000000007
#define INFi 2147483647
#define INFl 9223372036854775807LL
#define fi first
#define se second
#define be begin()
#define en end()
#define re reverse
int abs(int a,int b){
    return max(a,b)-min(a,b);
}
int a,b[100000][10];
int c[100000][10];
signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);    
    cin>>a;
    int d=0;
    for(int i=0;i<a;i++){
      for(int j=0;j<3;j++) cin>>b[i][j];
    }
    c[0][0]=b[0][0],c[0][1]=b[0][1],c[0][2]=b[0][2];
    for(int i=1;i<a;i++){
      c[i][0]=b[i][0]+max(c[i-1][1],c[i-1][2]);
      c[i][1]=b[i][1]+max(c[i-1][0],c[i-1][2]);
      c[i][2]=b[i][2]+max(c[i-1][0],c[i-1][1]);
    }
    for(int i=0;i<3;i++)d=max(d,c[a-1][i]);
    cout<<d<<"\n";
}


Compiler output:
a.cc:47:5: error: redefinition of 'long long int abs(long long int, long long int)'
   47 | int abs(int a,int b){
      |     ^~~
a.cc:13:5: note: 'long long int abs(long long int, long long int)' previously defined here
   13 | int abs(int a,int b){
      |     ^~~
a.cc:50:5: error: redefinition of 'long long int a'
   50 | int a,b[100000][10];
      |     ^
a.cc:16:5: note: 'long long int a' previously declared here
   16 | int a,b[100000][10];
      |     ^
a.cc:50:7: error: redefinition of 'long long int b [100000][10]'
   50 | int a,b[100000][10];
      |       ^
a.cc:16:7: note: 'long long int b [100000][10]' previously declared here
   16 | int a,b[100000][10];
      |       ^
a.cc:51:5: error: redefinition of 'long long int c [100000][10]'
   51 | int c[100000][10];
      |     ^
a.cc:17:5: note: 'long long int c [100000][10]' previously declared here
   17 | int c[100000][10];
      |     ^
a.cc:52:8: error: redefinition of 'int main()'
   52 | signed main(){
      |        ^~~~
a.cc:18:8: note: 'int main()' previously defined here
   18 | signed main(){
      |        ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define itn int
#define int long long
#define mod 1000000007
#define INFi 2147483647
#define INFl 9223372036854775807LL
#define fi first
#define se second
#define be begin()
#define en end()
#define re reverse
int abs(int a,int b){
    return max(a,b)-min(a,b);
}
int a,b[100000][10];
int c[100000][10];
signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);    
    cin>>a;
    int d=0;
    for(int i=0;i<a;i++){
      for(int j=0;j<3;j++) cin>>b[i][j];
    }
    c[0][0]=b[0][0],c[0][1]=b[0][1],c[0][2]=b[0][2];
    for(int i=1;i<a;i++){
      c[i][0]=b[i][0]+max(c[i-1][1],c[i-1][2]);
      c[i][1]=b[i][1]+max(c[i-1][0],c[i-1][2]);
      c[i][2]=b[i][2]+max(c[i-1][0],c[i-1][1]);
    }
    for(int i=0;i<3;i++)d=max(d,c[a-1][i]);
    cout<<d<<"\n";


Compiler output:
a.cc: In function 'int main()':
a.cc:33:19: error: expected '}' at end of input
   33 |     cout<<d<<"\n";
      |                   ^
a.cc:18:14: note: to match this '{'
   18 | signed main(){
      |              ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
#define dd double
#define rep(i, n) for(int i = 0; i < n; i++)
#define REP(i,a,b) for(int i=a;i<b;i++)
#define rep1(i,b) for(int i=1;i<=b;i++)
#define pb push_back
#define mp make_pair
#define clr(x) x.clear()
#define sz(x) ((int)(x).size())
#define F first
#define S second
#define vec vector<int,int> 
#define int long long 


signed main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	//ios_base& scientific (ios_base& str);
	
	int t;
//	cin>>t;
	while(t--){
		int n;
		cin>>n;
		int dp[n+1][3]={0};
		int arr[n][3];
		//arr[0]=0;
		rep(i,n){
			rep(j,3){
			cin>>arr[i][j];
			}
		}
		rep(i,n){
			rep(j,3){
				dp[i][j]=0;
			}
		}
		for(int i=1;i<=n;i++){
			rep(j,3){
				dp[i][j]=arr[i-1][j]+max(dp[i-1][(j+1)%3],dp[i-1][(j+2)%3]);
			}
		
		cout<<max(dp[n][0],max(dp[n][1],dp[n][2]));
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:50:2: error: expected '}' at end of input
   50 | }
      |  ^
a.cc:19:15: note: to match this '{'
   19 | signed main() {
      |               ^
Language: C++

#include <stdio.h>
#include<algorithm>
using namespace std;
int dp[2][3];
int memo[3];
int k[2] = { 0,1 };

int main(){
    int day;
    scanf_s("%d", &day); 
    int i = 1;
    while (day--) {
        scanf("%d%d%d", &memo[0], &memo[1], &memo[2]);
        dp[k[i % 2]][0] = memo[0] + max(dp[k[(i + 1) % 2]][1], dp[k[(i + 1) % 2]][2]);
        dp[k[i % 2]][1] = memo[1] + max(dp[k[(i + 1) % 2]][0], dp[k[(i + 1) % 2]][2]);
        dp[k[i % 2]][2] = memo[2] + max(dp[k[(i + 1) % 2]][1], dp[k[(i + 1) % 2]][0]);
        i++;
    }
    printf("%d\n", max(max(dp[k[(i + 1) % 2]][0], dp[k[(i + 1) % 2]][1]), dp[k[(i + 1) % 2]][2]));
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   10 |     scanf_s("%d", &day);
      |     ^~~~~~~
      |     scanf
Language: C++

#include <stdio.h>
#include<algorithm>
using namespace std;
int dp[2][3];
int memo[3];
int k[2] = { 0,1 };

int main(){
    int day;
    scanf_s("%d", &day); 
    int i = 1;
    while (day--) {
        scanf_s("%d%d%d", &memo[0], &memo[1], &memo[2]);
        dp[k[i % 2]][0] = memo[0] + max(dp[k[(i + 1) % 2]][1], dp[k[(i + 1) % 2]][2]);
        dp[k[i % 2]][1] = memo[1] + max(dp[k[(i + 1) % 2]][0], dp[k[(i + 1) % 2]][2]);
        dp[k[i % 2]][2] = memo[2] + max(dp[k[(i + 1) % 2]][1], dp[k[(i + 1) % 2]][0]);
        i++;
    }
    printf("%d\n", max(max(dp[k[(i + 1) % 2]][0], dp[k[(i + 1) % 2]][1]), dp[k[(i + 1) % 2]][2]));
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   10 |     scanf_s("%d", &day);
      |     ^~~~~~~
      |     scanf
Language: C++

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

int solve(int n,int a[][],int dp[][])
{
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<3;j++)
        {
            if(i==0)
            {
                dp[i][j]=a[i][j];
            }
            else if(j==0)
            {
                dp[i][0]=a[i][0]+max(dp[i-1][1],dp[i-1][2]);
            }
            else if(j==1)
            {
                dp[i][1]=a[i][1]+max(dp[i-1][0],dp[i-1][2]);
            }
            else if(j==2)
            {
                dp[i][2]=a[i][2]+max(dp[i-1][1],dp[i-1][0]);
            }
        }
    }
    return max(max(dp[n-1][0],dp[n-1][1]),dp[n-1][2]);
}
int main()
{
  int n;
  cin>>n;
  int a[n][3],dp[n][3];
  for(int i=0;i<n;i++)
  {
      for(int j=0;j<3;j++)
      {
          cin>>a[i][j];
          dp[i][j]=-1;
      }
  }
  int ans=0;
  ans=solve(n,a,dp);
  cout<<ans;
  return 0;
}

Compiler output:
a.cc:4:21: error: declaration of 'a' as multidimensional array must have bounds for all dimensions except the first
    4 | int solve(int n,int a[][],int dp[][])
      |                     ^
a.cc:4:26: error: expected ')' before ',' token
    4 | int solve(int n,int a[][],int dp[][])
      |          ~               ^
      |                          )
a.cc:4:27: error: expected unqualified-id before 'int'
    4 | int solve(int n,int a[][],int dp[][])
      |                           ^~~