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

import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Deque;
import java.util.HashMap;
import java.util.InputMismatchException;
import java.util.Map;
import java.util.PriorityQueue;
import java.math.BigInteger;
    
public class Main{

static final InputStream in=System.in;
static final PrintWriter out=new PrintWriter(System.out);
static final int INF=Integer.MAX_VALUE/2;
static final long LINF=Long.MAX_VALUE/2;
static int N,D;
static int[] T,A,B,C;
static int[][] dp;

public static void main(String[] args) throws IOException{
InputReader ir=new InputReader(in);
N=ir.nextInt();
D=ir.nextInt();
T=ir.toIntArray(D);
A=new int[N];
B=new int[N];
C=new int[N];
for(int i=0;i<N;i++){
A[i]=ir.nextInt();
B[i]=ir.nextInt();
C[i]=ir.nextInt();
}
dp=new int[D+1][N];
for(int i=0;i<D;i++) Arrays.fill(d[i],Integer.MIN_VALUE);
for(int i=D-1;i>=0;i--){
for(int j=N-1;j>=0;j--){
if(T[i]>=A[j]&&T[i]<=B[j]){
for(int k=0;k<N;k++){
if(dp[i+1][k]!=Integer.MIN_VALUE) dp[i][j]=Math.max(dp[i][j],dp[i+1][k]+Math.abs(C[k]-C[j]));
}
}
}
}
int ans=0;
for(int i=0;i<N;i++) if(dp[0][i]>0) ans=Math.max(ans,dp[0][i]);
out.println(ans);
out.flush();
}

static class InputReader {
private InputStream in;
private byte[] buffer=new byte[1024];
private int curbuf;
private int lenbuf;

public InputReader(InputStream in) {this.in=in;}
  
public int readByte() {
if(lenbuf==-1) throw new InputMismatchException();
if(curbuf>=lenbuf){
curbuf= 0;
try{
lenbuf=in.read(buffer);
}
catch (IOException e) {
throw new InputMismatchException();
}
if(lenbuf<=0)
return -1;
}
return buffer[curbuf++];
}

public boolean isSpaceChar(int c){return !(c>=33&&c<=126);}

private int skip() {int b; while((b = readByte())!=-1&&isSpaceChar(b)); return b;}

public String next() {
int b=skip();
StringBuilder sb=new StringBuilder();
while(!isSpaceChar(b)){
sb.appendCodePoint(b);
b=readByte();
}
return sb.toString();
}
 
public int nextInt() {
int c=readByte();
while (isSpaceChar(c)) c=readByte();
boolean minus=false;
if (c=='-') {
minus=true;
c=readByte();
}
int res=0;
do{
if(c<'0'||c>'9') throw new InputMismatchException();
res=res*10+c-'0';
c=readByte();
}while(!isSpaceChar(c));
return (minus)?-res:res;
}

public long nextLong() {
int c=readByte();
while (isSpaceChar(c)) c=readByte();
boolean minus=false;
if (c=='-') {
minus=true;
c=readByte();
}
long res = 0;
do{
if(c<'0'||c>'9') throw new InputMismatchException();
res=res*10+c-'0';
c=readByte();
}while(!isSpaceChar(c));
return (minus)?-res:res;
}

public int[] toIntArray(int n){
int[] a=new int[n];
for(int i=0;i<n;i++) a[i]=nextInt();
return a;
}
}
}

Compiler output:
Main.java:40: error: cannot find symbol
for(int i=0;i<D;i++) Arrays.fill(d[i],Integer.MIN_VALUE);
                                 ^
  symbol:   variable d
  location: class Main
1 error
Language: Java

import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Deque;
import java.util.HashMap;
import java.util.InputMismatchException;
import java.util.Map;
import java.util.PriorityQueue;
import java.math.BigInteger;
    
public class Main{

static final InputStream in=System.in;
static final PrintWriter out=new PrintWriter(System.out);
static final int INF=Integer.MAX_VALUE/2;
static final long LINF=Long.MAX_VALUE/2;
static int D,N;
static int[] T,A,B,C;
static int[][] dp;

public static void main(String[] args) throws IOException{
InputReader ir=new InputReader(in);
D=ir.nextInt();
N=ir.nextInt();
T=ir.toIntArray(D);
A=new int[N];
B=new int[N];
C=new int[N];
for(int i=0;i<N;i++){
A[i]=ir.nextInt();
B[i]=ir.nextInt();
C[i]=ir.nextInt();
}
dp=new int[D][N];
for(int i=0;i<D-1;i++) Arrays.fill(dp[i],Integer.MIN_VALUE);
for(int i=D-2;i>=0;i--){
for(int j=N-1;j>=0;j--){
if(T[i]>=A[j]&&T[i]<=B[j]){
for(int k=0;k<N;k++){
if(T[i+1]>=A[k]&&T[i+1]<=B[k]&&dp[i+1][k]=>0) dp[i][j]=Math.max(dp[i][j],dp[i+1][k]+Math.abs(C[k]-C[j]));
}
}
}
}
int ans=0;
for(int i=0;i<N;i++) ans=Math.max(ans,dp[0][i]);
out.println(ans);
out.flush();
}

static class InputReader {
private InputStream in;
private byte[] buffer=new byte[1024];
private int curbuf;
private int lenbuf;

public InputReader(InputStream in) {this.in=in;}
  
public int readByte() {
if(lenbuf==-1) throw new InputMismatchException();
if(curbuf>=lenbuf){
curbuf= 0;
try{
lenbuf=in.read(buffer);
}
catch (IOException e) {
throw new InputMismatchException();
}
if(lenbuf<=0)
return -1;
}
return buffer[curbuf++];
}

public boolean isSpaceChar(int c){return !(c>=33&&c<=126);}

private int skip() {int b; while((b = readByte())!=-1&&isSpaceChar(b)); return b;}

public String next() {
int b=skip();
StringBuilder sb=new StringBuilder();
while(!isSpaceChar(b)){
sb.appendCodePoint(b);
b=readByte();
}
return sb.toString();
}
 
public int nextInt() {
int c=readByte();
while (isSpaceChar(c)) c=readByte();
boolean minus=false;
if (c=='-') {
minus=true;
c=readByte();
}
int res=0;
do{
if(c<'0'||c>'9') throw new InputMismatchException();
res=res*10+c-'0';
c=readByte();
}while(!isSpaceChar(c));
return (minus)?-res:res;
}

public long nextLong() {
int c=readByte();
while (isSpaceChar(c)) c=readByte();
boolean minus=false;
if (c=='-') {
minus=true;
c=readByte();
}
long res = 0;
do{
if(c<'0'||c>'9') throw new InputMismatchException();
res=res*10+c-'0';
c=readByte();
}while(!isSpaceChar(c));
return (minus)?-res:res;
}

public int[] toIntArray(int n){
int[] a=new int[n];
for(int i=0;i<n;i++) a[i]=nextInt();
return a;
}
}
}

Compiler output:
Main.java:45: error: illegal start of expression
if(T[i+1]>=A[k]&&T[i+1]<=B[k]&&dp[i+1][k]=>0) dp[i][j]=Math.max(dp[i][j],dp[i+1][k]+Math.abs(C[k]-C[j]));
                                          ^
