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

main(x,y,a,b,c){for(;scanf("%d%d",&x,&y),x|y;printf("%d %d %d\n",a,b,c))for(y-=x,a=b=c=0;y;)(y>999)?++c,y-=1000:(y>499)?++b,y-=500:++a,y-=100;}

Compiler output:
a.cc:1:5: error: expected constructor, destructor, or type conversion before '(' token
    1 | main(x,y,a,b,c){for(;scanf("%d%d",&x,&y),x|y;printf("%d %d %d\n",a,b,c))for(y-=x,a=b=c=0;y;)(y>999)?++c,y-=1000:(y>499)?++b,y-=500:++a,y-=100;}
      |     ^
Language: C++

main(){int x,y,a,b,c;for(;scanf("%d%d",&x,&y),x|y;printf("%d %d %d\n",a,b,c))for(y-=x,a=b=c=0;y;)(y>999)?++c,y-=1000:(y>499)?++b,y-=500:++a,y-=100;}

Compiler output:
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    1 | main(){int x,y,a,b,c;for(;scanf("%d%d",&x,&y),x|y;printf("%d %d %d\n",a,b,c))for(y-=x,a=b=c=0;y;)(y>999)?++c,y-=1000:(y>499)?++b,y-=500:++a,y-=100;}
      | ^~~~
a.cc: In function 'int main()':
a.cc:1:27: error: 'scanf' was not declared in this scope
    1 | main(){int x,y,a,b,c;for(;scanf("%d%d",&x,&y),x|y;printf("%d %d %d\n",a,b,c))for(y-=x,a=b=c=0;y;)(y>999)?++c,y-=1000:(y>499)?++b,y-=500:++a,y-=100;}
      |                           ^~~~~
a.cc:1:51: error: 'printf' was not declared in this scope
    1 | main(){int x,y,a,b,c;for(;scanf("%d%d",&x,&y),x|y;printf("%d %d %d\n",a,b,c))for(y-=x,a=b=c=0;y;)(y>999)?++c,y-=1000:(y>499)?++b,y-=500:++a,y-=100;}
      |                                                   ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | main(){int x,y,a,b,c;for(;scanf("%d%d",&x,&y),x|y;printf("%d %d %d\n",a,b,c))for(y-=x,a=b=c=0;y;)(y>999)?++c,y-=1000:(y>499)?++b,y-=500:++a,y-=100;}
Language: C++

#include <iostream>
using namespace std;

void solve(){
	int v,m;
	while(cin >> v >> m, (v!=0 && m!=0) ){
		int change = m-v;
		
		int th = change/1000;
		change -= th*1000;

		int fifh = change/500;
		change -= fifh*500;

		int ah = change/100;
		
		cout << th << " " << fifh << " " << ah << endl;
	}
	return;
}

int main(void){
	solve();
	int i; cin >> i;
	return 0;
}#include <iostream>
using namespace std;

void solve(){
	int v,m;
	while(cin >> v >> m, (v!=0 && m!=0) ){
		int change = m-v;
		
		int th = change/1000;
		change -= th*1000;

		int fifh = change/500;
		change -= fifh*500;

		int ah = change/100;
		
		cout << th << " " << fifh << " " << ah << endl;
	}
	return;
}

int main(void){
	solve();
	return 0;
}

Compiler output:
a.cc:26:2: error: stray '#' in program
   26 | }#include <iostream>
      |  ^
a.cc:26:3: error: 'include' does not name a type
   26 | }#include <iostream>
      |   ^~~~~~~
