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

#include<cstdio>
using namespace std;
int main(){
	int N, T, S, M[3001]={}, maxM=0;
	scanf("%d%d%d", &N, &T, &S);
	if(S==0){
		for(int n=0; n<N; n++){
			int mise_fun, mise_time;
			scanf("%d%d", &mise_fun, &mise_time);
			for(int t=T; t>=mise_time; t--)
				int newM = M[t-mise_time] + mise_fun;
				if(M[t] > newM){
					M[t] = newM;
					maxM = newM;
				}
		}
	}
	else{
		for(int n=0; n<N; n++){
			int mise_fun, mise_time;
			scanf("%d%d", &mise_fun, &mise_time);
			for(int t=T; t>=mise_time; t--)
				if(t<=S || t >= S  + mise_time){
					int newM = M[t-mise_time] + mise_fun;
					if(M[t] > newM){
						M[t] = newM;
						maxM = newM;
					}
				}
		}
	}
	printf("%d\n", maxM);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:38: error: 't' was not declared in this scope
   12 |                                 if(M[t] > newM){
      |                                      ^
a.cc:12:43: error: 'newM' was not declared in this scope
   12 |                                 if(M[t] > newM){
      |                                           ^~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
	cin.tie(0);
    ios::sync_with_stdio(false);
	int N, T, S, M[3001]={}, maxM=0;
	cin >> N >> T >> S;
	if(S==0){
		for(int n=0; n<N; n++){
			int mise_fun, mise_time;
			cin >> mise_fun >> mise_time;
			for(int t=T; t>=mise_time; t--){
				int newM = M[t-mise_time] + mise_fun;
				
				if(M[t] < newM){
					M[t] = newM;
					if(maxM<newM)maxM = newM;
				}
			}
		}
	}
	else{
		for(int n=0; n<N; n++){
			int mise_fun, mise_time;
			cin >> mise_fun >> mise_time;
			for(int t=T; t>=mise_time; t--){
				if(t<=S || t >= S  + mise_time){
					int newM = M[t-mise_time] + mise_fun;
					if(M[t] < newM){
						M[t] = newM;
						if(maxM<newM)maxM = newM;
					}
				}
			}
		}
	}
	cout << *max_element(M+1, M+T+1) << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:18: error: 'max_element' was not declared in this scope
   37 |         cout << *max_element(M+1, M+T+1) << endl;
      |                  ^~~~~~~~~~~
Language: C++

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

int dp[3001][3001];
int a[3000], b[3000];
int N, T, S;

int rec(int idx, int time){
  if(idx == N || time == T) return(0);
  if(~dp[idx][time]) return(dp[idx][time]);
  int ret = max( rec( idx + 1, time), rec( idx, time + 1));
  if((time + b[idx] <= S || time >= S) && time + b[idx] <= T){
    ret = max( ret, rec( idx + 1, time + b[idx]) + a[idx]);
  }
  return(dp[idx][time] = ret);
}

int main(){
  fill_n( *dp, 3001 * 3001, -1);
  cin >> N >> T >> S;
  for(int i = 0; i < N; i++){
    cin >> a[i] >> b[i];
  }
  cout << rec(0,0) << endl;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int rec(int, int)':
a.cc:11:13: error: 'max' was not declared in this scope
   11 |   int ret = max( rec( idx + 1, time), rec( idx, time + 1));
      |             ^~~
a.cc: In function 'int main()':
a.cc:19:3: error: 'fill_n' was not declared in this scope
   19 |   fill_n( *dp, 3001 * 3001, -1);
      |   ^~~~~~
a.cc:20:3: error: 'cin' was not declared in this scope
   20 |   cin >> N >> T >> S;
      |   ^~~
a.cc:24:3: error: 'cout' was not declared in this scope
   24 |   cout << rec(0,0) << endl;
      |   ^~~~
a.cc:24:23: error: 'endl' was not declared in this scope
   24 |   cout << rec(0,0) << endl;
      |                       ^~~~
Language: C++

n, t, s = gets.split.map &:to_i
s = t - s if 2 * s < t

items = $<.map{|s| s.split.reverse.map &:to_i}

table = (0..1).map { (0..s).map{|g| [0] * ((g < t-s ? g : t-s) + 1)} }
for k in 0..items.size-1
	c, v = items[k]
	for i in 0..s
		j_max = (i < t-s ? i : t-s)
		for j in 0..j_max
			cand = []
			cand << table[0][i][j]
			cand << table[0][i][j-c] + v if j >= c
			y, x = i-c, j
			y, x = x, y if x > y
			cand << table[0][y][x] + v if i >= c
			table[1][i][j] = cand.max
		end
	end
	table << table.shift
end
p table[-1][s][t-s]

Compiler output:
a.cc:6:10: error: too many decimal points in number
    6 | table = (0..1).map { (0..s).map{|g| [0] * ((g < t-s ? g : t-s) + 1)} }
      |          ^~~~
a.cc:6:23: error: too many decimal points in number
    6 | table = (0..1).map { (0..s).map{|g| [0] * ((g < t-s ? g : t-s) + 1)} }
      |                       ^~~~
a.cc:7:10: error: too many decimal points in number
    7 | for k in 0..items.size-1
      |          ^~~~~~~~~~~~~~~
a.cc:9:18: error: too many decimal points in number
    9 |         for i in 0..s
      |                  ^~~~
a.cc:11:26: error: too many decimal points in number
   11 |                 for j in 0..j_max
      |                          ^~~~~~~~
a.cc:1:1: error: 'n' does not name a type
    1 | n, t, s = gets.split.map &:to_i
      | ^
a.cc:6:1: error: 'table' does not name a type; did you mean 'mutable'?
    6 | table = (0..1).map { (0..s).map{|g| [0] * ((g < t-s ? g : t-s) + 1)} }
      | ^~~~~
      | mutable
a.cc:7:1: error: expected unqualified-id before 'for'
    7 | for k in 0..items.size-1
      | ^~~
Language: C++

//Solution for aoj 0573: Night Market
#include<iostream>
#include<algorithm>
using namespace std;
int n, s, t, time = 0, happy = 0 , ans;
double save;
int sho[3000][2], dp[3000][3000];
void solve(){
	for (int i = 2; i <= n; i++){
		for (int j = 1; j <= t; j++){
			dp[i][j] = max(dp[i][j], max(dp[i - 1][j], dp[i][j - 1]));
			if (j >= s || s > j + sho[i + 1][1]){
				if (j + sho[i + 1][1] <= t)
				dp[i + 1][j + sho[i + 1][1]] = dp[i][j] + sho[i + 1][0];
			}
		}
	}
}
int main(){
	cin >> n >> t >> s;
	for (int i = 1; i <= n; i++){
		cin >> sho[i][0] >> sho[i][1];
	}
	for (int i = 1; i <= t; i++){
		if (i >= sho[1][1])
			dp[1][i] = sho[1][0];
		if (i >= s || s >= sho[2][1] + i){
			dp[2][i + sho[2][1]] = dp[1][i] + sho[2][0];
		}
	}
	solve();
	cout << dp[n][t] << endl;
}

Compiler output:
a.cc:5:14: error: 'int time' redeclared as different kind of entity
    5 | int n, s, t, time = 0, happy = 0 , ans;
      |              ^~~~
In file included from /usr/include/pthread.h:23,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157,
                 from /usr/include/c++/14/ext/atomicity.h:35,
                 from /usr/include/c++/14/bits/ios_base.h:39,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:2:
/usr/include/time.h:76:15: note: previous declaration 'time_t time(time_t*)'
   76 | extern time_t time (time_t *__timer) __THROW;
      |               ^~~~
Language: C++

#include <iostream>
using namespace std;

int a[3010],b[3010],dp[2][3010],mm1[3010][2],mm2[3010][2];
int main(){
	int N,T,S,I,O,hog,hma,res;
	cin>>N>>T>>S;
	for(int i=1;i<=N;i++){
		cin>>a[i]>>b[i];
	}
	memset(dp[0],-1,sizeof(dp[0]));
	I=0;O=1;
	dp[0][0]=0;
	for(int i=1;i<=N;i++){
		memset(dp[O],-1,sizeof(dp[O]));
		hma=-1;
		for(int j=0;j<=S;j++){
			hog=dp[I][j];
			if(j>=b[i]&&dp[I][j-b[i]]!=-1)hog=max(hog,dp[I][j-b[i]]+a[i]);
			dp[O][j]=hog;
			hma=max(hma,hog);
		}
		mm1[i][0]=hma;
		hog=dp[I][S+1];
		if(S+1>=b[i]&&dp[I][S+1-b[i]]!=-1)hog=max(hog,dp[I][S+1-b[i]]+a[i]);
		dp[O][S+1]=hog;
		mm1[i][1]=max(hma,hog);
		swap(I,O);
	}
	memset(dp[I],-1,sizeof(dp[I]));
	dp[I][0]=0;
	for(int i=N;i>=1;i--){
		memset(dp[O],-1,sizeof(dp[O]));
		hma=-1;
		for(int j=0;j<=T-S;j++){
			hog=dp[I][j];
			if(j>=b[i]&&dp[I][j-b[i]]!=-1)hog=max(hog,dp[I][j-b[i]]+a[i]);
			dp[O][j]=hog;
			hma=max(hma,hog);
		}
		mm2[i][1]=hma;
		hog=dp[I][T-S+1];
		if(T-S+1>=b[i]&&dp[I][T-S+1-b[i]]!=-1)hog=max(hog,dp[I][T-S+1-b[i]]+a[i]);
		dp[O][T-S+1]=hog;
		mm2[i][0]=max(hma,hog);
		swap(I,O);
	}
	res=0;
	mm1[0][0]=mm1[0][1]=mm2[N+1][0]=mm2[N+1][1]=0;
	for(int i=0;i<=N;i++){
		for(int j=0;j<2;j++){
			//cout<<i<<" "<<j<<" "<<mm1[i][j]<<" "<<mm2[i][j]<<endl;
			res=max(mm1[i][j]+mm2[i+1][j],res);
		}
	}
	cout<<res<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 'memset' was not declared in this scope
   11 |         memset(dp[0],-1,sizeof(dp[0]));
      |         ^~~~~~
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 <algorithm>
#include <iostream>
#include <cstdint>

using namespace std;

int N,T,S,A[3000],B[3000];

int dp[3000][3000];

void init()
{
	memset(dp,NULL,3000*3000);
}

int rc(int depth,int time,int d_end)
{
	if(dp[depth][time] != 0)
	{
		return dp[depth][time];
	}
	else
	{
		int res1 = 0;
		int res2 = 0;
		if(depth < d_end && time > 0)
		{
			if(B[depth] <= time)
			{
				res1 = rc(depth + 1,time - B[depth],d_end) + A[depth];
			}
			res2 = rc(depth + 1,time,d_end);
		}
		int result = max(res1,res2);
		dp[depth][time] = result;
		return result;
	}
}

int main(void)
{
	cin >> N >> T >> S;
	for(int i = 0;i < N;i++)
	{
		cin >> A[i] >> B[i];
	}
	int maxres = 0;
	for(int i = 0;i <= N;i++)
	{
		init();
		int rc1 = rc(0,S,i);
		init();
		int rc2 = rc(i,T - S,N);
		maxres = max(rc1 + rc2, maxres);
	}
	cout << maxres << endl;
	return 0;
}

Compiler output:
a.cc: In function 'void init()':
a.cc:13:9: error: 'memset' was not declared in this scope
   13 |         memset(dp,NULL,3000*3000);
      |         ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <cstdint>
  +++ |+#include <cstring>
    4 |
Language: C++

#include<stdio.h>
#include<algorithm>
using namespace std;
int a[3000],b[3000],c[3001][3001];
int main(void)
{
	int n,s,t,i,j,m;
	scanf("%d %d %d",&m,&s,&t);
	for(i=0;i<m;i++){
		scanf("%d %d",&a[i],&b[i]);
	}
	for(i=0;i<=m;i++){
		for(j=0;j<=s;j++){
			c[i][j]=0;
		}
	}
	for(i=0;i<m;i++){
		for(j=0;j<=s;j++){
			if(j+b[i]<=s&&c[i+1][j+b[i]]<a[i]+c[i][j]&&(j+b[i]<=t||j>=t)){
				c[i+1][j+b[i]]=a[i]+c[i][j];
			}
			if(c[i+1][j]<c[i][j]){
				c[i+1][j]=c[i][j];
			}
		}
	}
/*	for(i=0;i<=m;i++){
		for(j=0;j<=s;j++){
			printf("%d ",c[i][j]);
		}
		printf("\n");
*/	}
	n=0;
	for(i=0;i<=s;i++){
		if(n<c[m][i]){
			n=c[m][i];
		}
	}
	printf("%d\n",n);
	return 0;
}

Compiler output:
a.cc:33:9: error: 'n' does not name a type
   33 |         n=0;
      |         ^
a.cc:34:9: error: expected unqualified-id before 'for'
   34 |         for(i=0;i<=s;i++){
      |         ^~~
a.cc:34:17: error: 'i' does not name a type
   34 |         for(i=0;i<=s;i++){
      |                 ^
a.cc:34:22: error: 'i' does not name a type
   34 |         for(i=0;i<=s;i++){
      |                      ^
a.cc:39:15: error: expected constructor, destructor, or type conversion before '(' token
   39 |         printf("%d\n",n);
      |               ^
a.cc:40:9: error: expected unqualified-id before 'return'
   40 |         return 0;
      |         ^~~~~~
a.cc:41:1: error: expected declaration before '}' token
   41 | }
      | ^
Language: C++

#include<stdio.h>
int max,n,m,h,max,sum,a[100000],b[3000],i;
int main(void)
{
	scanf("%d %d %d",&n,&m,&h);
	for(i=1;i<=n;i++)	scanf("%d %d",&a[i],&b[i]);
	sum=0; max=0;
	func(0,1);
	printf("%d\n",max);
	return 0;
}
int func(int m1,int n1){
	if(n>=n1&&m>=m1){
		if(m1<h&&m1+b[n1]>h);
		else if(m1+b[n1]<=m){
			m1+=b[n1];
			sum+=a[n1];
		}
//		printf("%d %d %d\n",n1,m1,sum);
		if(m1==m&&sum>max) max=sum;
		func(m1+1,n1+1);
	}
}


Compiler output:
a.cc:2:15: error: redefinition of 'int max'
    2 | int max,n,m,h,max,sum,a[100000],b[3000],i;
      |               ^~~
a.cc:2:5: note: 'int max' previously declared here
    2 | int max,n,m,h,max,sum,a[100000],b[3000],i;
      |     ^~~
a.cc: In function 'int main()':
a.cc:8:9: error: 'func' was not declared in this scope
    8 |         func(0,1);
      |         ^~~~
a.cc: In function 'int func(int, int)':
a.cc:23:1: warning: no return statement in function returning non-void [-Wreturn-type]
   23 | }
      | ^
Language: C++

#include <cstdio>
#include <algorithm>
using namespace std;
int main(){
	long long n,s,t,a[3001],b[3001];
	long long dp[3001][3001]={};
	scanf("%lld %lld %lld",&n,&s,&t);
	for(int i=0;i<n;i++){
		scanf("%d %d",&a[i],&b[i]);
	}
	for(int i=0;i<n;i++){
		for(int j=0;j<=t;j++){
			if(j<b[i]){
				dp[i+1][j]=dp[i][j];
			}else{
				if(j-b[i]<t-s && t-s<j){
					dp[i+1][j]=max(dp[i][j],dp[i][t-s]+a[i]);
				}else{
				dp[i+1][j]=max(dp[i][j],dp[i][j-b[i]]+a[i]);
			}
		}
	}
	printf("%lld\n",dp[n][t]);
	return 0;
}

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

#include <string>
#include <vector>
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<sstream>
#include<functional>
#include<map>
#include<set>
#include<cmath>


using namespace std;


int main(){

      int N,T,S;

      cin >> N;
      cin >> T;
      cin >> S;

      int AB[N+1][2];
      AB[0][0]=0; AB[0][1]=0;

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

       int dp[N+1][T+1];
       int dq[N+1][T+1];

       for(int i=0;i<=N;i++){
       for(int j=0;j<=T;j++){
	dp[i][j]=0; dq[i][j]=0;
        }
    }

       int p=0;
       for(int K=0;K<=N;K++){

       if(K==0) dp[K][S]=0;

       if(K>=1){

       for(int i=0;i<K;i++){
       for(int j=0;j<=S;j++){

       if(j<AB[i][1]) dp[i+1][j]=dp[i][j];
       else dp[i+1][j]=max(dp[i][j],dp[i][j-AB[i][1]]+AB[i[0]);

      }
      }
      }

    if(K==N) dq[N-K][T-S]=0;

    if(K<N){

    for(int i=0;i<N-K;i++){
    for(int j=0;j<=T-S;j++){

    if(i==0) dq[i][j]=0;
    else if(j<AB[i+K][1]) dq[i+1][j]=dq[i][j];
else                                                                                  dq[i+1][j]=max(dq[i][j],dq[i][j-AB[i+K][1]]+AB[i+K][0]);

    }
    }
    }

if(p<dp[K][S]+dq[N-K][T-S]) p=dp[K][S]+dq[N-K][T-S];

     for(int i=0;i<=N;i++){
     for(int j=0;j<=T;j++){
         dp[i][j]=0; dq[i][j]=0;

	}
	}


	}

	cout << p;


	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:53:59: error: invalid types 'int[int]' for array subscript
   53 |        else dp[i+1][j]=max(dp[i][j],dp[i][j-AB[i][1]]+AB[i[0]);
      |                                                           ^
a.cc:53:62: error: expected ']' before ')' token
   53 |        else dp[i+1][j]=max(dp[i][j],dp[i][j-AB[i][1]]+AB[i[0]);
      |                                                              ^
      |                                                              ]
Language: C++

#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;

static int dp[3010][3010];
const int inf = (int)1e9;

int solve(int n, int t, int s, vector<int> &a, vector<int> &b)
{
if(t < 0)
return -inf;
if(n < 0)
return 0;
if(dp[n][t] != -1)
return dp[n][t];
int ans = 0;
int temp;

temp = solve(n - 1, t, s, a, b);
ans = max(temp, ans);
bool cross = s < t && t - b[i] < s;
if(cross)
temp = solve(n, s, s, a, b);
else
temp = solve(n - 1, t - b[i], s, a, b);
ans = max(temp, ans);
return dp[n][t] = ans;
}

int main()
{
int n, t, s;
vector<int> a, b;
scanf("%d%d%d", &n, &t, &s);
for(int i = 0; i < n; ++i)
scanf("%d%d", &a[i], &b[i]);
fill(dp[0], dp[3010], -1);
int ans = solve(n, t, s, a, b);
printf("%d\n", ans);
return 0;
}

Compiler output:
a.cc: In function 'int solve(int, int, int, std::vector<int>&, std::vector<int>&)':
a.cc:22:29: error: 'i' was not declared in this scope
   22 | bool cross = s < t && t - b[i] < s;
      |                             ^
Language: C++

å#include <cstdio>
#define S 5010
using namespace std;
int l[S][S]={0};

int main(){
    int N,M,a,b,x,i,j;
    scanf("%d %d",&N,&M);
    for(i=0;i<M;i++){
        scanf("%d %d %d",&a,&b,&x);
        l[a][b]++;
        l[a][b+1]--;
        l[a+x+1][b]--;
        l[a+x+2][b+1]++;
        l[a+x+2][b+x+2]--;
        l[a+x+1][b+x+2]++;
    }
    for(i=1;i<N+4;i++){
        for(j=1;j<N+4;j++){
            l[i][j]+=l[i][j-1];
        }
    }
    for(j=1;j<N+4;j++){
        for(i=1;i<N+4;i++){
            l[i][j]+=l[i-1][j]; 
        }
    }
    for(i=1;i<N+4;i++){
        for(j=1;j<N+4;j++){
            if(i+j-1<S){
                l[i+j-1][j]+=l[i+j-2][j-1]; 
            }
        }
    }
    int cnt=0;
    for(i=0;i<N+4;i++){
        for(j=0;j<N+4;j++){
            if(l[i][j]>0){cnt++;}
        }
    }
    printf("%d\n",cnt);
    return 0;
}
    



Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | å#include <cstdio>
      |  ^
a.cc:1:1: error: '\U000000e5' does not name a type
    1 | å#include <cstdio>
      | ^
a.cc: In function 'int main()':
a.cc:8:5: error: 'scanf' was not declared in this scope
    8 |     scanf("%d %d",&N,&M);
      |     ^~~~~
a.cc:41:5: error: 'printf' was not declared in this scope
   41 |     printf("%d\n",cnt);
      |     ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | å#include <cstdio>
Language: C++

#include<iostream>
#include<cstdio>

using namespace std;

int n,m,ans=0;
vector<int> tri[5007];


int main(void){
	scanf("%d%d",&n,&m);
	for(int i=0;i<=n+3;i++){
		for(int j=0;j<i;j++)tri[i].push_back(0);
	}
	for(int i=0;i<m;i++){
		int x,y,size;
		scanf("%d%d%d",&y,&x,&size);
		size++;
		tri[x][y]+=1;
		tri[x+1][y]-=1;
		tri[x][y+size]-=1;
		tri[x+1][y+size+1]+=1;
		tri[x+size+1][y+size]+=1;
		tri[x+size+1][y+size+1]-=1;
	}
	for(int i=1;i<=n;i++){
		for(int j=2;j<=n;j++){
			tri[j][i]+=tri[j-1][i];
		}
	}
	for(int i=1;i<=n;i++){
		for(int j=2;j<=n;j++){
			tri[i][j]+=tri[i][j-1];
		}
	}
	for(int i=1;i<=n;i++){
		int y=2,x=i+2;
		while(x<=n){
			tri[x][y]+=tri[x-1][y-1];
			y++,x++;
		}
	}
	for(int i=1;i<=n;i++){
		int y=i+1,x=2;
		while(y<=n){
			tri[x][y]+=tri[x-1][y-1];
			y++,x++;
		}
	}
	for(int i=1;i<=n;i++){
		for(int j=1;j<=i;j++){
			if(tri[j][i]>=1)ans++;
			//printf("%d%c",tri[j][i],j==n?'\n':' ');
		}
	}
	printf("%d\n",ans);
    return 0;
}

Compiler output:
a.cc:7:1: error: 'vector' does not name a type
    7 | vector<int> tri[5007];
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:13:37: error: 'tri' was not declared in this scope
   13 |                 for(int j=0;j<i;j++)tri[i].push_back(0);
      |                                     ^~~
a.cc:19:17: error: 'tri' was not declared in this scope
   19 |                 tri[x][y]+=1;
      |                 ^~~
a.cc:28:25: error: 'tri' was not declared in this scope
   28 |                         tri[j][i]+=tri[j-1][i];
      |                         ^~~
a.cc:33:25: error: 'tri' was not declared in this scope
   33 |                         tri[i][j]+=tri[i][j-1];
      |                         ^~~
a.cc:39:25: error: 'tri' was not declared in this scope
   39 |                         tri[x][y]+=tri[x-1][y-1];
      |                         ^~~
a.cc:46:25: error: 'tri' was not declared in this scope
   46 |                         tri[x][y]+=tri[x-1][y-1];
      |                         ^~~
a.cc:52:28: error: 'tri' was not declared in this scope
   52 |                         if(tri[j][i]>=1)ans++;
      |                            ^~~
Language: C++

#include <cstdio>
#include <cstring>
#include <cmath>
#include <iostream>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <set>
using namespace std;

#define rep(i,n) for(int i=0;i<(n);i++)
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define dbg(x) cout<<#x"="<<x<<endl

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<pii, int> ppi;

#define INF 1000000000
#define N_MAX 5000
#define M_MAX 500000

int nails[N_MAX+2][N_MAX+2];

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

  rep(i, n+2){
    rep(j,i+2)
      nails[i][j]=0;
  }

  // imosu method (applying to triangle)
  int a,b,x;
  rep(i, m){
    scanf("%d %d %d", &a, &b, &x);
    a--; b--;
    nails[a][b]++;
    nails[a][b+1]--;
    nails[a+x+1][b]--;
    nails[a+x+2][b+1]++;
    nails[a+x+2][b+x+2]--;
    nails[a+x+1][b+x+2]++;
  }

  int current=0;
  // from left to right
  rep(i, n){
    current=0;
    rep(j, i+1){
      current += nails[i][j];
      nails[i][j] = current;
    }
  }
  // from upper-right to bottom-left
  rep(i,n){
    current=0;
    rep(j,n-i){
      current += nails[i+j][i];???
      nails[i+j][i] = current;
    }
  }

  int res=0;
  // from upper-left to bottom-right
  rep(i,n){
    current=0;
    rep(j, n-i){
      current += nails[i+j][j];
      nails[i+j][j] = current;
      if(current>0) res++;
    }
  }

  /*
  rep(i, n){
    rep(j,i+1){
      cout << nails[i][j];
    }
    cout << endl;
  }
  */


  cout << res << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:62:32: error: expected primary-expression before '?' token
   62 |       current += nails[i+j][i];???
      |                                ^
a.cc:62:33: error: expected primary-expression before '?' token
   62 |       current += nails[i+j][i];???
      |                                 ^
a.cc:62:34: error: expected primary-expression before '?' token
   62 |       current += nails[i+j][i];???
      |                                  ^
a.cc:63:30: error: expected ':' before ';' token
   63 |       nails[i+j][i] = current;
      |                              ^
      |                              :
a.cc:63:30: error: expected primary-expression before ';' token
a.cc:63:30: error: expected ':' before ';' token
   63 |       nails[i+j][i] = current;
      |                              ^
      |                              :
a.cc:63:30: error: expected primary-expression before ';' token
a.cc:63:30: error: expected ':' before ';' token
   63 |       nails[i+j][i] = current;
      |                              ^
      |                              :
a.cc:63:30: error: expected primary-expression before ';' token
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int n;
  int m;
  cin >> n >> m;
  int y,x,offset;
  short data[5002][5002] = {0};
  while(m--){
    scanf("%d %d %d",&y,&x,&offset);
    data[y][x] = offset + 1;
  }
  int sum = 0;
  for(int i = 1;i <= n;i++){
    for(int j = 1;j <= i;j++){
      data[i][j] = max({data[i][j],data[i - 1][j - 1] - 1,data[i - 1][j] - 1});
      if(data[i][j])sum++;
    }
    cout << endl;
  }
  cout << sum << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:23: error: no matching function for call to 'max(<brace-enclosed initializer list>)'
   16 |       data[i][j] = max({data[i][j],data[i - 1][j - 1] - 1,data[i - 1][j] - 1});
      |                    ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   template argument deduction/substitution failed:
a.cc:16:23: note:   deduced conflicting types for parameter '_Tp' ('short int' and 'int')
   16 |       data[i][j] = max({data[i][j],data[i - 1][j - 1] - 1,data[i - 1][j] - 1});
      |                    ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   candidate expects 2 arguments, 1 provided
Language: C++

#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef double db;

#define fr first
#define sc second
#define pb push_back
#define rep(i,x) for(ll i=0;i<x;i++)
#define rep1(i,x) for(ll i=1;i<=x;i++)
#define rrep(i,x) for(ll i=x-1;i>=0;i--)
#define rrep1(i,x) for(ll i=x;i>0;i--)

ll N,M;
ll a,b,x;
ll imos[5002][5002];

int main()
{
	scanf("%lld%lld",&N,&M);
	ll H=W=N;
	rep(i,M){
		scanf("%lld%lld%lld",&a,&b,&x);
		a--;
		--b;
		x++;
		imos[a][b]++;
		imos[a][b+1]--;
		imos[a+x][b]--;
		imos[a+x+1][b+1]++;
		imos[a+x][b+x+1]++;
		imos[a+x+1][b+x+1]--;
	}
	rep(i,H+2) rep(j,W+2){
		if(i>0&&j>0){
			imos[i][j]+=imos[i-1][j-1];
		}
	}
	rep(i,H+2) rep(j,W+2){
		if(i>0){
			imos[i][j]+=imos[i-1][j];
		}
	}
	rep(i,H+2) rep(j,W+2){
		if(j>0){
			imos[i][j]+=imos[i][j-1];
		}
	}
	ll ans=0;
	rep(i,H) rep(j,i+1) if(imos[i][j]>0) ans++;
	cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:14: error: 'W' was not declared in this scope
   31 |         ll H=W=N;
      |              ^
Language: C++

#include <cstdio>
#include <iostream>
#include <vector>
#include <list>
#include <cmath>
#include <fstream>
#include <algorithm>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <complex>
#include <iterator>
#include <cstdlib>
#include <cstring>
#include <sstream>

using namespace std;

const double EPS=(1e-10);
typedef long long ll;
typedef pair<int,int> pii;
bool EQ(double a,double b){
  return abs((a)-(b))<EPS;
}
void fast_stream(){
	std::ios_base::sync_with_stdio(0);
}

short dp[5001][5001];
void dfs(int x,int y,int depth){
    if(dp[y][x]>=depth)return;
    dp[y][x]=depth;
    if(depth==0)return;
    int ny=y+1;
    int nx=x+1;
    dfs(nx,ny,depth-1);
    ny=y;
    dfs(nx,ny,depth-1);
}

void solve(){
    memset(dp,-1,sizeof(dp));
    int n,m;
    cin>>n>>m;
    for(int i=0;i<m;i++){
        int x,y,a;
        cin>>x>>y>>a;
        dfs(x,y,a);
    }
    int cnt=0;
    for(int i=0;i<=n;i++){
        for(int j=0;j<=n;j++){
            if(dp[j][i]>=0)cnt++;
        }
    }
    cout<<cnt<<endl;
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include <cstdio>
#include <iostream>
#include <vector>
#include <list>
#include <cmath>
#include <fstream>
#include <algorithm>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <complex>
#include <iterator>
#include <cstdlib>
#include <cstring>
#include <sstream>

using namespace std;

const double EPS=(1e-10);
typedef long long ll;
typedef pair<int,int> pii;
bool EQ(double a,double b){
  return abs((a)-(b))<EPS;
}
void fast_stream(){
	std::ios_base::sync_with_stdio(0);
}

short dp[5001][5001];
void dfs(int x,int y,int depth){
    if(dp[y][x]>=depth)return;
    dp[y][x]=depth;
    if(depth==0)return;
    int ny=y+1;
    int nx=x+1;
    dfs(nx,ny,depth-1);
    ny=y;
    dfs(nx,ny,depth-1);
}

void solve(){
    memset(dp,-1,sizeof(dp));
    int n,m;
    cin>>n>>m;
    for(int i=0;i<m;i++){
        int x,y,a;
        cin>>x>>y>>a;
        dp[x][y]=a;
        //dfs(x,y,a);
    }
    for(int i=1;i<=n;i++){
        for(int j=1;j<=i;j++){
            dp[i+1][j+1]=max(dp[i+1][j+1],(short)(dp[i][j]-1));
            dp[i+1][j]=max(dp[i+1][j],(short)(dp[i][j]-1));
        }
    }
    int cnt=0;
    for(int i=1;i<=n;i++){
        for(int j=1;j<=i;j++){
            if(dp[i][j]>=0)cnt++;
        }
    }
    cout<<cnt<<endl;
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include<stdio.h>
int main(){
	int bool[5000][5000]={};
	int n,m,a,b,c,x,y,z,t=0;
	scanf("%d %d",&n,&m);
	for(a=0;a<m;a++){
		scanf("%d %d %d",&x,&y,&z);
		for(b=0;b<z+1;b++){
			for(c=0;c<z+1;c++){
				if(b>=c){nail[x+b-1][y+c-1]=1;}
			}
		}
	}
	for(a=0;a<n;a++){
		for(b=0;b<n;b++){
			if(nail[a][b]==1){t++;}
		}
	}
	printf("%d\n",t);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:18: error: expected identifier before numeric constant
    3 |         int bool[5000][5000]={};
      |                  ^~~~
a.cc:3:18: error: expected ']' before numeric constant
    3 |         int bool[5000][5000]={};
      |                  ^~~~
      |                  ]
a.cc:3:9: error: two or more data types in declaration of 'structured binding'
    3 |         int bool[5000][5000]={};
      |         ^~~
a.cc:3:17: error: empty structured binding declaration
    3 |         int bool[5000][5000]={};
      |                 ^
a.cc:3:23: error: expected initializer before '[' token
    3 |         int bool[5000][5000]={};
      |                       ^
a.cc:10:42: error: 'nail' was not declared in this scope
   10 |                                 if(b>=c){nail[x+b-1][y+c-1]=1;}
      |                                          ^~~~
a.cc:16:28: error: 'nail' was not declared in this scope
   16 |                         if(nail[a][b]==1){t++;}
      |                            ^~~~
Language: C++

#include <cstdio>

int main()
{
int n, m;
static int nail[5000][5000] = {0};
scanf("%d%d", &n, &m);
for(int i = 0; i < m; ++i) {
int a, b, x;
scanf("%d%d%d", &a, &b, &x);
a -= 1, b -= 1;
nail[a][b] = x;
}
int ans = 0;
for(int a = 0; a < n; ++a) {
for(int b = 0; b < n; ++b) {
int l = a > 0 && b > 0 ? nail[a - 1][b - 1] : 1;
int r = a > 0 ? nail[a - 1][b] : 1;
nail[a][b] = max(nail[a][b], max(l - 1, r - 1));
if(nail[a][b] > 0)
ans += 1;
}
}
printf("%d\n", ans);
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:30: error: 'max' was not declared in this scope
   19 | nail[a][b] = max(nail[a][b], max(l - 1, r - 1));
      |                              ^~~
a.cc:19:14: error: 'max' was not declared in this scope
   19 | nail[a][b] = max(nail[a][b], max(l - 1, r - 1));
      |              ^~~
Language: C++

#include<iostream>
#include<algorithm>
#include<cstdlib>

using namespace std;

int main(void){

  int n,m,a,b,x;
static int nails[5001][5001];

  memset(nails,0,sizeof(nails));

  cin >> n >> m;

  for(int i=0;i<m;i++){
    cin >> a >> b >> x;
    nails[a][b]=x+1;
  }

  for(int i=1;i<=n;i++){
    for(int j=1;j<=i;j++){
      nails[i][j]=max(nails[i][j],max(nails[i-1][j-1],nails[i-1][j])-1);      
    }
  }

  int cnt=0;
  for(int i=1;i<=n;i++)
    for(int j=1;j<=i;j++)
      if(nails[i][j]>0)cnt++;
     
  cout << cnt << endl;

  return 0;
}

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

#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <complex>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define EQ(a,b) (abs((a)-(b))<EPS)
int bo[5010][5010];
int n,m;
void cal(int p,int q;)
{
	int i,j;
	i=p;j=q;
	for(int k=0;k<=n+1-i;k++)
	{
		bo[i][j]+=bo[i-1][j-1];
		i++;j++;
	}
	return ;
}

int main()
{
	ll ans=0;
	cin >> n >> m;
	for(int i=0;i<m;i++)
	{
		int a,b,x;
		cin >> a >> b >> x;
		bo[a][b]++;
		bo[a][b+1]--;
		bo[a+x+1][b]--;
		bo[a+x+1][b+x+2]++;
		bo[a+x+2][b+1]++;
		bo[a+x+2][b+x+2]--;
	}
	for(int i=1;i<n+2;i++)
	{
		for(int j=1;j<=i;j++)
		{
			bo[i][j]+=bo[i][j-1];
		}
	}
	for(int i=1;i<n+2;i++)
	{
		for(int j=i;j<n+2;j++)
		{
			bo[j][i]+=bo[j-1][i];
		}
	}
	for(int i=1;i<=n;i++)
	{
		cal(i,1);
	}
	for(int i=1;i<=n;i++)
	{
		for(int j=1;j<=i;j++)
		{
			if(bo[i][j])ans++;
		}
	}
	for(int i=1;i<=n;i++)
	{
		for(int j=1;j<=i;j++)
		{
			cout << bo[i][j] << ' ';
		}
		cout << endl;
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc:32:21: error: expected ')' before ';' token
   32 | void cal(int p,int q;)
      |         ~           ^
      |                     )
a.cc:32:22: error: expected unqualified-id before ')' token
   32 | void cal(int p,int q;)
      |                      ^
Language: C++

#include <iostream>
#include <algorithm>
#include <map>
#include <set>

using namespace std;

#define loop(i,a,b) for(int i=(a); i<int(b); i++)
#define rep(i,b) loop(i,0,b)

int dp[2][5010] = {};

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

    typedef pair<int, int> P;
    map<P, int> ps;

    rep(i, m){
        int x, y, c; cin >> x >> y >> c;
        x--, y--, c++;
        ps[P(x, y)] = c;
    }

    int ans = 0;

    int* cur = dp[0];
    int* prev = dp[1];
    loop(i, 0, n){
        memset(cur, 0, sizeof(cur));
        rep(j, i + 1){
            int t = ps[P(i, j)];
            if (j - 1 >= 0) t = max(t, prev[j - 1] - 1);
            if (j < i + 1) t = max(t, prev[j] - 1);
            ans += t != 0;
            cur[j] = t;
        }
        swap(cur, prev);
    }

    cout << ans << endl;
}

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

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>


typedef long long ll;

using namespace std;

struct TOWN{
    vector<pair<int,int> > road;
    int df,ans;
    bool kaku;
    
    TOWN()
    :df(INT_MAX),kaku(false)
    {}
    
}town[100001];

int main(){
    int n,m,k,q,a,b,c;
    
    priority_queue<pair<int,int> > dij;
    
    
    scanf("%d%d%d%d",&n,&m,&k,&q);
    
    for(int i=0;i<m;i++){
        scanf("%d%d%d",&a,&b,&c);
        town[a].road.push_back(make_pair(b,-c));
        town[b].road.push_back(make_pair(a,-c));
    }
    
    for(int i=0;i<k;i++){
        scanf("%d",&a);
        town[a].df=0;
        dij.push(make_pair(0,a));
    }
    
    while(!dij.empty()){
        pair<int,int> p;
        
        p=dij.top();
        dij.pop();
        
        
        if(!town[p.second].kaku){
            town[p.second].kaku=true;
            town[p.second].df=-p.first;
            
            for(int i=0;i<town[p.second].road.size();i++){
                if(!town[town[p.second].road[i].first].kaku){
                    dij.push(make_pair(p.first+town[p.second].road[i].second,town[p.second].road[i].first));
                }
            }
        }
    }
    
    for(int i=0;i<q;i++){
        
        for(int j=1;j<=n;j++){
            town[j].ans=0;
            town[j].kaku=false;
        }

        scanf("%d%d",&a,&b);
        dij.push(make_pair(town[a].df,a));
        
        while(!dij.empty()){
            pair<int,int> p;
            
            p=dij.top();
            dij.pop();
            
            if(p.second==b){
                printf("%d\n",p.first);
                break;
            }
            
            if(!town[p.second].kaku){
                town[p.second].kaku=true;
                town[p.second].ans=p.first;
                
                for(int i=0;i<town[p.second].road.size();i++){
                    if(!town[town[p.second].road[i].first].kaku){
                        dij.push(make_pair(min(p.first,town[town[p.second].road[i].first].df),town[p.second].road[i].first));
                    }
                }
            }
        }
    }
    
    
    return 0;
}

Compiler output:
a.cc: In constructor 'TOWN::TOWN()':
a.cc:24:9: error: 'INT_MAX' was not declared in this scope
   24 |     :df(INT_MAX),kaku(false)
      |         ^~~~~~~
a.cc:12:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   11 | #include <set>
  +++ |+#include <climits>
   12 |
Language: C++

#include<bits/stdc++.h>
using namespace std;
int N,M,K,a,b,c,d[200000],dist[200000];
vector<pair<int,int> >x[120000];
priority_queue<pair<int,int>,vector<pair<int,int> >,greater<pair<int,int> > >Q;
int main(){
	cin>>N>>M>>K;
	for(int i=0;i<M;i++){
		cin>>a>>b>>c;x[a].push_back(make_pair(b,c));x[b].push_back(make_pair(a,c));
	}
	for(int i=0;i<K;i++){cin>>a;d[a]=1;}
	for(int i=1;i<=N;i++){dist[i]=999999999;if(d[i]==1){dist[i]=0;Q.push(make_pair(0,i));}}
	while(!Q.empty()){
		int a1=Q.top().first,a2=Q.top().second;Q.pop();
		for(int i=0;i<(int)x[a2].size();i++){
			if(dist[x[a2][i].first]>a1+x[a2][i].second){
				dist[x[a2][i].first]=a1+x[a2][i].second;
				Q.push(make_pair(dist[x[a2][i].first],x[a2][i].first));
			}
		}
	}
	for(int i=1;i<=N;i++)d[i]=dist[i];
	int Q;cin>>Q;
	for(int i=0;i<Q;i++){
		cin>>a>>b;for(int j=1;j<=N;j++)dist[j]=0;
		dist[a]=d[a];Q.push(make_pair(-1*dist[a],a));
		while(!Q.empty()){
			int a1=-1*(Q.top().first);
			int a2=Q.top().second;Q.pop();
			for(int j=0;j<(int)x[a2].size();j++){
				int to=x[a2][j].first;
				int cost=min(a1,d[x[a2][j].first]);
				if(dist[to]<cost){
					dist[to]=cost;Q.push(make_pair(-dist[to],to));
				}
			}
		}
		cout<<dist[b]<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:32: error: request for member 'push' in 'Q', which is of non-class type 'int'
   26 |                 dist[a]=d[a];Q.push(make_pair(-1*dist[a],a));
      |                                ^~~~
a.cc:27:26: error: request for member 'empty' in 'Q', which is of non-class type 'int'
   27 |                 while(!Q.empty()){
      |                          ^~~~~
a.cc:28:38: error: request for member 'top' in 'Q', which is of non-class type 'int'
   28 |                         int a1=-1*(Q.top().first);
      |                                      ^~~
a.cc:29:34: error: request for member 'top' in 'Q', which is of non-class type 'int'
   29 |                         int a2=Q.top().second;Q.pop();
      |                                  ^~~
a.cc:29:49: error: request for member 'pop' in 'Q', which is of non-class type 'int'
   29 |                         int a2=Q.top().second;Q.pop();
      |                                                 ^~~
a.cc:34:57: error: request for member 'push' in 'Q', which is of non-class type 'int'
   34 |                                         dist[to]=cost;Q.push(make_pair(-dist[to],to));
      |                                                         ^~~~
Language: C++

epth[x];
			for(int l = 0; l < 20; l++)

Compiler output:
a.cc:1:1: error: 'epth' does not name a type
    1 | epth[x];
      | ^~~~
a.cc:2:25: error: expected unqualified-id before 'for'
    2 |                         for(int l = 0; l < 20; l++)
      |                         ^~~
a.cc:2:40: error: 'l' does not name a type
    2 |                         for(int l = 0; l < 20; l++)
      |                                        ^
a.cc:2:48: error: 'l' does not name a type
    2 |                         for(int l = 0; l < 20; l++)
      |                                                ^
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 L,A,B,C,D;

public static void main(String[] args) throws IOException{
InputReader ir=new InputReader(in);
L=ir.nextInt();
A=ir.nextInt();
B=ir.nextInt();
C=ir.nextInt();
D=ir.nextInt();
A=(A%C==0)?A/C:A/C+1;
B=(B%D==0)?B/D:B/D+1;
out.println(L-Math.max(A,B));
out.flush();
}

public static boolean isPalindrome(int s,int e){
for(int i=0;i<=(e-s)/2;i++) if(str.charAt(s+i)!=str.charAt(e-i)) return false;
return true;
}

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:38: error: cannot find symbol
for(int i=0;i<=(e-s)/2;i++) if(str.charAt(s+i)!=str.charAt(e-i)) return false;
                               ^
  symbol:   variable str
  location: class Main
Main.java:38: error: cannot find symbol
for(int i=0;i<=(e-s)/2;i++) if(str.charAt(s+i)!=str.charAt(e-i)) return false;
                                                ^
  symbol:   variable str
  location: class Main
2 errors
Language: Java

public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
	int l = sc.nextInt();
	int a = sc.nextInt();
	int b = sc.nextInt();
	int c = sc.nextInt();
	int d = sc.nextInt();
	int r;
	if(a/c+1>=b/d+1) r = l-(a/c+1);
	else r = l-(b/d+1);
	System.out.println(r);
}

Compiler output:
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String[] args) {
              ^
  (use --enable-preview to enable unnamed classes)
1 error
Language: Java

package aoj0576;

import java.util.Scanner;

public class Homework {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		int l = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();
		int k_cnt = 0, s_cnt = 0, answer;
		while(a > 0) {
			a = a - c;
			k_cnt = k_cnt + 1;
		}
		while(b > 0) {
			b = b - d;
			s_cnt = s_cnt + 1;
		}
		if(k_cnt > s_cnt) {
			answer = l - k_cnt;
		} else {
			answer = l - s_cnt;
		}
		System.out.println(answer);
	}

}

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

public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		int l = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();
		int k_cnt = 0, s_cnt = 0, answer;
		while(a > 0) {
			a = a - c;
			k_cnt = k_cnt + 1;
		}
		while(b > 0) {
			b = b - d;
			s_cnt = s_cnt + 1;
		}
		if(k_cnt > s_cnt) {
			answer = l - k_cnt;
		} else {
			answer = l - s_cnt;
		}
		System.out.println(answer);
	}

Compiler output:
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String[] args) {
              ^
  (use --enable-preview to enable unnamed classes)
1 error
Language: Java

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int L = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		int D = sc.nextInt();
		int Japa , Math;
		
		if(A % C == 0){
			Japa = A / C;
		}else{
			Japa = A / C + 1;
		}
		
		if(B % D == 0){
			Math = B / D;
		}else{
			Math = B / D + 1;
		}
		
		int Bigone = Japa;
		
		if(Japa < Math){
			Bigone = Math;
		}
		
		System.out.println(L - Bigone);
		
	}
	
}

Compiler output:
Main.java:3: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java

public class Homework {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		int l = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();
		int k_cnt = 0, s_cnt = 0, answer;
		while(a > 0) {
			a = a - c;
			k_cnt = k_cnt + 1;
		}
		while(b > 0) {
			b = b - d;
			s_cnt = s_cnt + 1;
		}
		if(k_cnt > s_cnt) {
			answer = l - k_cnt;
		} else {
			answer = l - s_cnt;
		}
		System.out.println(answer);
	}

}

Compiler output:
Main.java:1: error: class Homework is public, should be declared in a file named Homework.java
public class Homework {
       ^
Main.java:5: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Homework
Main.java:5: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Homework
3 errors
Language: Java

import java.util.Scanner;

public class Homework {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		int l = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();
		int k_cnt = 0, s_cnt = 0, answer;
		while(a > 0) {
			a = a - c;
			k_cnt = k_cnt + 1;
		}
		while(b > 0) {
			b = b - d;
			s_cnt = s_cnt + 1;
		}
		if(k_cnt > s_cnt) {
			answer = l - k_cnt;
		} else {
			answer = l - s_cnt;
		}
		System.out.println(answer);
	}

}

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

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int l = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();
		int r;
		if(a/c+1>=b/d+1) r = l-(a/c+1);
		else r = l-(b/d+1);
		System.out.println(r);
	}

}

Compiler output:
Main.java:4: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
2 errors