1 error
Language: C++

#include <algorithm>
#include <iostream>
#include <array>
#include <vector>
#include <cmath>
using namespace std;
 
const int D=200;
const int N=200;
 
struct Clothes{
    int max_t;
    int min_t;
    int c;
};
 
int main(){
    int d,n;
    array<array<int,N>,D> dp;
    vector<Clothes> clt;
    vector<int> tmp;
 
    cin>>d>>n;
 
    tmp.resize(d);
 
    for( auto &t : tmp ) cin>>t;
 
    clt.resize(n);
 
    for( auto &t : clt ) cin>>t.min_t>>t.max_t>>t.c;
 
    for( auto &x : dp ){
        for( auto &y : x ){
            y=0;
        }
    }
 
    for( int i=1 ; i<d ; i++ ){
        for( int j=0 ; j<n ; j++ ){
            if( tmp[i] >= clt[j].min_t && tmp[i] <= clt[j].max_t ){
                for( int k=0 ; k<n ; k++){
                    if( tmp[i-1] >= clt[k].min_t && tmp[i-1] <= clt[k].max_t ){
                        dp[i][j]=max(dp[i][j],abs(clt[j].c-clt[k].c)+dp[i-1][k]);
                    }
                }
            }
        }
    }
 
    cout << accumulate(dp[d-1].begin(),dp[d-1].begin()+n,0,[](int a,int b){ return ( a>b ? a : b ); }) <<endl;
 
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:51:13: error: 'accumulate' was not declared in this scope
   51 |     cout << accumulate(dp[d-1].begin(),dp[d-1].begin()+n,0,[](int a,int b){ return ( a>b ? a : b ); }) <<endl;
      |             ^~~~~~~~~~
Language: C++

#include<stdio.h>

int D,N;
int zettai;
int ans=0;

void search(int days,int list[][N],int goukei,int mae){
	if(days==D){
		if(ans<goukei){
			ans=goukei;
		}
		return;
	}
	int i;
	for(i=0;i<N;i++){
		if(list[days][i]!=-1){
			zettai=mae-list[days][i];
			if(zettai<0){
				zettai=zettai*(-1);
			}
			search(days+1,list,goukei+zettai,list[days][i]);
		}
	}
	return;
}
	
	
int main(){
	int i,j;
	scanf("%d %d",&D,&N);
	int temp[D];
	for(i=0;i<D;i++){
		scanf("%d",&temp[i]);
	}
	int list[D][N];
	int min[N],max[N],hade[N];
	for(i=0;i<N;i++){
		scanf("%d %d %d",&min[i],&max[i],&hade[i]);
		for(j=0;j<D;j++){
			list[j][i]=-1;
		}
	}
	for(i=0;i<D;i++){
		for(j=0;j<N;j++){
			if(min[j]<=temp[i]&&temp[i]<=max[j]){
				list[i][j]=hade[j];
			}
		}
	}
	for(i=0;i<N;i++){
		if(list[0][i]!=-1){
			search(1,list,0,list[0][i]);
		}
	}
	printf("%d",ans);
	return 0;
}

Compiler output:
a.cc:7:33: error: size of array 'list' is not an integral constant-expression
    7 | void search(int days,int list[][N],int goukei,int mae){
      |                                 ^
a.cc: In function 'int main()':
a.cc:52:34: error: cannot convert 'int (*)[N]' to 'int (*)[1]'
   52 |                         search(1,list,0,list[0][i]);
      |                                  ^~~~
      |                                  |
      |                                  int (*)[N]
a.cc:7:26: note:   initializing argument 2 of 'void search(int, int (*)[1], int, int)'
    7 | void search(int days,int list[][N],int goukei,int mae){
      |                      ~~~~^~~~~~~~~
Language: C++

#include<stdio.h>
#include<math.h>
//abs .. 絶対値を返す関数　がある。


int n,d;
int dp[205][205];
//dp[a][b] .. a日目にb番目の服を着るような状態のうち、得られる得点の最大値。着れなければ十分小さい数

int hukup[205];
int hukdw[205];
int hukha[205];
int ond[205];


int inf = -1000000;


int max(int p,int q){
	if(p<q)return q;
	return p;
}

int main(void){
	memset(dp,-1,sizeof(dp));
	scanf("%d%d",&d,&n);
	for(int i=1;i<=d;i++){
		scanf("%d",&ond[i]);
	}
	for(int i=1;i<=n;i++){
		scanf("%d%d%d",&hukdw[i],&hukup[i],&hukha[i]);
	}
	//入力の受付ここまで
	
	for(int j=1;j<=n;j++){
		if(hukdw[j]<=ond[1] && ond[1]<=hukup[j]){
			dp[1][j] = 0;
		}
		else{
			dp[1][j] = inf;
		}
	}
	//初日を初期化。
	
	for(int i=2;i<=d;i++){
		for(int j=1;j<=n;j++){
			//i日目に、j番目の服を着るときの最大値
			if(hukdw[j]<=ond[i] && ond[i]<=hukup[j]){
				//着られる
				dp[i][j]=0;
				for(int k=1;k<=n;k++){
					//現在の最大値と、(前日にkを着て、今日jを着るようなパターン) のうち、大きい方をとっていく
					dp[i][j] = max(dp[i][j] , dp[i-1][k] + abs(hukha[j]-hukuha[k]) );
				}
			}
			else{
				//着られない
				dp[i][j] = inf;
			}
		}
	}
	
	int ans = 0;
	for(int j=1;j<=n;j++){
		//最終日のうちの、最大値
		ans = max(ans,dp[d][j]);
	}
	printf("%d\n",ans);
	return 0;
}

	
	
	

Compiler output:
a.cc: In function 'int main()':
a.cc:25:9: error: 'memset' was not declared in this scope
   25 |         memset(dp,-1,sizeof(dp));
      |         ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<math.h>
  +++ |+#include <cstring>
    3 | //abs .. 絶対値を返す関数　がある。
a.cc:53:93: error: 'hukuha' was not declared in this scope; did you mean 'hukha'?
   53 |                                         dp[i][j] = max(dp[i][j] , dp[i-1][k] + abs(hukha[j]-hukuha[k]) );
      |                                                                                             ^~~~~~
      |                                                                                             hukha
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <queue>
#include <set>
#include <complex>
using namespace std;
#define FOR(i,k,n) for(int i = (k); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) begin(a),end(a)
#define MS(m,v) memset(m,v,sizeof(m))
#define D10  fixed<<setprecision(10)
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int, int> P;
typedef complex<double> Point;
typedef long long ll;
const int INF = 114514810;
const int MOD = 1000000007;
const double EPS = 1e-8;
const double PI = acos(-1.0);
struct edge
{
  int from, to, cost;
  bool operator < (const edge& e) const { return cost < e.cost; }
  bool operator >(const edge& e) const { return cost > e.cost; }
};
///*************************************************************************************///
///*************************************************************************************///
///*************************************************************************************///

struct huku
{
	int x,y,z;
};
int D,N;
int dp[205][205];
int d[205];
huku h[205];

int solve(int i, int j)
{
	if(dp[i][j] >=0) return dp[i][j];
	if(i==D) return 0;
	int res = 0;
	if(i==0)
	{
		REP(k,N)
		{	
			if(d[i]>=h[k].x&&d[i]<=h[k].y) res = max(res,solve(i+1,k));
		}
	}
	else
	{
		REP(k,N)
		{
			if(d[i]>=h[k].x&&d[i]<=h[k].y) res = max(res,solve(i+1,k)+abs(h[k].z-h[j].z));
		}
	}
	return dp[i][j] = res;
}

int main()
{
	MS(dp,-1);
	cin>>D>>N;
	REP(i,D) cin>>d[i];
	REP(i,N)
	{
		int a,b,c;cin>>a>>b>>c;
		huku t = {a,b,c};
		h[i] = t;
	}
	cout<<solve(0,0)<<endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:17: error: 'memset' was not declared in this scope
   12 | #define MS(m,v) memset(m,v,sizeof(m))
      |                 ^~~~~~
a.cc:66:9: note: in expansion of macro 'MS'
   66 |         MS(dp,-1);
      |         ^~
a.cc:8:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    7 | #include <complex>
  +++ |+#include <cstring>
    8 | using namespace std;
Language: C++

#include <cstdio>
#include <iostream>
using namespace std;

typedef struct{
	int a; //下限
	int b; //上限
	int c; //派手さ
}clothes;

int d, n;
int t[200];
clothes p[200];

long dp[202][201];

long rec(int x, int y){ //x日目,前の日にきてた服y
	if(dp[x][y]>=0) return dp[x][y];
	
	long ret=0;
	if(x==0){
		for(int i=0; i<n; ++i){
			if(p[i].a<=t[x] && t[x]<=p[i].b){
				int tmp=rec(x+1, i);	
				if(ret<tmp) ret=tmp;
			}
		}	
	}
	else if(x==d) return 0;	
	else{
		for(int i=0; i<n; ++i){
			if(p[i].a<=t[x] && t[x]<=p[i].b){
				int cc=p[i].c-p[y].c;
				if(cc<0) cc=-cc;
				
				int tmp=rec(x+1, i)+cc;	
				if(ret<tmp) ret+=tmp;
			}
		}	
	}
	
	return dp[x][y]=ret;
}

int main(){
	scanf(" %d %d", &d, &n);
	for(int i=0; i<d; ++i) scanf(" %d", &t[i]);
	for(int i=0; i<n; ++i) scanf(" %d %d %d", &p[i].a, &p[i].b, &p[i].c);
	
	memset(dp, -1, sizeof(dp));
	printf("%ld\n", rec(0,0));	
}

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

#include<iostream>
#include<camth>

using namespace std;

int d,n;
int tenki[202];
int saiko[101],saitei[101];
int hade[101];
int dp[201][101];

int hot(int d,int f){
	if(dp[d][f]!=0)return dp[d][f];
	if(d==0){
		cout<<d<<"a "<<f<<" "<<endl;
		return dp[d][f]=0;
	}
	int ans=0;
	for(int i=1;i<=n;i++){
		if(saitei[i]<=tenki[d]&&tenki[d]<=saiko[i]){
			ans=max(ans,hot(d-1,i)+abs(hade[i]-hade[f]));
		}
		cout<<d<<"asi "<<f<<" "<<ans<<endl;
	}
	cout<<d<<"as "<<f<<" "<<ans<<endl;
	return dp[d][f]=ans;
}

int main(){
	cin>>d>>n;
	for(int i=1;i<=d;i++){
		cin>>tenki[i];
	}
	for(int i=1;i<=n;i++){
		cin>>saitei[i]>>saiko[i]>>hade[i];
	}
	int ans=0;
	for(int i=1;i<=n;i++){
		if(saitei[i]<=tenki[d-1]&&tenki[d-1]<=saiko[i]){
			ans=max(ans,hot(d-1,i));
		}
	}
	cout<<ans<<endl;
	return 0;
}

Compiler output:
a.cc:2:9: fatal error: camth: No such file or directory
    2 | #include<camth>
      |         ^~~~~~~
compilation terminated.
Language: C++

#include<iostream>
using namespace std;
//dp[i][j]: i??\???j???????????????c_x_(i)-c_x_(i-1)????????§???
int dp[201][201];
int main(){
    int d,n,ans=0;
    cin>>d>>n;
    int a[201],b[201],c[201],tem[201];
    memset(dp,0,sizeof(dp));
    for(int i=0;i<d;i++)
        cin>>tem[i];
    for(int i=0;i<n;i++)
        cin>>a[i]>>b[i]>>c[i];
    for(int m=1;m<d;m++)
        for(int i=0;i<n;i++)
            for(int j=0;j<n;j++)
                if(a[i]<=tem[m]&&tem[m]<=b[i]  &&  a[j]<=tem[m-1]&&tem[m-1]<=b[j])
                    dp[m][i]=max(dp[m][i],abs(c[i]-c[j])+dp[m-1][j]);
    for(int i=0;i<n;i++)
        ans=max(ans,dp[d-1][i]);
    cout<<ans<<endl;
}

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

#include<iostream>
#include<algorithm>
using namespace std;

int dp[201][61], d, n, t[61], a[201], b[201], c[201], mx = 0;

int abs(int x, int y)
{
	if (x >= y) return x - y;
	else return y - x;
}

int main()
{
	cin >> d >> n;
	for (int i = 1; i <= d; i++){
		cin >> t[i];
	}
	for (int i = 1; i <= n; i++){
		cin >> a[i] >> b[i] >> c[i];
	}
	memset(dp, -1, sizeof dp);

	for (int i = 1; i <= n; i++){
		if (a[i] <= t[1] && t[1] <= b[i]){
			dp[1][i] = 0;
		}
	}

	//dp
	for (int today = 2; today <= d; today++){
		for (int n2 = 1; n2 <= n; n2++){
			for (int n1 = 1; n1 <= n; n1++){
				if (dp[today - 1][n1] == -1) continue;
				if (a[n2] > t[today] || t[today] > b[n2]) continue;
				dp[today][n2] = max(dp[today][n2], dp[today - 1][n1] + abs(c[n1], c[n2]));
			}
		}
	}

	for (int i = 1; i < n; i++){
		mx = max(dp[d][i], mx);
	}
	cout << mx << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:9: error: 'memset' was not declared in this scope
   22 |         memset(dp, -1, 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;
int dp[250][150],T[250],x[250][3],D,N,MAX;
memset(dp,-1000000,sizeof(dp));
main(){ 
    cin>>D>>N;
    for(int i=1;i<=D;i++){cin>>T[i];}
    for(int i=1;i<=N;i++){
        cin>>x[i][0]>>x[i][1]>>x[i][2];
        if(T[1]>=x[i][0] && T[1]<=x[i][1]){dp[1][x[i][2]]=0;}
    }
    for(int i=2;i<=D;i++){
        for(int j=1;j<=N;j++){
            if(T[i]>=x[j][0] && T[i]<=x[j][1]){
                for(int k=0;k<=100;k++){
                    dp[i][x[j][2]]=max(dp[i][x[j][2]],dp[i-1][k]+abs(x[j][2]-k));
                }
            }
        }
    }
    for(int i=0;i<=100;i++){MAX=max(MAX,dp[D][i]);}
    cout<<MAX<<endl;
    return 0;
}

Compiler output:
a.cc:4:7: error: expected constructor, destructor, or type conversion before '(' token
    4 | memset(dp,-1000000,sizeof(dp));
      |       ^
a.cc:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    5 | main(){
      | ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int dp[250][150],T[250],x[250][3],D,N,MAX;
memset(dp,-1,sizeof(dp));
main(){ 
    cin>>D>>N;
    for(int i=1;i<=D;i++){cin>>T[i];}
    for(int i=1;i<=N;i++){
        cin>>x[i][0]>>x[i][1]>>x[i][2];
        if(T[1]>=x[i][0] && T[1]<=x[i][1]){dp[1][x[i][2]]=0;}
    }
    for(int i=2;i<=D;i++){
        for(int j=1;j<=N;j++){
            if(T[i]>=x[j][0] && T[i]<=x[j][1]){
                for(int k=0;k<=100;k++){
                    dp[i][x[j][2]]=max(dp[i][x[j][2]],dp[i-1][k]+abs(x[j][2]-k));
                }
            }
        }
    }
    for(int i=0;i<=100;i++){MAX=max(MAX,dp[D][i]);}
    cout<<MAX<<endl;
    return 0;
}

Compiler output:
a.cc:4:7: error: expected constructor, destructor, or type conversion before '(' token
    4 | memset(dp,-1,sizeof(dp));
      |       ^
a.cc:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    5 | main(){
      | ^~~~
Language: C++

#include<bits/stdc++.h>
int P[250][150],T[250],x[250][3],D,N,M,i;
main(){memset(P,-999999,sizeof(P));cin>>D>>N;
for(i=1;i<=D;i++){std::cin>>T[i];}
for(i=1;i<=N;i++){std::cin>>x[i][0]>>x[i][1]>>x[i][2];if(T[1]>=x[i][0] && T[1]<=x[i][1]){P[1][x[i][2]]=0;}}
for(i=2;i<=D;i++){for(int j=1;j<=N;j++){if(T[i]>=x[j][0] && T[i]<=x[j][1]){
for(k=0;k<=100;k++){P[i][x[j][2]]=max(P[i][x[j][2]],P[i-1][k]+abs(x[j][2]-k));}}}}
for(i=0;i<=100;i++){M=max(M,P[D][i]);}std::cout<<M<<"\n";}

Compiler output:
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main(){memset(P,-999999,sizeof(P));cin>>D>>N;
      | ^~~~
a.cc: In function 'int main()':
a.cc:3:36: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    3 | main(){memset(P,-999999,sizeof(P));cin>>D>>N;
      |                                    ^~~
      |                                    std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:5: error: 'k' was not declared in this scope
    7 | for(k=0;k<=100;k++){P[i][x[j][2]]=max(P[i][x[j][2]],P[i-1][k]+abs(x[j][2]-k));}}}}
      |     ^
a.cc:7:35: error: 'max' was not declared in this scope; did you mean 'std::max'?
    7 | for(k=0;k<=100;k++){P[i][x[j][2]]=max(P[i][x[j][2]],P[i-1][k]+abs(x[j][2]-k));}}}}
      |                                   ^~~
      |                                   std::max
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: 'std::max' declared here
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:8:23: error: 'max' was not declared in this scope; did you mean 'std::max'?
    8 | for(i=0;i<=100;i++){M=max(M,P[D][i]);}std::cout<<M<<"\n";}
      |                       ^~~
      |                       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>
int P[250][150],T[250],x[250][3],D,N,M,i,j,k;
main(){memset(P,-999999,sizeof(P));std::cin>>D>>N;
for(i=1;i<=D;i++){std::cin>>T[i];}
for(i=1;i<=N;i++){std::cin>>x[i][0]>>x[i][1]>>x[i][2];if(T[1]>=x[i][0] && T[1]<=x[i][1]){P[1][x[i][2]]=0;}}
for(i=2;i<=D;i++){for(j=1;j<=N;j++){if(T[i]>=x[j][0] && T[i]<=x[j][1]){
for(k=0;k<=100;k++){P[i][x[j][2]]=max(P[i][x[j][2]],P[i-1][k]+abs(x[j][2]-k));}}}}
for(i=0;i<=100;i++){M=max(M,P[D][i]);}std::cout<<M<<"\n";}

Compiler output:
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main(){memset(P,-999999,sizeof(P));std::cin>>D>>N;
      | ^~~~
a.cc: In function 'int main()':
a.cc:7:35: error: 'max' was not declared in this scope; did you mean 'std::max'?
    7 | for(k=0;k<=100;k++){P[i][x[j][2]]=max(P[i][x[j][2]],P[i-1][k]+abs(x[j][2]-k));}}}}
      |                                   ^~~
      |                                   std::max
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/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:8:23: error: 'max' was not declared in this scope; did you mean 'std::max'?
    8 | for(i=0;i<=100;i++){M=max(M,P[D][i]);}std::cout<<M<<"\n";}
      |                       ^~~
      |                       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>