a.cc:29:6: error: redefinition of 'void solve()'
   29 | void solve(){
      |      ^~~~~
a.cc:4:6: note: 'void solve()' previously defined here
    4 | void solve(){
      |      ^~~~~
a.cc:47:5: error: redefinition of 'int main()'
   47 | int main(void){
      |     ^~~~
a.cc:22:5: note: 'int main()' previously defined here
   22 | int main(void){
      |     ^~~~
Language: C++

include <iostream>

using namespace std;


int a, b;
int main(){
    while(cin >> a >> b, a || b){
        int c = b-a;
        int cnt1, cnt2, cnt3;
        cnt1 = cnt2 = cnt3 = 0;
        while(c/1000){
            c -= 1000;
            cnt1++;
        }
        while(c/500){
            c -= 500;
            cnt2++;
        }
        while(c/100){
            c -= 100;
            cnt3++;
        }
        cout << cnt3 << " " << cnt2 << " " << cnt1 << endl;
    }
    
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:8:11: error: 'cin' was not declared in this scope
    8 |     while(cin >> a >> b, a || b){
      |           ^~~
a.cc:24:9: error: 'cout' was not declared in this scope
   24 |         cout << cnt3 << " " << cnt2 << " " << cnt1 << endl;
      |         ^~~~
a.cc:24:55: error: 'endl' was not declared in this scope
   24 |         cout << cnt3 << " " << cnt2 << " " << cnt1 << endl;
      |                                                       ^~~~
Language: C++

import sys

def solve():
    while True:
        v,m = map(int,raw_input().split())
        if [v,m] == [0,0]:
	    return
	r1,r5,r10 = 0,0,0
	re = m - v
	r10 = re / 1000
	re %= 1000
	r5 = re	/ 500
	re %= 500
	r1 = re	/ 100
	print str(r1) +	" " + str(r5) +	" " + str(r10)



if __name__ == "__main__":
    solve()

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import sys
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: Java

import java.util.Scanner;

/*
 * テ、ツスツ陛・ツ崢榲ァツ崢ョテ」ツ?ョテヲツ篠「テァツエツ「テ」ツ?ァテヲツ敖・テ」ツ?淌」ツ?ョテ」ツ?凝」ツつ津・ツ?・テ」ツつ古」ツ?ヲテ」ツ?甘」ツ??
 * テ・ツ青古」ツ?佚・ツ崢榲ヲツ閉ーテァツ崢ョテ」ツ?ョテヲツ篠「テァツエツ「テ」ツ?ェテ」ツつ嘉」ツδォテ」ツδシテ」ツδ療」ツ?ァテ」ツ??ゥツ?陛」ツ??」ツ?ェテ」ツつ嘉」ツつづ」ツ??ヲツ猟「テ」ツ?ォテ」ツ?敕」ツ?ョテ」ツδォテ」ツδシテ」ツδ療」ツ?ッテ」ツつォテ」ツつヲテ」ツδウテ」ツδ暗ヲツクツ暗」ツ?ソ
 */
class E{
	int loop;
	int x;
	int y;
	
	E(int a,int b){
		loop=0;
		x=a;
		y=b;
	}
}
public class AOJ2217 {
	E map[][];
	int count;//,sx,sy;
	public static void main(String[] args) {
		new AOJ2217().run();
	}
	void run(){
		Scanner sc=new Scanner(System.in);
		
		while(true){
			int n=sc.nextInt();
			if(n==0) break;
			map=new E[n][n];
			for(int i=0;i<n;i++){
				for(int j=0;j<n;j++){
					int a=sc.nextInt();
					int b=sc.nextInt();
					map[j][i]= new E(a,b);
				}
			}
			int c=1;//loop number
			count=0;
			for(int i=0;i<n;i++){
				for(int j=0;j<n;j++){
					if(map[j][i].loop==0){
						//sx=j;sy=i;
						solve(j, i, c);
						c++;//loop number
					}
				}
			}
			System.out.println(count);
		}
	}
	
	void solve(int mx,int my,int c){
//		System.out.println(mx+" "+my+"  "+map[mx][my].x+" "+map[mx][my].y);
		
		if(0<map[mx][my].loop){//テ」ツ?ゥテ」ツ?」テ」ツ?凝」ツ?ョテヲツ篠「テァツエツ「テ」ツ?ァテヲツ敖・テ」ツ?淌」ツ?禿」ツ?ィテ」ツ?古」ツ?づ」ツつ?
			if(c==map[mx][my].loop){//テ、ツサツ甘・ツ崢榲」ツ?ョloopテ」ツ??」ツ?」テ」ツ?淌」ツつ嘉」ツ??ヲツ鳴ーテ」ツ?療」ツ??oopテ」ツつ津ィツヲツ凝」ツ?、テ」ツ?妥」ツ?淌」ツ?ョテ」ツ?ァテ・ツ「ツ療」ツつ?」ツ??
				count++;
			}
				return;//テ」ツ?凖」ツ?ァテ」ツ?ォティツヲツ凝」ツ?、テ」ツ?妥」ツ?殕oopテ」ツ??」ツ?」テ」ツ?淌」ツつ嘉」ツ?ェテ」ツ?ォテ」ツつづ」ツ?療」ツ?ェテ」ツ??
		}
		
		int a=map[mx][my].x;//テァツァツサテ・ツ仰陛・ツ?暗」ツつ津」ツ??」ツつ古」ツつ?
		int b=map[mx][my].y;
		
		map[mx][my].loop=c;//テ、ツサツ甘・ツ崢榲」ツ?ョloop numberテ」ツつ津」ツ??」ツつ古」ツつ?
		
		solve(a, b, c);
	}

}

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

1
0 0
2
1 1 0 1
1 0 0 0
2
1 1 0 1
1 1 1 0
3
0 1 2 2 2 1
0 2 1 2 2 1
0 0 0 1 1 1
4
3 2 2 0 3 2 2 1
1 1 0 3 1 1 3 1
0 3 2 3 3 0 2 3
1 1 1 1 3 2 1 3
0

Compiler output:
main.c:1:1: error: expected identifier or '(' before numeric constant
    1 | 1
      | ^
Language: C++

#include <stdio.h>
#include <utility>

using namespace std;

int p[100][100];
pair<int,int> f[100][100];

int dfs(int x,int y){
	p[x][y] = 1;
	if(p[f[x][y].first][f[x][y].second] == 1) return 1;
	else if(p[f[x][y].first][f[x][y].second] == 0) return 0;
	else return dfs(f[x][y].first,f[x][y].second);
}

int main(void){
	int i, j, k, l, n, c;
	while(1){
		scanf("%d",&n);
		if(!n) break;
		c = 0;
		memset(p,-1,sizeof(p));
		for(i = 0;i < n;i++){
			for(j = 0;j < n;j++){
				scanf("%d%d",&f[j][i].first,&f[j][i].second);
			}
		}
		for(i = 0;i < n;i++){
			for(j = 0;j < n;j++){
				if(p[j][i] == -1 && dfs(j,i)) c++;
				for(k = 0;k < n;k++){
					for(l = 0;l < n;l++) if(p[k][l] == 1) p[k][l] = 0;	
				}
			}
		}
		printf("%d\n",c);
	}
	return 0;
}

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

#include<iostream>
using namespace std;

int main()
{
  int n;
  bool bf=false;
  for(;cin>>n;)
    {
      if(bf)
	cout<<endl;
      bf=true;
      int point[4][13];
      for(int i=0;i<4;i++)
	for(int j=0;j<13;j++)
	  cin>>point[i][j];
      /*
      for(int i=0;i<4;i++,cout<<endl)
	for(int j=0;j<13;j++)
	  cout<<point[i][j];
      */
      int power[9];
      for(int j=0;j<9;j++)
	cin>>power[j];      
      
      //s=0,c=1,h=2,d=3
      for(;n--;)
	{
	  int card[5];
	  int ans=0;
	  bool mark=true;
	  //  cout<<mark<<endl;
	  char buf;
	  for(int i=0;i<5;i++)
	    {
	      char a,b;
	      int aa,bb;
	      cin>>a>>b;

	      if(i!=0&&buf!=b)
		mark=false;
	      buf=b;

	      aa=a-'0';
	      if(a=='A')
		aa=1;
	      if(a=='T')
		aa=10;
	      if(a=='J')
		aa=11;
	      if(a=='Q')
		aa=12;
	      if(a=='K')
		aa=13;	      
	      //s=0,c=1,h=2,d=3
	      if(b=='S')
		bb=0;
	      if(b=='C')
		bb=1;
	      if(b=='H')
		bb=2;
	      if(b=='D')
		bb=3;	      
	      card[i]=aa;
	      //   cout<<a<<b<<endl;
	      // cout<<bb<<" "<<aa<<endl;
	      //cout<<point[bb][aa-1]<<endl;;
	      ans+=point[bb][aa-1];
	      
	    }
	  sort(card,card+5);
	  //  cout<<mark<<endl;
	  if(mark&&
	     card[0]==1&&card[1]==10&&card[2]==11 &&card[3]==12 &&card[4]==13)
	    //royal straight
	    ans*=power[8];
	  else if(mark &&
		  card[0]==card[1]-1&&card[1]==card[2]-1&&
		  card[2]==card[3]-1&&card[3]==card[4]-1)
	    ans*=power[7];
	  else if((card[0]==card[1]&&card[1]==card[2]&&
		   card[2]==card[3])
		  ||(card[1]==card[2]&&card[2]==card[3]&&
		     card[3]==card[4]))
	    ans*=power[6];
	  else if((card[0]==card[1]&&card[1]==card[2]&&
		   card[3]==card[4])
		  ||(card[0]==card[1]
		     &&card[2]==card[3]&&card[3]==card[4]))
	    ans*=power[5];
	  else if(mark)
	    ans*=power[4];
	  else if((card[0]==1&&card[1]==10&&card[2]==11 &&card[3]==12 &&card[4]==13)||
		  (card[0]==card[1]-1&&card[1]==card[2]-1&&
		   card[2]==card[3]-1&&card[3]==card[4]-1))	    
	    //straight
	    ans*=power[3];
	  else if((card[0]==card[1]&&card[1]==card[2])||
		  (card[1]==card[2]&&card[2]==card[3])||
		  (card[2]==card[3]&&card[3]==card[4])
		  )
	    //スリーカード
	    ans*=power[2];
	  else
	    {
	      int cnt=0;
	      for(int i=0;i<4;i++)
		{
		  //		  cout<<card[i]<<" "<<card[i+1]<<endl;
		  if(card[i]==card[i+1])
		    cnt++;
		  
		}
		  if(cnt>1)
		ans*=power[1];
	      else if(cnt>0)
		ans*=power[0];
	      else
		ans=0;

		  //  cout<<cnt<<endl;
	    }
	  
	  cout<<ans<<endl;	  
	}


    }

}

Compiler output:
a.cc: In function 'int main()':
a.cc:71:11: error: 'sort' was not declared in this scope; did you mean 'short'?
   71 |           sort(card,card+5);
      |           ^~~~
      |           short
Language: Java

import java.util.Arrays;
import java.util.Scanner;

import p2219.Main.Unit;

public class Main2 {

	static int N,M;
	static int[][] idol;
	static int[][] dp;
	static int rank,ability;
	public static void main(String[] args) {
		Scanner cin=new Scanner(System.in);
		for(;;){
			String NM=cin.nextLine();
			N=Integer.parseInt(NM.substring(0,NM.indexOf(' ')));
			M=Integer.parseInt(NM.substring(NM.indexOf(' ')+1));
			idol=new int[N][4];
			
			for(int i=0;i<N;i++){
				String name=cin.nextLine();
				String cc=cin.nextLine();
				
				for(int j=0;j<3;j++){
					idol[i][j]=Integer.parseInt(cc.substring(0,cc.indexOf(" ")));
					cc=cc.substring(cc.indexOf(" ")+1);
				}
				idol[i][3]=Integer.parseInt(cc);
			}
			int ans=0;
			for(int i=1;i<=3;i++){
				dp=new int[301][90001];
				for(int j=0;j<301;j++){
					Arrays.fill(dp[j], -1);
				}
				rank=0;
				ability=i;
				ans=Math.max(ans,dp(0,M));
			}
			System.out.println(ans);
		}
	}
	static int dp(int a,int b){
//		System.out.println(a+" "+b+" "+rank);
		if(b==0)return 0;
		if(a==N){
			return 0;
		}
		if(dp[a][b]>=0)return dp[a][b];
		int re=0;
		for(int i=0;idol[a][0]*i<=b;i++){
			re=Math.max(re, dp(a+1,b-idol[a][0]*i)+idol[a][ability]*i);
			                                               
		}
		return dp[a][b]=re;
	}
}

Compiler output:
Main.java:6: error: class Main2 is public, should be declared in a file named Main2.java
public class Main2 {
       ^
Main.java:4: error: package p2219.Main does not exist
import p2219.Main.Unit;
                 ^
2 errors
Language: Java

import java.util.*;
public class AOJ_2219{
    void run(){
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()){
            int N = sc.nextInt();
            int M = sc.nextInt();
            int[] cost = new int[N];
            int[][] rank = new int[3][N];
            for(int i = 0; i < N; i++){
                sc.nextLine();//空白読み込み
                sc.nextLine();//名前読み込み
                cost[i] = sc.nextInt();
                rank[0][i] = sc.nextInt();
                rank[1][i] = sc.nextInt();
                rank[2][i] = sc.nextInt();
                
            }
            int[][] dp = new int[3][M+1];
            for(int i = 0; i < 3; i++){
                for(int ii = 0; ii < N; ii++){
                    for(int iii = 0; iii <= M - cost[ii]; iii++){
                        dp[i][iii+cost[ii]] = Math.max(dp[i][iii+cost[ii]], dp[i][iii]+rank[i][ii]);
                    }
                }
            }
            /*
            System.out.println(Arrays.toString(dp[0]));
            System.out.println(Arrays.toString(dp[1]));
            System.out.println(Arrays.toString(dp[2]));
            */

            int max = 0;
            for(int[] d: dp){
                for(int c: d){
                    max = Math.max(max, c);
                }
            }
            System.out.println(max);
        }
    }
    public static void main(String[] args){
        new AOJ_2219().run();   
    }
}

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

#include<bits/stdc++.h>
using namespace std;
/* 変数名を被らせない
   デバッグコードを取り除く */
#define ANSWER(x) cout<<x<<endl
#define debug(x) cout<<#x<<": "<<x
const int MAX_INT = 1000000;
string name;
int C[301],V[301],D[301],L[3--];
int dp[301][301][3];
int N,M;
int solve(int a,int b,int s);
int main(){
  while(cin >> N >> M){
    memset(dp,-1,sizeof(dp));
    for(int i=0;i<N;i++){
      cin.ignore();
      getline(cin,name);
      cin >> C[i] >> V[i] >> D[i] >> L[i];
    }
    cout << max(solve(0,M,0),max(solve(0,M,1),solve(0,M,2))) << endl;
  }
}
int solve(int a,int b,int s){
  if(dp[a][b][s] != -1)return dp[a][b][s];
  else {if(a==N)return 0;
    else if(b < C[a])return dp[a][b][s] = solve(a+1,b,s);
    else {
      if(s == 0)return dp[a][b][s] = max(solve(a+1,b-C[a],s)+V[a],max(solve(a,b-C[a],s)+V[a],solve(a+1,b,s)));
      else if(s == 1)return dp[a][b][s] = max(solve(a+1,b-C[a],s)+D[a],max(solve(a,b-C[a],s)+D[a],solve(a+1,b,s)));
      else return dp[a][b][s] = max(solve(a+1,b-C[a],s)+L[a],max(solve(a,b-C[a],s)+L[a],solve(a+1,b,s)));
    }
  }
}

Compiler output:
a.cc:9:28: error: lvalue required as decrement operand
    9 | int C[301],V[301],D[301],L[3--];
      |                            ^
a.cc: In function 'int main()':
a.cc:19:38: error: 'L' was not declared in this scope
   19 |       cin >> C[i] >> V[i] >> D[i] >> L[i];
      |                                      ^
a.cc: In function 'int solve(int, int, int)':
a.cc:31:57: error: 'L' was not declared in this scope
   31 |       else return dp[a][b][s] = max(solve(a+1,b-C[a],s)+L[a],max(solve(a,b-C[a],s)+L[a],solve(a+1,b,s)));
      |                                                         ^
Language: C++

#include <bits/stdc++.h>
 
using namespace std;
 
#define MAX 350
 
int N, M;
int cost[MAX];
int rank[MAX][3];
 
void solve(){
    int dp[MAX][MAX][3];
    memset(dp, 0, sizeof(dp));
 
    int ans = 0;
    for(int k = 0 ; k < 3 ; k++){
	for(int i = 0 ; i < N ; i++){
	    for(int j = 0 ; j <= M ; j++){
		if(j-cost[i] < 0){
		    dp[i+1][j][k] = dp[i][j][k];
		}else{
		    dp[i+1][j][k] = max(dp[i][j][k],dp[i+1][j-cost[i]][k] + rank[i][k]);
		}
	    }
	}
	ans = max(ans, dp[N][M][k]);
    }
    cout << ans << endl;
}
 
int main(){
    string str;
    while(cin >> N >> M){
	for(int i = 0 ; i < N ; i++){
	    cin.ignore(); 
	    getline(cin,str);
	    cin >> cost[i] >> rank[i][0] >> rank[i][1] >> rank[i][2];
	}
	solve();
    }
    return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:22:77: error: reference to 'rank' is ambiguous
   22 |                     dp[i+1][j][k] = max(dp[i][j][k],dp[i+1][j-cost[i]][k] + rank[i][k]);
      |                                                                             ^~~~
In file included from /usr/include/c++/14/bits/stl_pair.h:60,
                 from /usr/include/c++/14/bits/stl_algobase.h:64,
                 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/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
 1437 |     struct rank
      |            ^~~~
a.cc:9:5: note:                 'int rank [350][3]'
    9 | int rank[MAX][3];
      |     ^~~~
a.cc: In function 'int main()':
a.cc:37:31: error: reference to 'rank' is ambiguous
   37 |             cin >> cost[i] >> rank[i][0] >> rank[i][1] >> rank[i][2];
      |                               ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
 1437 |     struct rank
      |            ^~~~
a.cc:9:5: note:                 'int rank [350][3]'
    9 | int rank[MAX][3];
      |     ^~~~
a.cc:37:45: error: reference to 'rank' is ambiguous
   37 |             cin >> cost[i] >> rank[i][0] >> rank[i][1] >> rank[i][2];
      |                                             ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
 1437 |     struct rank
      |            ^~~~
a.cc:9:5: note:                 'int rank [350][3]'
    9 | int rank[MAX][3];
      |     ^~~~
a.cc:37:59: error: reference to 'rank' is ambiguous
   37 |             cin >> cost[i] >> rank[i][0] >> rank[i][1] >> rank[i][2];
      |                                                           ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
 1437 |     struct rank
      |            ^~~~
a.cc:9:5: note:                 'int rank [350][3]'
    9 | int rank[MAX][3];
      |     ^~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#define FOR(i, a, n) for(int i = (int)a; i < (int)n; i++)
#define REP(i, n) FOR(i, 0, n)
using namespace	std;

int n, m;

int solve(vector<int>& c, vector<int>& a) {
  vector<int> dp(m + 1, 0);
  FOR(i, 1, m + 1) REP(j, n)
    if(c[j] <= i)
      dp[i] = max(dp[i], dp[i - c[j]] + a[j]);
  return dp.back();
}

int main() {
  string name;
  while(cin >> n >> m) {
    vector<int>	c(n), v(n), d(n), l(n);
    REP(i, n) {
      cin.ignore(), getline(cin, name);
      cin >> c[i] >> v[i] >> d[i] >> l[i];
    }
    cout << max({solve(c, v), solve(c, d), sol0ve(c, l)}) << endl;
  }
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:26:44: error: 'sol0ve' was not declared in this scope; did you mean 'solve'?
   26 |     cout << max({solve(c, v), solve(c, d), sol0ve(c, l)}) << endl;
      |                                            ^~~~~~
      |                                            solve
a.cc:26:16: error: no matching function for call to 'max(<brace-enclosed initializer list>)'
   26 |     cout << max({solve(c, v), solve(c, d), sol0ve(c, l)}) << endl;
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:3:
/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:
/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 <stdio.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <math.h>
#include <assert.h>
#include <vector>

using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
static const double EPS = 1e-9;
static const double PI = acos(-1.0);

#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, s, n) for (int i = (s); i < (int)(n); i++)
#define FOREQ(i, s, n) for (int i = (s); i <= (int)(n); i++)
#define FORIT(it, c) for (__typeof((c).begin())it = (c).begin(); it != (c).end(); it++)
#define MEMSET(v, h) memset((v), h, sizeof(v))

int n, m;
char str[1000];
int cost[1000];
int power[3][1000];
int dp[1000];

int main() {
  while (scanf("%d %d", &n, &m) != EOF) {
    assert(1 <= n && n <= 300);
    assert(1 <= m && m <= 300);
    gets(str);
    REP(i, n) {
      gets(str);
      scanf("%d %d %d %d", &cost[i], &power[0][i], &power[1][i], &power[2][i]);
      gets(str);
      assert(1 <= cost[i] && cost[i] <= 300);
      REP(j, 3) {
        assert(1 <= power[j][i] && power[j][i] <= 300);
      }
    }
    int ans = 0;
    REP(iter, 3) {
      MEMSET(dp, 0);
      REP(i, n) {
        FOREQ(j, 0, m) {
          dp[j] = max(dp[j], dp[j]);
          int ncost = j + cost[i];
          if (ncost <= m) {
            dp[ncost] = max(dp[ncost], dp[j] + power[iter][i]);
          }
          ans = max(ans, dp[j]);
        }
      }
    }
    printf("%d\n", ans);
  }
}

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

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstring>
#include <climits>
using namespace std;
static const double EPS = 1e-5;
typedef long long ll;

const int MAX_N=300;

int C[MAX_N];
int w[MAX_N][3];


int dp[MAX_N+1];
int n,m;


int solve(){
	int ret=0;
	for(int k=0;k<3;k++){
		memset(dp,0,sizeof(dp));
		for(int i=0;i<n;i++){
			for(int j=C[i];j<=m;j++){
				dp[j]=max(dp[j],dp[j-C[i]]+w[i][k]);
				//cout<<dp[j]<<" ";
			}
		}
		ret=max(ret,dp[m]);
	}
	return ret;
}

main(){
	while(~scanf(" %d %d ",&n,&m)){
		for(int i=0;i<n;i++){
			char name[1000];
			gets(name);
			scanf(" %d %d %d %d ",&C[i],&w[i][0],&w[i][1],&w[i][2]);
		}
		cout<<solve()<<endl;
	}
}

Compiler output:
a.cc:50:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   50 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:54:25: error: 'gets' was not declared in this scope; did you mean 'getw'?
   54 |                         gets(name);
      |                         ^~~~
      |                         getw
Language: C++

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<cassert>
#include<iostream>
#include<sstream>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<utility>
#include<numeric>
#include<algorithm>
#include<bitset>
#include<complex>

using namespace std;

typedef long long Int;
typedef vector<int> vint;
typedef pair<int,int> pint;
#define mp make_pair

template<class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cout << *i << " "; cout << endl; }
template<class T> void chmin(T &t, T f) { if (t > f) t = f; }
template<class T> void chmax(T &t, T f) { if (t < f) t = f; }
int in() { int x; scanf("%d", &x); return x; }

int dp[3][310][310];

int main() {
	int n,m;
	while(scanf("%d %d\n",&n,&m)!=EOF){
		int i,j;
		memset(dp,0,sizeof(dp));
		for(i=1;i<=n;i++){
			char buf[1000];
			gets(buf);
			int c,v,d,l;
			scanf("%d %d %d %d\n",&c,&v,&d,&l);
			for(j=0;j<=m;j++){
				if(j<c){
					dp[0][i][j]=dp[0][i-1][j];
					dp[1][i][j]=dp[1][i-1][j];
					dp[2][i][j]=dp[2][i-1][j];
				}else{
					dp[0][i][j]=max(dp[0][i-1][j],dp[0][i][j-c]+v);
					dp[1][i][j]=max(dp[1][i-1][j],dp[1][i][j-c]+d);
					dp[2][i][j]=max(dp[2][i-1][j],dp[2][i][j-c]+l);
				}
			}
		}
/*
for(int ii=0;ii<=n;ii++){
for(int jj=0;jj<=m;jj++){
cout<<ii<<" "<<jj<<" ";
cout<<dp[0][ii][jj]<<" ";
cout<<dp[1][ii][jj]<<" ";
cout<<dp[2][ii][jj]<<" ";
cout<<endl;
}
}
*/
		int res=0;
		chmax(res,dp[0][n][m]);
		chmax(res,dp[1][n][m]);
		chmax(res,dp[2][n][m]);
		cout<<res<<endl;
	}
	return 0;
}

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

#include<cstdio>
#include<algorithm>
using namespace std;
int dp[305][305];
char name[50];
int cost[305];
int v[305],b[305],f[305];
int n,m;
int solve(int s[],int i,int c){
  int res,sk,nc;
  if(i==n) return 0;
  if(dp[i][c]>=0) return dp[i][c];
  res= solve(s,i+1,c);

  for(nc=cost[i],sk=s[i];c>=nc;nc+=cost[i],sk+=s[i]){
    res=max(res,solve(s,i+1,c-nc)+sk);
  }

  return dp[i][c]=res;
}
int main(void){
  int ans;
  while(scanf("%d %d",&n,&m)!=EOF){
    getchar();
    for(int i=0;i<n;i++){
      fgets(name,sizeof(name),stdin);
      scanf("%d %d %d %d",&cost[i],&v[i],&b[i],&f[i]);
      getchar();
    }
    ans=0;
    memset(dp,-1,sizeof(dp));
    ans=max(ans,solve(v,0,m));
    memset(dp,-1,sizeof(dp));
    ans=max(ans,solve(b,0,m));
    memset(dp,-1,sizeof(dp));
    ans=max(ans,solve(f,0,m));
    printf("%d\n",ans);
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:5: error: 'memset' was not declared in this scope
   31 |     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 <iostream>
#include <string>
#include <cstdio>

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

using namespace std;

int n, m;
int c[310], v[310], d[310], l[310];
int dp[310][310];

int main(){
  while(scanf("%d %d", &n, &m)!= -1){
    //cout <<"AAA" <<n <<" " << m << endl;
    rep(i,0,n){
      char str[80];
      gets(str);
      //cin.getline(str,800);
      //cout << "akira"<<endl;
      //cout << c << endl;
      //cout << "bakatin"<<endl;
      cin >> c[i] >> v[i] >> d[i] >> l[i]; 
      //cout <<  c[i] << v[i]<< d[i]<<l[i]; 
    }
    rep(i, 0, n+1){
      rep(j, 0, m+1){
	dp[i][j] = 0;
      }
    }
    rep(i, 0, n){
      rep(j, 0, m+1){
	dp[i+1][j] = dp[i][j];
	for(int k = 0; j - k*c[i]>= 0; k++)
	  dp[i+1][j] = max(dp[i+1][j], dp[i][j-k*c[i]] + k*v[i]);
      }
    }
    int mv = dp[n][m];

    rep(i, 0, n+1){
      rep(j, 0, m){
	dp[i][j] = 0;
      }
    }
    rep(i, 0, n){

Compiler output:
a.cc: In function 'int main()':
a.cc:18:7: error: 'gets' was not declared in this scope; did you mean 'getw'?
   18 |       gets(str);
      |       ^~~~
      |       getw
a.cc:45:18: error: expected '}' at end of input
   45 |     rep(i, 0, n){
      |                 ~^
a.cc:45:18: error: expected '}' at end of input
a.cc:14:37: note: to match this '{'
   14 |   while(scanf("%d %d", &n, &m)!= -1){
      |                                     ^
a.cc:45:18: error: expected '}' at end of input
   45 |     rep(i, 0, n){
      |                  ^
a.cc:13:11: note: to match this '{'
   13 | int main(){
      |           ^
Language: C++

#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int dp[1000][100];
string name;
int c[500],v[500],d[500],l[500];
int para[500][3];
int n,m,ans = 0;
int solve(int i, int sum, int j);
int main(){
  while(cin >> n >> m){
    for(int i = 0; i < n; i++){
      getline(cin, name); getline(cin, name);
      cin >> c[i];
      for(int j = 0; j < 3; j++){
	cin >> para[i][j];
      }
    }
    for(int i = 0; i < 3; i++){
      memset(dp, 0, sizeof(dp));
      ans = max(solve(0, 0, i), ans);
    }
    cout << ans << endl;
  }
}
int solve(int i, int sum, int j){
  if(dp[i][sum] > 0) return dp[i][sum];
  if(i == n) return 0;
  else if(sum + c[i] > m) return solve(i + 1, sum, j);
  return dp[i][sum] = max(max(solve(i + 1, sum + c[i], j) + para[i][j], solve(i + 1, sum, j)),solve(i, sum + c[i], j) + para[i][j]);
}
  

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

3 10
Dobkeradops
7 5 23 10
PataPata
1 1 2 1
dop
5 3 11 14
2 300
Bydo System Alpha
7 11 4 7
Green Inferno
300 300 300 300

Compiler output:
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 3 10
      | ^
Language: C++

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

#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define rep(i, n) FOR(i, 0, n)
#define MP make_pair

using namespace std;

typedef pair<int, int> P;

int dp[500];
int main(){
	int n, m;
	while(cin >> n >> m){
		vector<int> c(n);
		vector<vector<int> > v(3, vector<int>(n));
		rep(i, n){
			cin.ignore();
			string s;
			getline(cin, s);
			cin >> c[i] >> v[0][i] >> v[1][i] >> v[2][i];
		}
		int ans = 0;
		rep(j, 3){
			memset(dp, -1, sizeof(dp));
			dp[0] = 0;
			for(int k = 0; k < n; k++){
				for(int i = c[k]; i <= m; i++){
					if(dp[i-c[k]] != -1) dp[i] = max(dp[i], dp[i-c[k]]+v[j][k]);
				}
			}
			ans = max(ans, *max_element(dp, dp+500));
		}
		cout << ans << endl;
	}

	return 0;
}

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

#include <iostream>
#include <cstring>
#include <string>
#include <algorithm>
#define INF (2 << 28)
using namespace std;

int main(){
  string s;
  int n,m,cost[301],d[3][301];
  int dp[301];
  
  while(cin >> n >> m){
    
    int maxi = 0;
    for(int i=0;i<n;i++){
      cin.ignore();
      getline(cin,s);
      cin >> cost[i] >> d[0][i] >> d[1][i] >> d[2][i];
    }
    
    /*for(int k = 0;k < 3;k++){
      memset(dp,0,sizeof(dp));
      for(int i = 0;i < n;i++){
	for(int j = m;j > 0;j--){
	  if(j - cost[i] >= 0) dp[j - cost[i]] = max(dp[j] + d[k][i],dp[j - cost[i]]);
	}
	}*/

      for(int k=0;k<3;k++){
	for(int i=0;i<n;i++){
	  for(int j=0;j<m;j++){
	    if(j+cost[i] <= m) dp[j+cost[i]] = max(dp[j+cost[i]], dp[j]+d[k][i]);
	  }
	}#include <iostream>
#include <cstring>
#include <string>
#include <algorithm>
#define INF (2 << 28)
using namespace std;

int main(){
  string s;
  int n,m,cost[301],d[3][301];
  int dp[301];
  
  while(cin >> n >> m){
    
    int maxi = 0;
    for(int i=0;i<n;i++){
      cin.ignore();
      getline(cin,s);
      cin >> cost[i] >> d[0][i] >> d[1][i] >> d[2][i];
    }
    
    /*for(int k = 0;k < 3;k++){
      memset(dp,0,sizeof(dp));
      for(int i = 0;i < n;i++){
	for(int j = m;j > 0;j--){
	  if(j - cost[i] >= 0) dp[j - cost[i]] = max(dp[j] + d[k][i],dp[j - cost[i]]);
	}
	}*/

      for(int k=0;k<3;k++){
	for(int i=0;i<n;i++){
	  for(int j=0;j<m;j++){
	    if(j+cost[i] <= m) dp[j+cost[i]] = max(dp[j+cost[i]], dp[j]+d[k][i]);
	  }
	}

      maxi = max(maxi,*max_element(dp,dp + m + 1));
    }

    cout << maxi << endl;
  }
}


      maxi = max(maxi,*max_element(dp,dp + m + 1));
    }

    cout << maxi << endl;
  }
}

Compiler output:
a.cc:35:10: error: stray '#' in program
   35 |         }#include <iostream>
      |          ^
a.cc: In function 'int main()':
a.cc:35:11: error: 'include' was not declared in this scope
   35 |         }#include <iostream>
      |           ^~~~~~~
a.cc:35:28: error: expected primary-expression before '>' token
   35 |         }#include <iostream>
      |                            ^
a.cc:40:1: error: expected primary-expression before 'using'
   40 | using namespace std;
      | ^~~~~
a.cc:42:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   42 | int main(){
      |         ^~
a.cc:42:9: note: remove parentheses to default-initialize a variable
   42 | int main(){
      |         ^~
      |         --
a.cc:42:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:42:11: error: a function-definition is not allowed here before '{' token
   42 | int main(){
      |           ^
Language: Java

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

//The Number of the Real Roots of a Cubic Equation
public class AOJ2220 {

	int a, b, c, d;
	double EPS = 1e-8;
	List<Double> ans;
	
	double f(double x){
		return a*x*x*x + b*x*x + c*x + d;
	}
	double df(double x){
		return 3*a*x*x + 2*b*x + c;
	}
	void bs(double L, double R, boolean up){
		if(f(L)==0){
			ans.add(L); return;
		}
		if(f(R)==0){
			ans.add(R); return;
		}
		if(L <= 0 && 0 <= R && f(0)==0)return;
		while(R-L > 1e-12){
			double M = (L+R)/2;
			if(0 < f(M)){
				if(up)R=M;
				else L=M;
			}
			else if(f(M) < 0){
				if(up)L=M;
				else R=M;
			}
			else{
				ans.add(M); return;
			}
		}
		if(Math.abs(f(L)) < EPS)ans.add(L);
	}

	void run(){
		Scanner sc = new Scanner(System.in);
		int T = sc.nextInt();
		int INF = 1000000;
		while(T--!=0){
			a = sc.nextInt(); b = sc.nextInt(); c = sc.nextInt(); d = sc.nextInt();
			int D = b*b-3*a*c, rm = 0, rp = 0;
			ans = new ArrayList<Double>();
			if(0 <= D){
				double x0 = (-b-Math.sqrt(D))/3/a, x1 = (-b+Math.sqrt(D))/3/a;
				if(x1 < x0){
					double tmp = x1;
					x1 = x0;
					x0 = tmp;
				}
				bs(-INF, x0, 0 < df((x0-INF)/2));
				bs(x0, x1, 0 < df((x0+x1)/2));
				bs(x1, INF, 0 < df((x1+INF)/2));
			}
			else{
				bs(-INF, INF, 0 < df(0));
			}
			for(double d:ans){
				if(d == 0)continue;
				if(0 < d)rp++;
				else rm++;
			}
			System.out.println(rp+" "+rm);
		}
	}

	public static void main(String[] args) {
		new AOJ2220().run();
	}
}


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

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

using namespace std;

#define FOR(i,k,n) for(int i=(k); i<(int)n; ++i)
#define REP(i,n) FOR(i,0,n)
#define FORIT(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

template<class T> void debug(T begin, T end){ for(T i = begin; i != end; ++i) cout<<*i<<" "; cout<<endl; }

typedef long long ll;
const int INF = 100000000;
const double EPS = 1e-8;
const int MOD = 1000000007;
double a, b, c, d;
double f(double x){
  return a*x*x*x + b*x*x + c*x + d;
}
double df(double x){
  return 3*a*x*x + 2*b*x + c;
}
int main(){
  int n;
  cin>>n;
  REP(time, n){
    cin>>a>>b>>c>>d;
    double ax[3] = {};
    REP(i, 1000){
      if(abs(df(ax[0])) < EPS) break;
      ax[0] = ax[0] - f(ax[0])/df(ax[0]);
    }
    double A = a;
    double B = b + A * ax[0];
    double C = c + B * ax[0];
    double D = B*B - 4*A*C;
    if(abs(D) < EPS) D = 0;
    //printf("%lf %lf %lf -> %lf\n",A,B,C,D);
    if(D >= 0){
      D = sqrt(D);
      ax[1] = (-B + D)/(2*A);
      ax[2] = (-B - D)/(2*A);
    }
    pair<int,int> ans;
    REP(i, 3){
      //cout<<ax[i]<<endl;
      if(ax[i] > EPS) ans.first += 1;
      if(ax[i] < -EPS) ans.second += 1;
    }
    printf("%d %d\n",ans.first, ans.second);
  }
  return 0;
}

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

#include <iostream>
using namespace std;
const long double eps = 1.0e-5L;
int Q; long double a, b, c, d;
int main() {
	cin >> Q;
	while (Q--) {
		cin >> a >> b >> c >> d;
		b *= 1 / a, c *= 1 / a, d *= 1 / a;
		long double l = -1.0e+6L, r = 1.0e+6L;
		for (int i = 0; i < 70; i++) {
			long double m = (l + r) / 2;
			if (m * m * m + b * m * m + c * m + d > 0) r = m;
			else l = m;
		}
		long double g1 = b + l, g0 = c + b * l + l * l;
		long double e = g1 * g1 - 4 * g0;
		int ret1 = 0, ret2 = 0;
		if (l > eps) ret1++;
		if (l < -eps) ret2++;
		if (e > -eps) {
			long double s = (e > eps ? sqrt(e) / 2 : 0);
			long double t1 = -b / 2 - s;
			long double t2 = -b / 2 + s;
			if (t1 > eps) ret1++;
			if (t1 < -eps) ret2++;
			if (t2 > eps) ret1++;
			if (t2 < -eps) ret2++;
		}
		cout << ret1 << ' ' << ret2 << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:52: error: 'sqrt' was not declared in this scope
   22 |                         long double s = (e > eps ? sqrt(e) / 2 : 0);
      |                                                    ^~~~
Language: C++

#error "tsurai"
#include <iostream>
#include <cmath>
#include <utility>
using namespace std;
const double EPS = 1e-7;

double f(double a, double b, double c, double d, double x){
  return a*x*x*x + b*x*x + c*x + d;
}

pair<int, int> solve(double a, double b, double c, double d){
  double s = (-b - sqrt(b*b - 3*a*c))/3/a, t = (-b + sqrt(b*b - 3*a*c))/3/a;
  cout << s << " " << t << endl;
  int p = 0, n = 0;
  if(t < 0){
    if(f(a,b,c,d,0)*a < 0) ++p;
    else ++n;
    if(f(a,b,c,d,s)*f(a,b,c,d,t) <= EPS) n += 2;
  }else if(s > 0){
    if(f(a,b,c,d,0)*a < 0) ++p;
    else ++n;
    if(f(a,b,c,d,s)*f(a,b,c,d,t) <= EPS) p += 2;
  }else{
    if(f(a,b,c,d,s)*a > 0) ++n;
    if(f(a,b,c,d,t)*a < 0) ++p;
    cout << f(a,b,c,d,s)*f(a,b,c,d,t) << endl;
    cout << f(a,b,c,d,t) << endl;
    if(f(a,b,c,d,s)*f(a,b,c,d,t) <= EPS){
      if(f(a,b,c,d,0) > 0) ++n;
      else ++p;
    }
  }
  return make_pair(p, n);
}

int main(){
  int n;
  cin >> n;
  for(int i = 0; i < n; ++i){
    double a, b, c, d;
    cin >> a >> b >> c >> d;
    pair<int,int> ans = solve(a,b,c,d);
    cout << ans.first << " " << ans.second << endl;
  }
  return 0;
}



Compiler output:
a.cc:1:2: error: #error "tsurai"
    1 | #error "tsurai"
      |  ^~~~~
Language: C++

#error "tsurai"
#include <iostream>
#include <cmath>
#include <utility>
using namespace std;
const double EPS = 1e-7;

double f(double a, double b, double c, double d, double x){
  return a*x*x*x + b*x*x + c*x + d;
}

pair<int, int> solve(double a, double b, double c, double d){
  double s = (-b - sqrt(b*b - 3*a*c))/3/a, t = (-b + sqrt(b*b - 3*a*c))/3/a;
  //cout << s << " " << t << endl;

  //if(abs(d) < EPS && abs(s) < EPS && abs(t) < EPS)
  //  return {0, 0};

  int p = 0, n = 0;
  cerr << f(a,b,c,d,s) << endl;
  if(t < 0){
    if(f(a,b,c,d,0) < 0) ++p;
    else ++n;
    if(f(a,b,c,d,s)*f(a,b,c,d,t) <= EPS) n += 2;
  }else if(s > 0){
    if(f(a,b,c,d,0) < 0) ++p;
    else ++n;
    if(f(a,b,c,d,s)*f(a,b,c,d,t) <= EPS) p += 2;
  }else{
    if(f(a,b,c,d,s) >= -EPS && abs(s) > EPS) ++n;
    if(f(a,b,c,d,t) <= EPS && abs(t) > EPS) ++p;
    //cout << f(a,b,c,d,s)*f(a,b,c,d,t) << endl;
    //cout << f(a,b,c,d,t) << endl;
    if(f(a,b,c,d,s)*f(a,b,c,d,t) <= EPS){
      if(f(a,b,c,d,0) > EPS) ++p;
      else if(d < -EPS) ++n;
    }
  }
  return make_pair(p, n);
}

int main(){
  int n;
  cin >> n;
  for(int i = 0; i < n; ++i){
    double a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a < 0) {
      a = -a;
      b = -b;
      c = -c;
      d = -d;
    }
    pair<int,int> ans = solve(a,b,c,d);
    cout << ans.first << " " << ans.second << endl;
  }
  return 0;
}



Compiler output:
a.cc:1:2: error: #error "tsurai"
    1 | #error "tsurai"
      |  ^~~~~
Language: C++

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

//ax + b = 0
pair<int,int> solve(int a, int b){
	if(b==0) return make_pair(0,0);
	if(b>0) return make_pair(0,1);
	return make_pair(1,0);
}

//ax^2+bx+c=0
pair<int,int> solve(int a, int b, int c){
	if(c==0) return solve(a,b);
	int y4a = -b*b + 4*a*c;
	if(y4a > 0){
		return make_pair(0,0);
	}
	if(c < 0){
		return make_pair(1,1);
	}
	if(b > 0){
		return make_pair(0, 2);
	}
	return make_pair(2, 0);
}

//ax^3+bx^2+cx+d=0
pair<int,int> solve(long long a, long long b, long long c, long  long d){
	if(a < 0){
		return solve(-a,-b,-c,-d);
	}
	if(d == 0){
		return solve(a,b,c);
	}

	long long D = b*b*c*c - 4*a*c*c*c - 4*b*b*b*d - 27*a*a*d*d + 18*a*b*c*d;
	int DD = b*b - 3*a*c;
	bool minimal_x_plus = (b<0 || DD > sq(b)),
			maximal_x_minus = (b>0 || sq(b) < DD);
	if(D >= 0){
		if(DD == 0){
			if(b > 0){
				return make_pair(0,3);
			}
			else{
				return make_pair(3,0);
			}
		}
		if(d > 0){
			if(!minimal_x_plus){
				return make_pair(0,3);
			}
			else{
				return make_pair(2,1);
			}
		}
		else{
			if(!maximal_x_minus){
				return  make_pair(3,0);
			}
			else{
				return make_pair(1,2);
			}
		}
	}
	else{
		if(d > 0){
			return make_pair(0,1);
		}
		return make_pair(1,0);
	}

	return make_pair(-1,-1);
}

int main(){
	int T;
	scanf("%d",&T);
	while(T--){
		int a, b, c, d;
		scanf("%d%d%d%d",&a,&b,&c,&d);
		pair<int,int> ans = solve(a,b,c,d);
		printf("%d %d\n", ans.first, ans.second);
	}
	return 0;
}

Compiler output:
a.cc: In function 'std::pair<int, int> solve(long long int, long long int, long long int, long long int)':
a.cc:39:44: error: 'sq' was not declared in this scope
   39 |         bool minimal_x_plus = (b<0 || DD > sq(b)),
      |                                            ^~
a.cc:59:29: error: 'maximal_x_minus' was not declared in this scope; did you mean 'minimal_x_plus'?
   59 |                         if(!maximal_x_minus){
      |                             ^~~~~~~~~~~~~~~
      |                             minimal_x_plus
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MAX 1005
ll mod=1e9+7;
int n,m,a,b;
vector<int> G[MAX],g[MAX];
int p[MAX];
bool flg[MAX];
 
int update(int x){
  flg[x]=true;
  if(p[x]==x)return x;
  return p[x]=update(p[x]);
}
 
int find(int x){
  if(p[x]==x)return x;
  return find(p[x]);
}
 
ll dfs(int pos){
  ll res=1;
  for(int i=0;i<(int)g[pos].size();i++)
    res=mul(res,dfs(g[pos][i]));  
  return (res+1LL)%mod;
}
 
int main(){
  cin>>n>>m;
    for(int i=1;i<=n;i++)p[i]=i;
    for(int i=0;i<m;i++){
      cin>>a>>b;
      G[b].push_back(a);
      if(find(b)==a)update(b);
      else p[a]=b;
    }
    for(int i=1;i<=n;i++){
      for(int j=0;j<(int)G[i].size();j++){
        int w=G[i][j];
        if(flg[w])continue;
        if(flg[i])g[p[i]].push_back(w);
        else g[i].push_back(w);
      }
    }
    ll ans=1;
    for(int i=1;i<=n;i++)if(p[i]==i)ans=ans*dfs(i)%mod;
    cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'll dfs(int)':
a.cc:25:9: error: 'mul' was not declared in this scope; did you mean 'fmul'?
   25 |     res=mul(res,dfs(g[pos][i]));
      |         ^~~
      |         fmul
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <complex>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <iomanip>
#include <assert.h>
#include <array>
#include <cstdio>
#include <cstring>
#include <random>
#include <functional>
#include <numeric>
#include <bitset>
#include <fstream>
 
using namespace std;
 
#define REP(i,a,b) for(int i=a;i<(int)b;i++)
#define rep(i,n) REP(i,0,n)
#define all(c) (c).begin(), (c).end()
#define zero(a) memset(a, 0, sizeof a)
#define minus(a) memset(a, -1, sizeof a)
#define watch(a) { cout << #a << " = " << a << endl; }
template<class T1, class T2> inline bool minimize(T1 &a, T2 b) { return b < a && (a = b, 1); }
template<class T1, class T2> inline bool maximize(T1 &a, T2 b) { return a < b && (a = b, 1); }
 
typedef long long ll;
int const inf = 1<<29;
 
constexpr int MOD = 1e9+7;
 
namespace graph { // not verified
 
constexpr int MaxV = 1010;
 
struct scc {
 
  int V = MaxV;
  vector<int> G[MaxV];
  vector<int> rG[MaxV];
  vector<int> vs;
  vector<bool> used;
  vector<int> comp;
  int SCCGraphSize;
 
  scc(): V(MaxV) { comp.resize(MaxV); }
  scc(int V_): V(V_) { comp.resize(MaxV); }
 
  void add_edge(int from, int to) {
    G[from].push_back(to);
    rG[to].push_back(from);
  }
 
  void dfs(int v) {
    used[v] = 1;
    for(auto e: G[v]) {
      if(!used[e]) dfs(e);
    }
    vs.push_back(v);
  }
 
  void rdfs(int v, int k) {
    used[v] = 1;
    comp[v] = k;
    for(auto e: rG[v]) {
      if(!used[e]) rdfs(e, k);
    }
  }
 
  void solve() {
    used.clear(); used.resize(MaxV);
    vs.clear();
    for(int i = 0; i < V; i++) {
      if(!used[i]) dfs(i);
    }
    used.clear(); used.resize(MaxV);
    int k = 0;
    for(int i = vs.size() - 1; i >= 0; i--) {
      if(!used[vs[i]]) rdfs(vs[i], k++);
    }
    SCCGraphSize = k;
  }
 
};
 
}
 
vector<vector<int>> tree;
 
ll solve(int curr, int par) {
  ll ret = 1;
  for(auto e: tree[curr]) {
    if(e == par) continue;
    ret *= solve(e, curr);
    ret %= MOD;
  }
  return ret;
}
 
int main() {
 
  int N, M; cin >> N >> M;
  graph::scc scc_graph(N);
  rep(i, M) {
    int S, D; cin >> S >> D; S --, D --;
    scc_graph.add_edge(S, D);
  }
 
  scc_graph.solve();
 
  auto& K = scc_graph.SCCGraphSize;
  auto& g = scc_graph.G;
  auto& comp = scc_graph.comp;
 
  tree.resize(K);
  int deg[1010] = {};
 
  rep(i, N) {
    for(auto e: g[i]) {
      if(comp[i] == comp[e]) continue;
      tree[comp[e]].push_back(comp[i]);
      deg[comp[i]] ++;
    }
  }
 
  rep(i, K) {
    sort(tree[i].begin(), tree[i].end());
    tree[i].erase(unique(tree[i].begin(), tree[i].end()), tree[i].end());
  }
 
  ll ans = 1;
 
  rep(i, K) if(deg[i] == 0 && dp[i] < 0) {
    ans *= solve(i, -1);
    ans %= MOD;
  }
 
  cout << ans << endl;
   
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:140:31: error: 'dp' was not declared in this scope
  140 |   rep(i, K) if(deg[i] == 0 && dp[i] < 0) {
      |                               ^~