#define FOR(i,a,b) for(int i=a;i<=b;i++)
static const int INF = 8931919114514810;
static const int MAX_N = 300;
using namespace std;

int A[300],B[300],C[300];
int mem[MAX_N][MAX_N];
int N,D;
int Day[MAX_N];
int cal(int day,int pp){
   int res=0;
   if(day==N+1){
        return res=0;
   }
   if(mem[day][pp]!=-1){
        return mem[day][pp];
   }
    if(day<=1){
       FOR(i,1,D){
            if(Day[day]>=A[i]&&Day[day]<=B[i]){
            res=cal(day+1,i);
         }
      }
   }
   else{
        FOR(i,1,D){
            if(Day[day]>=A[i]&&Day[day]<=B[i]){
                int temp=abs(C[pp]-C[i]);
                res=max(cal(day+1,i)+temp,res);
                mem[day][pp]=res;
            }
        }
   }
   return mem[day][pp]=res;
}

int main(){
    cin>>N>>D;
    memset(mem,-1,sizeof(mem));
    FOR(i,1,N){
        cin>>Day[i];
    }
    FOR(i,1,D){
        cin>>A[i]>>B[i]>>C[i];
    }
    int ans=0
    FOR(i,1,D){
        if(Day[1]>=A[i]&&Day[1]<=B[i]){
            ans=max(cal(1,i),ans)<<endl;
        }
    }
    return 0;
}

Compiler output:
a.cc:3:24: warning: overflow in conversion from 'long int' to 'int' changes value from '8931919114514810' to '2046538106' [-Woverflow]
    3 | static const int INF = 8931919114514810;
      |                        ^~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:2:20: error: expected ',' or ';' before 'for'
    2 | #define FOR(i,a,b) for(int i=a;i<=b;i++)
      |                    ^~~
a.cc:48:5: note: in expansion of macro 'FOR'
   48 |     FOR(i,1,D){
      |     ^~~
a.cc:48:9: error: 'i' was not declared in this scope
   48 |     FOR(i,1,D){
      |         ^
a.cc:2:32: note: in definition of macro 'FOR'
    2 | #define FOR(i,a,b) for(int i=a;i<=b;i++)
      |                                ^
Language: C++

#include<bits/stdc++.h>
#define FOR(i,a,b) for(int i=a;i<=b;i++)
static const int INF = 8931919114514810;
static const int MAX_N = 300;
using namespace std;

int A[300],B[300],C[300];
int mem[MAX_N][MAX_N];
int N,D;
int Day[MAX_N];
int cal(int day,int pp){
   int res=0;
   if(day==N+1){
        return res=0;
   }
   if(mem[day][pp]!=-1){
        return mem[day][pp];
   }
    if(day<=1){
       FOR(i,1,D){
            if(Day[day]>=A[i]&&Day[day]<=B[i]){
            res=cal(day+1,i);
         }
      }
   }
   else{
        FOR(i,1,D){
            if(Day[day]>=A[i]&&Day[day]<=B[i]){
                int temp=abs(C[pp]-C[i]);
                res=max(cal(day+1,i)+temp,res);
                mem[day][pp]=res;
            }
        }
   }
   return mem[day][pp]=res;
}

int main(){
    cin>>N>>D;
    memset(mem,-1,sizeof(mem));
    FOR(i,1,N){
        cin>>Day[i];
    }
    FOR(i,1,D){
        cin>>A[i]>>B[i]>>C[i];
    }
    int ans=0
    FOR(i,1,D){
        if(Day[1]>=A[i]&&Day[1]<=B[i]){
            ans=max(cal(1,i),ans);
        }
    }
    cout<<ans<<endl;
    return 0;
}

Compiler output:
a.cc:3:24: warning: overflow in conversion from 'long int' to 'int' changes value from '8931919114514810' to '2046538106' [-Woverflow]
    3 | static const int INF = 8931919114514810;
      |                        ^~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:2:20: error: expected ',' or ';' before 'for'
    2 | #define FOR(i,a,b) for(int i=a;i<=b;i++)
      |                    ^~~
a.cc:48:5: note: in expansion of macro 'FOR'
   48 |     FOR(i,1,D){
      |     ^~~
a.cc:48:9: error: 'i' was not declared in this scope
   48 |     FOR(i,1,D){
      |         ^
a.cc:2:32: note: in definition of macro 'FOR'
    2 | #define FOR(i,a,b) for(int i=a;i<=b;i++)
      |                                ^
Language: C++

#include<stdio.h>
#include<stdlib.h>
#include<vector>
#include<algorithm>
using namespace std;

struct str
{
	int a, b, c;
	void new_str(int a_, int b_, int c_){
		a = a_; b = b_; c = c_;
	}
};
int dp[200][200];
int t[200];
str cl[200];
int main(){
	int d, n;
	scanf("%d%d", &d, &n);
	memset(dp, -1, sizeof(dp));
	for (int i = 0; i < d; i++)
		scanf("%d", &t[i]);
	for (int i = 0; i < n; i++){
		int a, b, c;
		scanf("%d%d%d", &a, &b, &c);
		cl[i].new_str(a, b, c);
	}
	for (int i = 0; i < n; i++)
		if (cl[i].a <= t[0] && t[0] <= cl[i].b)
			dp[0][i] = 0;
	for (int i = 1; i < d; i++){
		for (int j = 0; j < n; j++){
			if (cl[j].a <= t[i] && t[i] <= cl[j].b){
				for (int l = 0; l < n; l++){
					if (dp[i - 1][l] >= 0 && abs(cl[l].c - cl[j].c) + dp[i - 1][l]>dp[i][j])
						dp[i][j] = abs(cl[l].c - cl[j].c) + dp[i - 1][l];
				}
			}
		}
	}
	printf("%d\n", *max_element(dp[d - 1], dp[d - 1] + n));
	return 0;
}

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

#include<iostream>
#include<algorithm>
using namespace std;
int dp[110][110],l[110],r[110],p[110],n,m,a[110];
int main(){
	cin>>n>>m;for(int i=0;i<n;i++)cin>>a[i];
	for(int i=0;i<m;i++)cin>>l[i]>>r[i]>>p[i];
	for(int i=0;i<12100;i++)dp[i/110][i%110]=-1000000000;
	for(int i=0;i<m;i++){if(l[i]<=a[0] && a[i]<=r[0]){dp[0][p[i]]=max(dp[0][p[i]],0);)}}
	for(int i=1;i<n;i++){
		for(int j=0;j<=100;j++){
			for(int k=0;k<m;k++){
				if(l[k]<=a[i] && a[i]<=r[k]){
					dp[i][p[k]]=max(dp[i][p[k]],dp[i-1][j]+abs(j-p[k]));)
				}
			}
		}
	}
	int maxn=0;for(int i=0;i<=100;i++)maxn=max(maxn,dp[n-1][i]);
	cout<<maxn<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:90: error: expected primary-expression before ')' token
    9 |         for(int i=0;i<m;i++){if(l[i]<=a[0] && a[i]<=r[0]){dp[0][p[i]]=max(dp[0][p[i]],0);)}}
      |                                                                                          ^
a.cc:14:93: error: expected primary-expression before ')' token
   14 |                                         dp[i][p[k]]=max(dp[i][p[k]],dp[i-1][j]+abs(j-p[k]));)
      |                                                                                             ^
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
int dp[110][110],l[110],r[110],p[110],n,m,a[110];
int main(){
	cin>>n>>m;for(int i=0;i<n;i++)cin>>a[i];
	for(int i=0;i<m;i++)cin>>l[i]>>r[i]>>p[i];
	for(int i=0;i<12100;i++)dp[i/110][i%110]=-1000000000;
	for(int i=0;i<m;i++){
		if(l[i]<=a[0] && a[i]<=r[0]){
			dp[0][p[i]]=max(dp[0][p[i]],0);
		}
	}
	for(int i=1;i<n;i++){
		for(int j=0;j<=100;j++){
			for(int k=0;k<m;k++){
				if(l[k]<=a[i] && a[i]<=r[k]){
					dp[i][p[k]]=max(dp[i][p[k]],dp[i-1][j]+abs(j-p[k]));)
				}
			}
		}
	}
	int maxn=0;for(int i=0;i<=100;i++)maxn=max(maxn,dp[n-1][i]);
	cout<<maxn<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:93: error: expected primary-expression before ')' token
   18 |                                         dp[i][p[k]]=max(dp[i][p[k]],dp[i-1][j]+abs(j-p[k]));)
      |                                                                                             ^
Language: C++

#include <iostream>
#include <limits>
#include <cmath>

constexpr int MAX = 200;
constexpr int MAX_C = 100;

int D, N, T[MAX], A[MAX], B[MAX], C[MAX];
int memo[MAX_C + 1][MAX + 1];

int solve(int tmp, int n = 1);

int main(){
	std::ios::sync_with_stdio(false);
	
	memset(memo, -1, sizeof(memo));

	std::cin >> D >> N;

	for(int i = 0; i < D; ++i){
		std::cin >> T[i];
	}

	for(int i = 0; i < N; ++i){
		std::cin >> A[i] >> B[i] >> C[i];
	}

	int ans = 0;
	for(int i = 0; i < N; ++i){
		if(A[i] <= T[0] && T[0] <= B[i]){
			ans = std::max(ans, solve(C[i]));
		}
	}

	std::cout << ans << std::endl;
	return 0;
}

int solve(int tmp, int n){
	if(n == D){
		return 0;
	}
	if(memo[tmp][n] != -1){
		return memo[tmp][n];
	}

	int res = 0;
	for(int i = 0; i < N; ++i){
		if(A[i] <= T[n] && T[n] <= B[i]){
			res = std::max(res, solve(C[i], n + 1) + abs(tmp - C[i]));
		}
	}
	//std::cout << "memo[" << tmp << "][" << n << "] = " << res << std::endl;
	return memo[tmp][n] = res;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: error: 'memset' was not declared in this scope
   16 |         memset(memo, -1, sizeof(memo));
      |         ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <cmath>
  +++ |+#include <cstring>
    4 |
Language: C++

//
//  main.cpp

#include <iostream>
#include <cmath.h>


using namespace std;
struct status{
	int toptemp;
	int bottomtemp;
	int fancy;
	
};
status dress[201];
int dp[201][201];//i??\???????????????j????????????????????§????´???????
int temp[201];
int D,N;

int MAX(int i,int j){//i??\?????????j???????????????????????§???????????????
	if(i == 0){//?????\????????????????????????
//		return dress[j].fancy;
		return 0;
	}
	
//	for(int i=0;i<N;i++){
	for(int J=0;J<N;J++){//i-1??\?????????J(1<D)???????????????????????§???
		if(temp[i-1] >= dress[J].bottomtemp && temp[i-1] <= dress[J].toptemp){
			dp[i][j] = max(dp[i][j],MAX(i-1,J) + abs(dress[J].fancy - dress[j].fancy));
		}
	}
	return dp[i][j];
//		dp[i-1][j]
//	}
}

int main(){	
	
	cin >> D >> N;
	
	
	for(int i=0;i<D;i++){
		cin >> temp[i];
	}
	for(int i=0;i<N;i++){
		cin >> dress[i].bottomtemp >> dress[i].toptemp >> dress[i].fancy;
	}
	

	for(int i=0;i<201;i++){
		for(int j=0;j<201;j++){
			dp[i][j] = -1;
		}
	}
	int answer=0;
	for(int i=0;i<N;i++){
		if(temp[D-1] >= dress[i].bottomtemp && temp[D-1] <= dress[i].toptemp){
			answer = max(answer,MAX(D-1,i));
		}
	}
	cout << answer << endl;
	
	/*
	for(int i=0;i<N;i++){//0??\?????????????¨???????
		if(temp[0] >= dress[i].bottomtemp && temp[0] <= dress[i].toptemp){
			dp[0][i] = dress[i].fancy;
		}
	}
	
	for(int i=1;i<D;i++){
		for(int j=0;j<N;j++){
			if(temp[i] >= dress[j].bottomtemp && temp[i] <= dress[j].toptemp){//i??\??????j??????????????????
				int Maxfancy=-1;
				for(int k=0;k<N;k++){//i-1??\????????¨????????????????????´???????????????????´???????????????§???????????????????????????
					if(dp[i-1][k] == -1)continue;
					Maxfancy = max(Maxfancy,abs(dress[j].fancy - dress[k].fancy));
				}
				dp[i][j] = Maxfancy;
			}
		}
	}
	
	int answer = 0;
	for(int i=1;i<D;i++){
		int Max = -1;
		for(int j=0;j<N;j++){
			Max = max(Max,dp[i][j]);
		}
		answer += Max;
	}
	cout << answer << endl;
	
	vector<int> dresses;
	int matrix[201][2];
	for(int i=0;i<D;i++){
		for(int j=0;j<N;j++){
			if(temp[i] >= dress[j].bottomtemp && temp[i] <= dress[j].toptemp){
				dresses.push_back(dress[j].fancy);
			}
		}
		sort(dresses.begin(),dresses.end());
		matrix[i][0] = dresses[0];
		matrix[i][1] = dresses[dresses.size() - 1];
	}
	
	int dp[201]={};
	dp[0] = max(matrix[0][0],matrix[0][1]);
	
	for(int i=1;i<D;i++){
		dp[i] = max(abs(dp[i-1] - matrix[i][0]),abs(dp[i-1] - matrix[i][1]));
	}
	
	cout << dp[D-1] << endl;
	*/
	return 0;
}

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

#include <iostream>
using namespace std;

int D, N;
int T[256], A[256], B[256], C[256];
int dp[256][256];

int rec(int day, int prev)
{
	if(day == D) return 0;

	
}

int main()
{
	memset(dp, 0, sizeof dp);
	
	cin >> D >> N;

	for(int i = 0; i < D; i++) {
		cin >> T[i];
	}

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

	for(int day = 0; day < D-1; day++) {
		for(int now = 0; now < N; now++) {
			for(int next = 0; next < N; next++) {
				if(A[now] <= T[day] && T[day] <= B[now] && A[next] <= T[day+1] && T[day+1] <= B[next]) {
					dp[day+1][next] = max(dp[day+1][next], dp[day][now] + abs(C[now] - C[next]));
				}
			}
		}
	}

	int ans = 0;
	for(int i = 0; i < N; i++) {
		ans = max(ans, dp[D-1][i]);
	}

	cout << ans << endl;
}

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:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
a.cc: In function 'int rec(int, int)':
a.cc:13:1: warning: control reaches end of non-void function [-Wreturn-type]
   13 | }
      | ^
Language: C++

    return 0;
  } 
  return pointM;//自分の今までの派手さ絶対値の合計（今日ー昨日まで）
}



int main(void){
 
  cin >> days;
  cin >> clothes;
  for(int i=0;i<days;i++){
    cin >> temple[i];
  }
  for(int i=0;i<clothes;i++){
    cin >> clothD[i][0];
    cin >> clothD[i][1];
    cin >> clothD[i][2];
  }
  for(int i=0;i<days;i++){
	dayCanW[i]=0;
    for(int j=0;j<clothes;j++){
	dayM[i][j]=0;
    }
  }
  /*
  for(int i=0;i<days;i++){
    for(int j=0;j<clothes;j++){
      if(temple[i]>clothD[j][0] && temple[i]<clothD[j][1]){
	dayM[i][j]=1;
	dayCanW[i]+=1;
      }
    }
  }
  */
  cout << bestCloth(0,0) << endl;

  

}

Compiler output:
a.cc:1:5: error: expected unqualified-id before 'return'
    1 |     return 0;
      |     ^~~~~~
a.cc:2:3: error: expected declaration before '}' token
    2 |   }
      |   ^
a.cc:3:3: error: expected unqualified-id before 'return'
    3 |   return pointM;//自分の今までの派手さ絶対値の合計（今日ー昨日まで）
      |   ^~~~~~
a.cc:4:1: error: expected declaration before '}' token
    4 | }
      | ^
a.cc: In function 'int main()':
a.cc:10:3: error: 'cin' was not declared in this scope
   10 |   cin >> days;
      |   ^~~
a.cc:10:10: error: 'days' was not declared in this scope
   10 |   cin >> days;
      |          ^~~~
a.cc:11:10: error: 'clothes' was not declared in this scope
   11 |   cin >> clothes;
      |          ^~~~~~~
a.cc:13:12: error: 'temple' was not declared in this scope
   13 |     cin >> temple[i];
      |            ^~~~~~
a.cc:16:12: error: 'clothD' was not declared in this scope
   16 |     cin >> clothD[i][0];
      |            ^~~~~~
a.cc:21:9: error: 'dayCanW' was not declared in this scope
   21 |         dayCanW[i]=0;
      |         ^~~~~~~
a.cc:23:9: error: 'dayM' was not declared in this scope
   23 |         dayM[i][j]=0;
      |         ^~~~
a.cc:36:3: error: 'cout' was not declared in this scope
   36 |   cout << bestCloth(0,0) << endl;
      |   ^~~~
a.cc:36:11: error: 'bestCloth' was not declared in this scope
   36 |   cout << bestCloth(0,0) << endl;
      |           ^~~~~~~~~
a.cc:36:29: error: 'endl' was not declared in this scope
   36 |   cout << bestCloth(0,0) << endl;
      |                             ^~~~
Language: C++

    return 0;
  } 
  return pointM;//自分の今までの派手さ絶対値の合計（今日ー昨日まで）
}



int main(void){
 
  cin >> days;
  cin >> clothes;
  for(int i=0;i<days;i++){
    cin >> temple[i];
  }
  for(int i=0;i<clothes;i++){
    cin >> clothD[i][0];
    cin >> clothD[i][1];
    cin >> clothD[i][2];
  }
  for(int i=0;i<days;i++){
	dayCanW[i]=0;
    for(int j=0;j<clothes;j++){
	dayM[i][j]=0;
    }
  }
  /*
  for(int i=0;i<days;i++){
    for(int j=0;j<clothes;j++){
      if(temple[i]>clothD[j][0] && temple[i]<clothD[j][1]){
	dayM[i][j]=1;
	dayCanW[i]+=1;
      }
    }
  }
  */
  cout << bestCloth(0,0) << endl;

  return 0;

}

Compiler output:
a.cc:1:5: error: expected unqualified-id before 'return'
    1 |     return 0;
      |     ^~~~~~
a.cc:2:3: error: expected declaration before '}' token
    2 |   }
      |   ^
a.cc:3:3: error: expected unqualified-id before 'return'
    3 |   return pointM;//自分の今までの派手さ絶対値の合計（今日ー昨日まで）
      |   ^~~~~~
a.cc:4:1: error: expected declaration before '}' token
    4 | }
      | ^
a.cc: In function 'int main()':
a.cc:10:3: error: 'cin' was not declared in this scope
   10 |   cin >> days;
      |   ^~~
a.cc:10:10: error: 'days' was not declared in this scope
   10 |   cin >> days;
      |          ^~~~
a.cc:11:10: error: 'clothes' was not declared in this scope
   11 |   cin >> clothes;
      |          ^~~~~~~
a.cc:13:12: error: 'temple' was not declared in this scope
   13 |     cin >> temple[i];
      |            ^~~~~~
a.cc:16:12: error: 'clothD' was not declared in this scope
   16 |     cin >> clothD[i][0];
      |            ^~~~~~
a.cc:21:9: error: 'dayCanW' was not declared in this scope
   21 |         dayCanW[i]=0;
      |         ^~~~~~~
a.cc:23:9: error: 'dayM' was not declared in this scope
   23 |         dayM[i][j]=0;
      |         ^~~~
a.cc:36:3: error: 'cout' was not declared in this scope
   36 |   cout << bestCloth(0,0) << endl;
      |   ^~~~
a.cc:36:11: error: 'bestCloth' was not declared in this scope
   36 |   cout << bestCloth(0,0) << endl;
      |           ^~~~~~~~~
a.cc:36:29: error: 'endl' was not declared in this scope
   36 |   cout << bestCloth(0,0) << endl;
      |                             ^~~~
Language: C++

#include <cstdio>
#include <cstdlib>
#include <algorithm>
using namespace std;
int main()
{
	int d,n;
	cin >> d >> n;
	int dp[205][105];
	for(int i=0;i<205;i++)for(int j=0;j<205;j++)dp[i][j]=1e7;
	int temp[205];
	int a[205],b[205],c[205];
	for(int i=1;i<=d;i++)
	{
		cin >> temp[i];
	}
	for(int i=1;i<=n;i++)
	{
		cin >> a[i]>> b[i] >> c[i];
		if(a[i] <= temp[1] && temp[1] <= b[i])
		{
			dp[1][c[i]]=min(dp[1][c[i]],0);
		}
	}
	for(int i=2;i<=d;i++)
	{
		for(int j=1;j<=n;j++)
		{
			if(a[j] <= temp[i] && temp[i] <= b[j])
			{
				for(int k=0;k<=100;k++) dp[i][c[j]]=min(dp[i][c[j]],dp[i-1][k]+abs(k-c[j]));
			}
		}
	}
	int val=1e7;
	for(int k=0;k<=100;k++) val=min(val,dp[d][k]);
	cout << val << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'cin' was not declared in this scope
    8 |         cin >> d >> n;
      |         ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #include <algorithm>
  +++ |+#include <iostream>
    4 | using namespace std;
a.cc:37:9: error: 'cout' was not declared in this scope
   37 |         cout << val << endl;
      |         ^~~~
a.cc:37:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:37:24: error: 'endl' was not declared in this scope
   37 |         cout << val << endl;
      |                        ^~~~
a.cc:4:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    3 | #include <algorithm>
  +++ |+#include <ostream>
    4 | using namespace std;
Language: C++


#include<iostream>

using namespace std;

int calc_abso(a,b){
    int abso;
    if(a>=b){
        abso=a-b;
    }else if(a<b){
        abso=b-a;
    }
    return ;
}

struct WEAR{
    int min;        //適す最高気温(下限)
    int max;        //適す最高気温(上限)
    int looks;      //派手さ
};

int dp[256][256]={{0}};    //[日数][服の種]    //値は派手さの絶対値の合計（一番大きいものを最終的に取るように）


int main (void){
    int D,N;
    WEAR status[256];
    int tempe[256];


    for(int i=0;i<D;i++){
        cin >> tempe[i];
    }
    for(int i=0;i<N;i++){
        cin >> status[i].min >> status[i].mix >> status[i].looks;
    }

    for(int i=1;i<D;i++){
        for(int j=0;j<N;j++){
            if((status[j].min<tempe[j])&&(status[j].max>tempe[])){      //この服が今日適しているか？
                int MAX_tortal=-1;    //前日の服と差の最大値
                int MAX_num;
                for(int k=0;k<N;k++){   //前日の服
                        int THIS_tortal=calc_abso(status[N].looks , status[k].looks)+dp[i][k];
                        if(THIS_tortal+>MAX_tortal){
                            MAX_abso=THIS_tortal;
                            MAX_num=k;
                        }

                }
                dp[i][j]+=MAX_tortal;
            }
        }
    }

    int LAST_MAX_tortal=-1;
    for(int i=0;i<N;i++){
        if(dp[D-1][i]>LAST_MAX_tortal){
            LAST_MAX_tortal=dp[D-1][i];
        }
    }
    
    cout << LAST_MAX_tortal << endl;


    return 0;
}

Compiler output:
a.cc:6:15: error: 'a' was not declared in this scope
    6 | int calc_abso(a,b){
      |               ^
a.cc:6:17: error: 'b' was not declared in this scope
    6 | int calc_abso(a,b){
      |                 ^
a.cc:6:18: error: expression list treated as compound expression in initializer [-fpermissive]
    6 | int calc_abso(a,b){
      |                  ^
a.cc: In function 'int main()':
a.cc:35:43: error: 'struct WEAR' has no member named 'mix'; did you mean 'min'?
   35 |         cin >> status[i].min >> status[i].mix >> status[i].looks;
      |                                           ^~~
      |                                           min
a.cc:40:63: error: expected primary-expression before ']' token
   40 |             if((status[j].min<tempe[j])&&(status[j].max>tempe[])){      //この服が今日適しているか？
      |                                                               ^
a.cc:44:50: error: 'calc_abso' cannot be used as a function
   44 |                         int THIS_tortal=calc_abso(status[N].looks , status[k].looks)+dp[i][k];
      |                                         ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:45:40: error: expected primary-expression before '>' token
   45 |                         if(THIS_tortal+>MAX_tortal){
      |                                        ^
a.cc:46:29: error: 'MAX_abso' was not declared in this scope
   46 |                             MAX_abso=THIS_tortal;
      |                             ^~~~~~~~
Language: C

#include<stdio.h>
#include<stdlib.h>


long long X[ 100 ][ 2 ] ,x[ 100 ] ;
long long Y[ 100 ][ 2 ] ,y[ 100 ] ;
long long Z[ 100 ][ 2 ] ,z[ 100 ] ;

int i ,j ,k ,l ;

void sort( long long *a ,int size )
{
	qsort( a ,size ,sizeof( long long ) ,[]( const void *a ,const void *b ){ return *( int* )a - *( int* )b ; } ) ;
}

int check()
{
	if(
			X[ l ][ 0 ] > x[ i ] || X[ l ][ 1 ] < x[ i + 1 ] ||
			Y[ l ][ 0 ] > y[ j ] || Y[ l ][ 1 ] < y[ j + 1 ] ||
			Z[ l ][ 0 ] > z[ k ] || Z[ l ][ 1 ] < z[ k + 1 ]
	)
	{
		return 1 ;
	}

	return 0 ;
}

int main( void )
{
	int N ,K ;
	scanf( "%d %d" ,&N ,&K ) ;

	N *= 2 ;

	--K ;

	int n = N - 1 ;

	for( i = 0 ; i < N ; ++i )
	{
		scanf( "%lld %lld %lld" ,x + i ,y + i ,z + i ) ;

		X[ i / 2 ][ i % 2 ] = x[ i ] ;
		Y[ i / 2 ][ i % 2 ] = y[ i ] ;
		Z[ i / 2 ][ i % 2 ] = z[ i ] ;
	}

	sort( x ,N ) ;
	sort( y ,N ) ;
	sort( z ,N ) ;

	long long ans = 0 ;
	for( i = 0 ; i < n ; ++i )
	{
		for( j = 0 ; j < n ; ++j )
		{
			for( k = 0 ; k < n ; ++k )
			{
				int cnt = 0 ;

				for( l = 0 ; l < N ; ++l )
				{
					if( check() == 0 )
					{
						++cnt ;
					}
				}

				if( cnt > K )
				{
					ans += ( x[ i + 1 ] - x[ i ] ) * ( y[ j + 1 ] - y[ j ] ) * ( z[ k + 1 ] - z[ k ] ) ;
				}
			}
		}
	}


	printf( "%lld\n" ,ans ) ;

	return 0 ;
}

Compiler output:
main.c: In function 'sort':
main.c:13:46: error: expected expression before '[' token
   13 |         qsort( a ,size ,sizeof( long long ) ,[]( const void *a ,const void *b ){ return *( int* )a - *( int* )b ; } ) ;
      |                                              ^
main.c:13:80: error: expected ')' before '{' token
   13 |         qsort( a ,size ,sizeof( long long ) ,[]( const void *a ,const void *b ){ return *( int* )a - *( int* )b ; } ) ;
      |              ~                                                                 ^
      |                                                                                )
Language: C

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

using namespace std;
#define MAX(x,y) ((x>y)?x:y)

int comp(const void *p,const void *q){
	return *(int *)p-*(int *)q;
}
int x[105],y[105],d[105];
int sx[105],sy[105],sd[105];
int c[105][105][105];
int main(){
	int i,j,k,l,n,K;
	int xn,yn,dn;
	long long ans;
	
	scanf("%d%d",&n,&K);
	for(i=0;i<n;i++)scanf("%d%d%d%d%d%d",&x[i*2],&y[i*2],&d[i*2],&x[i*2+1],&y[i*2+1],&d[i*2+1]);
	memcpy(sx,x,sizeof(int)*n*2);
	memcpy(sy,y,sizeof(int)*n*2);
	memcpy(sd,d,sizeof(int)*n*2);
	
	qsort(sx,n*2,sizeof(int),comp);
	qsort(sy,n*2,sizeof(int),comp);
	qsort(sd,n*2,sizeof(int),comp);
	
	xn=yn=dn=1;
	for(i=1;i<n*2;i++)if(sx[i]!=sx[i-1])sx[xn++]=sx[i];
	for(i=1;i<n*2;i++)if(sy[i]!=sy[i-1])sy[yn++]=sy[i];
	for(i=1;i<n*2;i++)if(sd[i]!=sd[i-1])sd[dn++]=sd[i];
	/*
	for(i=0;i<xn;i++)printf("%3d ",sx[i]);printf("\n");
	for(i=0;i<yn;i++)printf("%3d ",sy[i]);printf("\n");
	for(i=0;i<dn;i++)printf("%3d ",sd[i]);printf("\n");
	*/
	memset(c,0,sizeof(c));
	for(i=0;i<n*2;i++){
		x[i]=lower_bound(sx,sx+xn,x[i])-sx;
		y[i]=lower_bound(sy,sy+yn,y[i])-sy;
		d[i]=lower_bound(sd,sd+dn,d[i])-sd;
		//printf("%d %d %d\n",x[i],y[i],d[i]);
		if(i%2==1){
			for(j=x[i-1];j<x[i];j++)
				for(k=y[i-1];k<y[i];k++)
					for(l=d[i-1];l<d[i];l++)c[j][k][l]++;
		}
	}
	ans=0;
	for(i=0;i<xn-1;i++)for(j=0;j<yn-1;j++)for(k=0;k<dn-1;k++){
		if(c[i][j][k]>=K)ans+=(long long)(sx[i+1]-sx[i])*
							  (long long)(sy[j+1]-sy[j])*
							  (long long)(sd[k+1]-sd[k]);
	}
	printf("%lld\n",ans);
	
	
	return 0;
}

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