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

#include<iostream>
using namespace std;
int main(){
	int n,a,b,c,d;
    cin >> n;

	int A[n];
	int B[n]; //n番目のチームの勝ち点


	for (int i=0; i<n; i++){
		A[i] = 0;
		B[i] = 0;
	}


	for(int i=0; i<n*(n-1)/2; i++){
		cin >> a >> b >> c >> d;
		if( c > d ){
			A[a] += 3;
			B[a] += 3;
		}
		if( c < d ){
			A[b] += 3;
			B[b] += 3;
		}
		if( c == d ){
			A[a] ++;
			A[b] ++;
			B[a] ++;
			B[b] ++;
		}
	}

	sort(A.begin(),A.end());
	reverse(A.begin(),A.end());

	int x = 0;

	for(int i=0; i<n; i++){
		for(int j=0; j<n; j++){
			x++;
			if(B[i] == A[j]){
				cout << x << endl;
				x = 0;
				break;
			}
			
		}
	}

	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:35:16: error: request for member 'begin' in 'A', which is of non-class type 'int [n]'
   35 |         sort(A.begin(),A.end());
      |                ^~~~~
a.cc:35:26: error: request for member 'end' in 'A', which is of non-class type 'int [n]'
   35 |         sort(A.begin(),A.end());
      |                          ^~~
a.cc:35:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   35 |         sort(A.begin(),A.end());
      |         ^~~~
      |         short
a.cc:36:19: error: request for member 'begin' in 'A', which is of non-class type 'int [n]'
   36 |         reverse(A.begin(),A.end());
      |                   ^~~~~
a.cc:36:29: error: request for member 'end' in 'A', which is of non-class type 'int [n]'
   36 |         reverse(A.begin(),A.end());
      |                             ^~~
a.cc:36:9: error: 'reverse' was not declared in this scope
   36 |         reverse(A.begin(),A.end());
      |         ^~~~~~~
Language: C++

#include <stdio.h>
#include <algorithm>
#include <utility>
using namespace std;
typedef pair<int,int> pi;
#define F first
#define S second
const int N=1e2+10;
int main(){
    int n,a,b,c,d,tot;
    pi val[N];
    scanf("%d",&n);
    for(int i=1;i<=n;i++)val[i]={0,i};
    tot=(n*(n-1))/2
    while(tot--){
        scanf("%d%d%d%d",&a,&b,&c,&d);
        if(c==d){
            val[a].F++;
            val[b].F++;
        }
        else if(c>d)val[a].F+=3;
        else val[b].F+=3;
    }
    
    sort(val+1,val+1+n);
    for(int i=1;i<=n;i++)printf("%d\n",val[i].S);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:20: error: expected ';' before 'while'
   14 |     tot=(n*(n-1))/2
      |                    ^
      |                    ;
   15 |     while(tot--){
      |     ~~~~~
Language: C++

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cassert>
#include <iostream>
#include <sstream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <numeric>
#include <algorithm>
#include <bitset>
#include <complex>
#include <fstream>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define TO_STRING(a) #a
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i, n) REP(i, 0, n)
template<class T, class C> void chmax(T& a, C b){ if(a < b) a = b; }
template<class T, class C> void chmin(T& a, C b){ if(b < a) a = b; }
template<class T, class C> pair<T, C> mp(T a, C b){ return make_pair(a, b); }
template<class T> void MSG(T a){ cout << TO_STRING(a) << " = " << a << endl; }
 
 
 
int main()
{
        int n;
        cin >> n;
 
        vint score(n);
        fill(score.begin(), score.end(), 0);
 
        rep(i, n*(n-1)/2)
        {
                int a, b, c, d;
                cin >> a >> b >> c >> d;
 
                score[a-1] += (c > d ? 3 :(c == d ? 1 : 0));
                score[b-1] += (c < d ? 3 :(c == d ? 1 : 0));
        }
 
        rep(print, n)
        {
                int rank = 1;
                rep(over, n)
                        if(score[print] < score[over])
                                rank++;
 
                cout << rank << endl;
        }
}

clone edit download c

Compiler output:
a.cc:63:1: error: 'clone' does not name a type
   63 | clone edit download c
      | ^~~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
bool flag[10000000];
int main(void) {
  int N;
  int T1, T2, P1, P2;
  int cnt[100]={0};
  int R = 0;
  int j = 0;
  while(cin >> N) {
    memset(cnt, 0, sizeof(cnt));
    for(int i = 0 ; i < N*(N-1)/2 ; i++) {
      cin >> T1 >> T2 >> P1 >> P2;
      if(P1 > P2) cnt[T1] += 3; 
      else if(P1 < P2) cnt[T2] += 3;
      else if(P1 == P2) { cnt[T1]++; cnt[T2]++; }	
    }
    /*for(int i = 1 ; i <= N ; i++) {
      cout << cnt[i] << ' ';
    }
    cout << endl;*/
    for(int i = 1 ; i <= N ; i++) {
      for(int j = 1 ; j <= N ; j++) {
	  if(cnt[i] < cnt[j]) R++;
      }
      cout << R+1 << endl;
      R = 0;
    }
    //cout << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 'memset' was not declared in this scope
   13 |     memset(cnt, 0, sizeof(cnt));
      |     ^~~~~~
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++

#include <stdio.h>
int main(){
  int n,i,j;
     scanf("%d",&n);
       j = n*(n-1);
      int team[100],score[100],a,b,c,d,e;
        for(i=0;i<j/2;i++){
          scanf("%d%d%d%d",&a,&b,&c,&d);
           if(c>d){
             team[a] += 3;
            }else if(c<d){
              team[b] += 3;
            }else{
              team[a] += 1;
              team[b] += 1;
            }
            }
            for(e=0;e<100;e++){
           score[e] = team[e]
}
            int x;
            for(i=1;i<n;i++){
              for(j=1;j<n;j++){
                if(team[j]<team[j+1]){
                  x = team[j+1];
                    team[j+1] =team[j];
                       team[j] = x;
                         }
                           }
                              }
            int k,l,up;
            for(k=0;k<n;k++){
              for(l=0;l<n;l++){
                if(team[k]<team[l]){
                up += 1;
                         }
                           }
              k = up+1;
                              }
             for(e=0;e<100;e++){
                for(f=0;f<100;f++){
           if(score[e] ==team[f]){
              printf("%d\n",f);
}
}
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:30: error: expected ';' before '}' token
   19 |            score[e] = team[e]
      |                              ^
      |                              ;
   20 | }
      | ~                             
a.cc:41:21: error: 'f' was not declared in this scope
   41 |                 for(f=0;f<100;f++){
      |                     ^
Language: C++

#include<iostream>
using namespace std;
int main(){
  int tmp,n,bell,t1,t2,po1,po2,team[110]={0};
  cin >> n;
  bell=n;
  bell*=n-1;
  bell/=2;
  for(int i=0;i<bell;i++){
    cin >> t1 >> t2 >> po1 >> po2;
    if(po1>po2){
      team[t1]+=3;
    }
    else if(po2>po1){
      team[t2]+=3;
    }
    else{
      team[t1]++;
      team[t2]++;
    }
  }

  //勝ち点計算終了。


  int lank[110][2]={0};
  for(int i=0;i<n;i++){
    lank[i][0]=team[i];
    lank[i][1]=i;
  }

  for(int i=0;i<n-1;i++){
    for(int j=n-1;j>i;j--){
      if(lank[j][0]>lank[j-1][0]){
	tmp=lank[j][0];
	lank[j][0]=lank[j-1][0];
	lank[j-1][0]=tmp;
	tmp=lank[j][1];
	lank[j][1]=lank[j-1][1];
	lank[j-1][1]=tmp;
      }
    }
  }

  //順位付け。
  //  int lank_ans[110];
  int LANK=1,tame=1;
  for(int i=0;i<n;i++){
    tame=1;

    while(1){
      if(lank[i][0]==lank[i+1][0]){
	lank[i][0]=LANK;
	//lank[i+1][0]=LANK;
	i++;
	tame++;
      }
    }
    lank[i][0]=LANK
    LANK+=tame;
  }

  //元の並びに戻す。
  for(int i=0;i<n-1;i++){
    for(int j=n-1;j>i;j--){
      if(lank[j][1]<lank[j-1][1]){
	/*	tmp=lank_ans[j];
	lank_ans[j]=lank_ans[j-1];
	lank_ans[j-1]=tmp;*/

	tmp=lank[j][0];
	lank[j][0]=lank[j-1][0];
	lank[j-1][0]=tmp;
	tmp=lank[j][1];
	lank[j][1]=lank[j-1][1];
	lank[j-1][1]=tmp;
      }
    }
  }

  for(int i=0;i<n;i++){
    cout << lank[i][0] << endl;
  }

  return (0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:59:20: error: expected ';' before 'LANK'
   59 |     lank[i][0]=LANK
      |                    ^
      |                    ;
   60 |     LANK+=tame;
      |     ~~~~
Language: C++

#include<cstdio>
#include <iostream>
#include <string>
#include<algorithm>
#include <map>
#pragma warning(disable:4786)  // VisualC++6.0の警告対策



using namespace std;

#define ll long long
#define SINT(n) scanf("%d",&n);
#define SINT2(n,m) scanf("%d %d",&n,&m);
#define SINT3(n,m,o) scanf("%d %d %d",&n,&m,&o);
#define SINT4(n,m,o,p) scanf("%d %d %d %d",&n,&m,&o,&p);
#define SLL(n) scanf("%lld",&n);
#define SST(s) scanf("%s",&s);

#define PINT(n) printf("%d",(int)(n));
#define PINT2(n,m) printf("%d %d",(int)(n),(int)(m));
#define PLL(n) printf("%lld",(long long)(n));
#define PST(s) printf("%s",(s));
#define PCH(s) printf("%c",(s));

#define PINTN(n) printf("%d\n",(int)(n));
#define PINT2N(n,m) printf("%d %d\n",(int)(n),(int)(m));
#define PLLN(n) printf("%lld\n",(long long)(n));
#define PSTN(s) printf("%s\n",(s));
#define PCHN(s) printf("%c\n",(s));

#define PSP() printf(" ");
#define PN() printf("\n");


#define dlp(i) while(i-->0)
#define ulp(i) for(ll _hoge_counter_hoge_=i,i=0;i<_hoge_counter_hoge_;i++)

#define lp(i) for(ll _hoge_counter_hoge_=i;_hoge_counter_hoge_--;)
#define lpp(i,to) for(i=0;i<to;i++)
#define lpft(i,from,to) for(i=from;i<to;i++)


map<ll, map<ll, short> > memo[50][50][4];

char Map[60][60];

int main(){

	int N;
	int i,j,k;
	int a,b,c,d;
	int t[100];

	//fill( t, t+sizeof(t), 0 );
	memset(t,sizeof(t),0);

	SINT(N);

	
	lpp(i,N*(N-1)/2){
		SINT4(a,b,c,d);
		if(c>d){
			t[a-1]+=3;
		}
		if(c<d){
			t[b-1]+=3;
		}
		if(c==d){
			t[a-1]++;
			t[b-1]++;
		}
	}

	lpp(i,N){
		a=1;
		lpp(j,N){
			if(t[j]>t[i]) a++;
		}
		PINTN(a);
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:56:9: error: 'memset' was not declared in this scope
   56 |         memset(t,sizeof(t),0);
      |         ^~~~~~
a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    5 | #include <map>
  +++ |+#include <cstring>
    6 | #pragma warning(disable:4786)  // VisualC++6.0の警告対策
Language: C++

#include<cstdio>
#include <iostream>
#include <string>
#include<algorithm>
#include <map>
#pragma warning(disable:4786)  // VisualC++6.0の警告対策



using namespace std;

#define ll long long
#define SINT(n) scanf("%d",&n);
#define SINT2(n,m) scanf("%d %d",&n,&m);
#define SINT3(n,m,o) scanf("%d %d %d",&n,&m,&o);
#define SINT4(n,m,o,p) scanf("%d %d %d %d",&n,&m,&o,&p);
#define SLL(n) scanf("%lld",&n);
#define SST(s) scanf("%s",&s);

#define PINT(n) printf("%d",(int)(n));
#define PINT2(n,m) printf("%d %d",(int)(n),(int)(m));
#define PLL(n) printf("%lld",(long long)(n));
#define PST(s) printf("%s",(s));
#define PCH(s) printf("%c",(s));

#define PINTN(n) printf("%d\n",(int)(n));
#define PINT2N(n,m) printf("%d %d\n",(int)(n),(int)(m));
#define PLLN(n) printf("%lld\n",(long long)(n));
#define PSTN(s) printf("%s\n",(s));
#define PCHN(s) printf("%c\n",(s));

#define PSP() printf(" ");
#define PN() printf("\n");


#define dlp(i) while(i-->0)
#define ulp(i) for(ll _hoge_counter_hoge_=i,i=0;i<_hoge_counter_hoge_;i++)

#define lp(i) for(ll _hoge_counter_hoge_=i;_hoge_counter_hoge_--;)
#define lpp(i,to) for(i=0;i<to;i++)
#define lpft(i,from,to) for(i=from;i<to;i++)


map<ll, map<ll, short> > memo[50][50][4];

char Map[60][60];

int main(){

	int N;
	int i,j,k;
	int a,b,c,d;
	int t[100];

	//fill( t, t+sizeof(t), 0 );
	std::memset(t,sizeof(t),0);

	SINT(N);

	
	lpp(i,N*(N-1)/2){
		SINT4(a,b,c,d);
		if(c>d){
			t[a-1]+=3;
		}
		if(c<d){
			t[b-1]+=3;
		}
		if(c==d){
			t[a-1]++;
			t[b-1]++;
		}
	}

	lpp(i,N){
		a=1;
		lpp(j,N){
			if(t[j]>t[i]) a++;
		}
		PINTN(a);
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:56:14: error: 'memset' is not a member of 'std'; did you mean 'wmemset'?
   56 |         std::memset(t,sizeof(t),0);
      |              ^~~~~~
      |              wmemset
Language: C++

#include<cstdio>
#include <iostream>
#include <string>
#include<algorithm>
#include <map>
#pragma warning(disable:4786)  // VisualC++6.0の警告対策



using namespace std;

#define ll long long
#define SINT(n) scanf("%d",&n);
#define SINT2(n,m) scanf("%d %d",&n,&m);
#define SINT3(n,m,o) scanf("%d %d %d",&n,&m,&o);
#define SINT4(n,m,o,p) scanf("%d %d %d %d",&n,&m,&o,&p);
#define SLL(n) scanf("%lld",&n);
#define SST(s) scanf("%s",&s);

#define PINT(n) printf("%d",(int)(n));
#define PINT2(n,m) printf("%d %d",(int)(n),(int)(m));
#define PLL(n) printf("%lld",(long long)(n));
#define PST(s) printf("%s",(s));
#define PCH(s) printf("%c",(s));

#define PINTN(n) printf("%d\n",(int)(n));
#define PINT2N(n,m) printf("%d %d\n",(int)(n),(int)(m));
#define PLLN(n) printf("%lld\n",(long long)(n));
#define PSTN(s) printf("%s\n",(s));
#define PCHN(s) printf("%c\n",(s));

#define PSP() printf(" ");
#define PN() printf("\n");


#define dlp(i) while(i-->0)
#define ulp(i) for(ll _hoge_counter_hoge_=i,i=0;i<_hoge_counter_hoge_;i++)

#define lp(i) for(ll _hoge_counter_hoge_=i;_hoge_counter_hoge_--;)
#define lpp(i,to) for(i=0;i<to;i++)
#define lpft(i,from,to) for(i=from;i<to;i++)

#define lengthof(x)

//#define FILL(a,v)(a, a + (sizeof (a) / sizeof *(a)), v);
#define FILL_ZERO(a) memset(a,0,sizeof(a));
#define FILL_ONE(a) memset(a,-1,sizeof(a));

map<ll, map<ll, short> > memo[50][50][4];

char Map[60][60];

int main(){

	int N;
	int i,j,k;
	int a,b,c,d;
	int t[100];

	FILL_ZERO(t);

	SINT(N);

	
	lpp(i,N*(N-1)/2){
		SINT4(a,b,c,d);
		if(c>d){
			t[a-1]+=3;
		}
		if(c<d){
			t[b-1]+=3;
		}
		if(c==d){
			t[a-1]++;
			t[b-1]++;
		}
	}

	lpp(i,N){
		a=1;
		lpp(j,N){
			if(t[j]>t[i]) a++;
		}
		PINTN(a);
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:22: error: 'memset' was not declared in this scope
   46 | #define FILL_ZERO(a) memset(a,0,sizeof(a));
      |                      ^~~~~~
a.cc:60:9: note: in expansion of macro 'FILL_ZERO'
   60 |         FILL_ZERO(t);
      |         ^~~~~~~~~
a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    5 | #include <map>
  +++ |+#include <cstring>
    6 | #pragma warning(disable:4786)  // VisualC++6.0の警告対策
Language: Java

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int a = in.nextInt();
		int b = in.nextInt();
		int c = in.nextInt();
		int d[] = new int[100];
		int e;
		for(int i = 0; i < n; i++){
			d[i] = in.nextInt();
		}
		for(int i = 0; i < n; i++){
			for(int j = i + 1; j < n; j++){
				if(d[i] < d[j]){
					e = d[i];
					d[i] = d[j];
					d[j] = e;
				}
			}
		}
		for(int i = 0; i < n; i++){
			if(d[i] / b > c / a){
				c += d[i];
				a += b;
			}
		}
		System.out.println(c / a);
	}
}}

Compiler output:
Main.java:33: error: class, interface, enum, or record expected
}}
 ^
1 error
Language: Java

package kadai_2;

import java.util.*;

public class BestPizza {
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int k = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		int[] D = new int[k];
		int x = 0;
		int y = 0;
		
		for(int i = 0; i < k; i++){
			D[i] = sc.nextInt();
		    int kc = C/A;
		    int tc = D[i]/B;
		    
		    if(tc > kc){
		    	x = x+D[i];
		    	y = y+1;
		    }
		}
		System.out.println((C+x)/(A+B*y));

	}

}

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

import java.util.*;

public class Main2{
    public static void main(String[] args){
	Scanner sc = new Scanner(System.in);

	int[] aa = new int[10000];

	int res = 0,sum = 0;
	int n,a,b,c;
	n = sc.nextInt();
	a = sc.nextInt();
	b = sc.nextInt();
	c = sc.nextInt();

	for(int i=0; i<n; i++){
	    aa[i] = sc.nextInt();
	}

	Arrays.sort(aa);
	//Arrays.reverse(aa);
	for(int i=0; i<=n/2; i++){
	    int tmp = aa[i];
	    aa[i] = aa[aa.length-1-i];
	    aa[aa.length-1-i] = tmp;
	}

	for(int i=0; i<n+1; i++){
	    res = Math.max(res,(c+sum)/(a+b*i));
	    if(i==n)break;
	    sum += aa[i];
	}
	System.out.println(res);
    }
}

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

package SD;
import java.util.Scanner;
public class aoj0567 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc=new Scanner(System.in);
		int toppingtype= sc.nextInt();
		int doughprice= sc.nextInt();
		int toppingprice= sc.nextInt();
		int doughcaroly= sc.nextInt();
		int toppingcaroly[] =new int[toppingtype];
		for(int i=0;i<toppingtype;i++){
			toppingcaroly[i]= sc.nextInt();
		}
		for(int i=0;i<toppingtype-1;i++){
			if(toppingcaroly[i]<toppingcaroly[i+1]){
				int s=toppingcaroly[i];
				toppingcaroly[i]=toppingcaroly[i+1];
				toppingcaroly[i+1]=s;
			}
		}
		int normalpizza=doughcaroly/doughprice;
		int sum=0;
		for(int i=0;i<toppingtype;i++){
			sum=sum+toppingcaroly[i];
			int bestpizza=(sum+doughcaroly)/(toppingprice*(i+1)+doughprice);
			if(normalpizza<bestpizza){
				normalpizza=bestpizza;
			}else if(normalpizza>=bestpizza){
				System.out.println(normalpizza);
			}		
		}
	}
}

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

import java.util.*;
public class Mian {

	public static void main(String[] args) {
		Scanner sc = new Scanner (System.in);
		int n = sc.nextInt();
		int [] array = new int[n];
		int max = 0, soeji = 0, j, kijyun,hikaku = 0, x = 0;
		int daikin = 0;
		int kijikakaku = sc.nextInt();
		int sabukakaku = sc.nextInt();
		int kiji = sc.nextInt();
		for(int i = 0; i < n; i++){
			array[i] = sc.nextInt();
		}
		for(int i = 0; i < n; i++){
			for(j = i; j < n; j++){
				if(j == i){
					max = array[j];
					 
				}
				else if (max < array[j]){
					max = array[j];
					soeji = j;
				}
			}
			array[soeji] = array[i];
			array[i] = max;
		}
		kijyun = kiji / kijikakaku;
		for(int i = 0; i < n; i++){
			hikaku = array[i] / sabukakaku;
			if(kijyun >= hikaku){
				break;
			}
			else {
				x += array[i];
				daikin =kijikakaku+(sabukakaku*(i+1));
				kijyun = (kiji + x)/daikin;
			}
		}
		System.out.println(kijyun);	
	}

}

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

import java.util.Scanner;

public class aoj0567 {
	public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		int N = in.nextInt();
		int D = in.nextInt();
		int D2 = in.nextInt();
		int A = in.nextInt();
		int[]B = new int [N+1];
		for(int i = 0;i < N;i++){
			B[i] = in.nextInt();
		}
		int max = A / D;
		int cng;
		for(int i = 0;i < N;i++){
			D += D2;
			B[N] = 0;
			for(int j = 0;j < N;j++){
				if(B[N] < B[j]){
					if(B[N] == B[j]){
						B[j] = 0;
					}
					cng = B[j];
					B[j] = B[N];
					B[N] = cng;
				}
			}
			A += B[N];
			if(max < A / D){
				max = A / D;
			}
		}
		System.out.println(max);
	}
}

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

#include<stdio.h>

int main(){
    int n,a,b,c,d[100];
    int i,maxi;
    double max,cal[100],tmp;

    scanf("%d%d%d%d",&n,&a,&b,&c);
    for(i=0;i<n;i++){
        scanf("%d",&d[i]);
        cal[i]=(double)d[i]/(double)b;
    }

    for(i=0;i<n;i++)printf("%f\n",cal[i]);

    tmp=(double)c/(double)a;
    printf("%0.0f\n",tmp);
    int j=1;
    while(++j){
        for(maxi=-1,max=tmp,i=0;i<n;i++){
            if(max<cal[i]){
                max=cal[i];
                maxi=i;
            }
        }
        if(maxi==-1)break;
        tmp=(tmp*(a+(j-2)*b)+cal[maxi]*b)/(a+(j-1)*b);
    printf("%f\n",tmp);
        cal[maxi]=0;
    }
int d=tmp;
    printf("%d\n",tmp);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:31:5: error: conflicting types for 'd'; have 'int'
   31 | int d=tmp;
      |     ^
main.c:4:17: note: previous declaration of 'd' with type 'int[100]'
    4 |     int n,a,b,c,d[100];
      |                 ^
Language: C

#include<stdio.h>

int main(){
    int n,a,b,c,d[100];
    int i,maxi;
    double max,cal[100],tmp;

    scanf("%d%d%d%d",&n,&a,&b,&c);
    for(i=0;i<n;i++){
        scanf("%d",&d[i]);
        cal[i]=(double)d[i]/(double)b;
    }


    tmp=(double)c/(double)a;
    int j=1;
    while(++j){
        for(maxi=-1,max=tmp,i=0;i<n;i++){
            if(max<cal[i]){
                max=cal[i];
                maxi=i;
            }
        }
        if(maxi==-1)break;
        tmp=(tmp*(a+(j-2)*b)+cal[maxi]*b)/(a+(j-1)*b);
        cal[maxi]=0;
    }
    printf("%.0f\n",tmp-0.5;
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:28:28: error: expected ')' before ';' token
   28 |     printf("%.0f\n",tmp-0.5;
      |           ~                ^
      |                            )
main.c:29:14: error: expected ';' before '}' token
   29 |     return 0;
      |              ^
      |              ;
   30 | }
      | ~
Language: C

#include<stdio.h>
int main(void) 
{
int box,n,t[101]={0},y=0,a,b,cnt2,cnt;
	scanf("%d %d %d %d",&n,&a,&b,&t[0]);
	for(cnt=1;cnt<=n;cnt++){
		scanf("%d",&t[cnt]);
	}
	for(cnt=1;cnt<=n;cnt++){
		for(cnt2=1;cnt2<=n;cnt2++){
			if(t[cnt2]<t[cnt+1]){
				box=t[cnt2];
				t[cnt2]=t[cnt2+1];
				t[cnt2+1]=box;
			}
		}
	}
	cnt2=0;
	for(cnt=1;cnt<n;cnt++){
		y+=t[cnt];
		cnt2++;
		if(max<(y+t[0])/(a+cnt2*b)){
			max=(y+t[0])/(a+cnt2*b);
		}
	}
	printf("%d\n",max);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:22:20: error: 'max' undeclared (first use in this function)
   22 |                 if(max<(y+t[0])/(a+cnt2*b)){
      |                    ^~~
main.c:22:20: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
int main(void) 
{
int box,n,t[101]={0},y=0,a,b,cnt2,cnt;
	scanf("%d %d %d %d",&n,&a,&b,&t[0]);
	for(cnt=1;cnt<=n;cnt++){
		scanf("%d",&t[cnt]);
	}
	for(cnt=1;cnt<=n;cnt++){
		for(cnt2=1;cnt2<=n;cnt2++){
			if(t[cnt2]<t[cnt+1]){
				box=t[cnt2];
				t[cnt2]=t[cnt2+1];
				t[cnt2+1]=box;
			}
		}
	}
	cnt2=0;
	y=t[0];
	for(cnt=1;cnt<n;cnt++){
		y+=t[cnt];
		cnt2++;
		if(max<y/(a+cnt2*b)){
			max=y/(a+cnt2*b);
		}
	}
	printf("%d\n",max);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:23:20: error: 'max' undeclared (first use in this function)
   23 |                 if(max<y/(a+cnt2*b)){
      |                    ^~~
main.c:23:20: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int main()
{
	int n, kp, tp, kc, tc[101];
	int dc[101];
	scanf("%d%d%d%d", &n,&kp,&tp,&kc);
	int ,sumc=kc,sump=kp,i,j,temp;
	for (i = 0;i < n;i++) {
		scanf("%d", &tc[i]);
	}
	for (i = 0;i < n;i++) {
		for (j = n - 1;j > i;j--) {
			if (tc[j - i] < tc[j])
				tmp = tc[j];
			tc[j] = tc[j - 1];
			tc[j - 1] = tmp;
		}
	}
	for (i = 0;i < n;i++) {
		if (tc[i] / tp > kc / kp) {
			sump += 2;sumc += tc[i];
			dc[i] = sumc / sump;
			if (dc[i] < dc[i - 1])printf("%d\n", dc[i]);break;
		}
		else  printf("%d\n", kc / kp);break;
	}
	return 0;

}

Compiler output:
main.c: In function 'main':
main.c:8:13: error: expected identifier or '(' before ',' token
    8 |         int ,sumc=kc,sump=kp,i,j,temp;
      |             ^
main.c:9:14: error: 'i' undeclared (first use in this function)
    9 |         for (i = 0;i < n;i++) {
      |              ^
main.c:9:14: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:22: error: 'j' undeclared (first use in this function)
   13 |                 for (j = n - 1;j > i;j--) {
      |                      ^
main.c:15:33: error: 'tmp' undeclared (first use in this function); did you mean 'tp'?
   15 |                                 tmp = tc[j];
      |                                 ^~~
      |                                 tp
main.c:22:25: error: 'sump' undeclared (first use in this function)
   22 |                         sump += 2;sumc += tc[i];
      |                         ^~~~
main.c:22:35: error: 'sumc' undeclared (first use in this function)
   22 |                         sump += 2;sumc += tc[i];
      |                                   ^~~~
Language: C

#include <stdio.h>

int main()
{
	int n, kp, tp, kc, tc[101];
	int dc[101];
	scanf("%d%d%d%d", &n,&kp,&tp,&kc);
	int sumc=kc,sump=kp,i,j,temp;
	for (i = 0;i < n;i++) {
		scanf("%d", &tc[i]);
	}
	for (i = 0;i < n;i++) {
		for (j = n - 1;j > i;j--) {
			if (tc[j - i] < tc[j])
				tmp = tc[j];
			tc[j] = tc[j - 1];
			tc[j - 1] = tmp;
		}
	}
	for (i = 0;i < n;i++) {
		if (tc[i] / tp > kc / kp) {
			sump += 2;sumc += tc[i];
			dc[i] = sumc / sump;
			if (dc[i] < dc[i - 1])printf("%d\n", dc[i]);break;
		}
		else  printf("%d\n", kc / kp);break;
	}
	return 0;

}

Compiler output:
main.c: In function 'main':
main.c:15:33: error: 'tmp' undeclared (first use in this function); did you mean 'temp'?
   15 |                                 tmp = tc[j];
      |                                 ^~~
      |                                 temp
main.c:15:33: note: each undeclared identifier is reported only once for each function it appears in
Language: C

include <stdio.h>

int main()
{
	int n, kp, tp, kc, tc[101];
	int dc[101];
	scanf("%d%d%d%d", &n,&kp,&tp,&kc);
	int sumc=kc,sump=kp,i,j,tmp;
	for (i = 0;i < n;i++) {
		scanf("%d", &tc[i]);
	}
	for (i = 0;i < n;i++) {
		for (j = n - 1;j > i;j--) {
			if (tc[j - i] < tc[j])
				tmp = tc[j];
			tc[j] = tc[j - 1];
			tc[j - 1] = tmp;
		}
	}
	for (i = 0;i < n;i++) {
		if (tc[i] / tp > kc / kp) {
			sump += 2;sumc += tc[i];
			dc[i] = sumc / sump;
			if (dc[i] < dc[i - 1])printf("%d\n", dc[i]);break;
		}
		else  printf("%d\n", kc / kp);break;
	}
	return 0;

}

Compiler output:
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
Language: C

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

void bubble_sort(int *x, int n)
{
    int i, j, temp;

    for (i = 0; i < n - 1; i++) {
        for (j = n - 1; j > i; j--) {
            if (x[j - 1] < x[j]) {
                temp = x[j];
                x[j] = x[j - 1];
                x[j - 1]= temp;
            }
        }
    }
}


int main(void)
{
	int n;
	int a, b;
	int kcal, tcal[100];
	int sum;
	int ans;
	int i, j;
	
	scanf("%d", &n);
	scanf("%d%d", &a, &b);
	scanf("%d", &kcal);
	
	for (i = 0; i < n; i++){
		scanf("%d", &tcal[i]);
	}
	
	bubble_sort(tcal, n);
	
	ans = 0;
	for (i = 0; i < n; i++){
		sum = kcal;
		for (j = 0; j < i; j++){
			sum += tcal[j];
		}
		ans = max(ans, sum / (a + b * i));
	}
	
	printf("%d\n", ans);
	
	return (0);
}

Compiler output:
main.c: In function 'main':
main.c:45:23: error: implicit declaration of function 'max' [-Wimplicit-function-declaration]
   45 |                 ans = max(ans, sum / (a + b * i));
      |                       ^~~
Language: C

//情報オリンピック2011予選3「最高のピザ」
#include<stdio.h>

int main(void)
{
	int n, a, b, c, *ml, f1, f2, goukei, temp, max;
	
	scanf("%d",&n);
	
	scanf("%d %d",&a, &b);

	ml = new int [n];
		
	scanf("%d",&c);
	
	for(f1 = 0; f1 < n; f1++)
		scanf("%d",&ml[f1]);
	//トッピング降順に並べ替え	
	for(f1 = 0; f1 < n-1; f1++){
		for(f2 = f1+1; f2 < n; f2++){
			if(ml[f1] < ml[f2]){
				temp = ml[f1];
				ml[f1] = ml[f2];
				ml[f2] = temp;
			}
		}
	}
	//トッピングを何も載せない時の1ドル当たりのカロリー数
	max = c / a;

	for(f1 = 1; f1 <= n; f1++){
		goukei = 0;
		//上からf1までのトッピングを抜き出す
		for(f2 = 0; f2 < f1; f2++)
			goukei += ml[f2];
		//1ドル当たりのカロリー数を計算	
		goukei = (goukei + c) / (a + f1 * b);
		
		if(max < goukei)
			max = goukei;
			
	}
	
	printf("%d\n",max);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:14: error: 'new' undeclared (first use in this function)
   12 |         ml = new int [n];
      |              ^~~
main.c:12:14: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:17: error: expected ';' before 'int'
   12 |         ml = new int [n];
      |                 ^~~~
      |                 ;
Language: C

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


int main(){
	int N,A,B,C,array[100],i,result = 0,kari;
	scanf("%d",&N);
	scanf("%d %d",&A,&B);
	scanf("%d",&C);
	for(i = 0;i < N;i++) scanf("%d",&array[i]);
	sort(array,array + N);
	reverse(array,array + N);
	for(i = 0;i < N;i++){
		kari = C / (A + B * i);
		if(kari > result) result = kari;
		C+=array[i];
	}
	printf("%d\n",result);
	return 0;
}

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

#include<iostream>
using namespace std;
int main(){
	int k,n,m,p,dat[15000],cnt;
	double ans=0;
	cin>>k>>n>>m>>p;
	for(int i=0;i<k;i++){
		cin>>dat[i];
	}
	sort(dat,dat+n,greater<int>());
	ans=p/n;
	for(int i=0;i<k;i++){
		cnt+=dat[i];
		if((cnt+p)/(n+(i+1)*m)>ans){
			ans=(cnt+p)/(n+(i+1)*m);
		}
		else{
			break;
		}
		}
		cnt=ans;
		cout<<cnt<<endl;
		return 0;
	}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   10 |         sort(dat,dat+n,greater<int>());
      |         ^~~~
      |         short
Language: C++

#include<bits/stdc++.h>
using namespace std;
int n,a,b,c,x[100],d,p;
main(){
    p=0;
    cin>>n;
    cin>>a>>b;
    cin>>c;
    for(int i=0;i<n;i++){
        cin>>x[i];
    }
    d=0;
    sort(x,x+n); 
    p=c/a;
    for(int i=0;i<n;i++){
        c += b;
        a += x[i];
        p=max(p,k/m);
    }
    cout<<p<<endl;
    return 0;
}

Compiler output:
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:18:17: error: 'k' was not declared in this scope
   18 |         p=max(p,k/m);
      |                 ^
a.cc:18:19: error: 'm' was not declared in this scope
   18 |         p=max(p,k/m);
      |                   ^
Language: C++

#include<stdio.h>
int main(void)
{
    int n,a,b,c;
    int cal[10000]={0};
    int i,j;
    int x,z;
    int rui=0,masa = 0;
 
    scanf("%d%d%d%d",&n,&a,&b,&c);
    for(i = 0;i < n; i++) scanf("%d",&cal[i]);
 
    for(i = 0;i < n; i++){
        for(j = 0;j < n; j++){
            if(cal[i] > cal[j]){
                x = cal[i];
                cal[i] = cal[j];
                cal[j] = x;
            }
        }
    }
    z = c;
    rui = c/a;
    for(i = 1;i <= n; i++){
        z += cal[i-1];
        amsa = z / ((b*i)+a);
        if(rui <=masa){
        rui = masa;
        }
        else{
        break;
        }
    }
    printf("%d\n",rui);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:9: error: 'amsa' was not declared in this scope; did you mean 'masa'?
   26 |         amsa = z / ((b*i)+a);
      |         ^~~~
      |         masa
Language: C++

/**
 * pizza.cpp
 * Authorl: Tatsuro Ide
 * Date: 2/7/2017
 * Desc: Competitive Programming AOJ0567
 */

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

using namespace std;

int main()
{
	int number_of_toppings, crust_price, topping_price, crust_calories;
	vector<int> topping_calories;

	// get inputs.
	cin >> number_of_toppings;
	cin >> crust_price;
	cin >> topping_price;
	cin >> crust_calories;

	// allocate memory.
	topping_calories.resize(number_of_toppings);

	// store the toppings' calories.
	for(int i = 0; i < number_of_toppings; ++i)
	{
		cin >> topping_calories[i];
	}

	// sort the calories (descending order).
	sort(topping_calories.begin(), topping_calories.end(), greater<int>());

	int total_calories = crust_calories;
	int total_price = crust_price;
	int calories_per_dollar;

	for(int i = 0; i < number_of_toppings; ++i)
	{
		total_calories += topping_calories;
		total_price += topping_price;
		
		if( calories_per_dollar > (total_calories / total_price) )
		{
			break;
		}
		else
		{
			calories_per_dollar = total_calories / total_price;
		}
	}

	cout << calories_per_dollar;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:32: error: no match for 'operator+=' (operand types are 'int' and 'std::vector<int>')
   44 |                 total_calories += topping_calories;
      |                 ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <stack>

using namespace std;

struct Node {
    int no_;
    int calorie_;
    int price_;

    Node(int n, int c, int p) 
        : no_(n), calorie_(c), price_(p) {}
};

int N, A, B, C;
vector<int> calorie;

int calcBestPizza() {
    int ans = 0;

    stack<Node> st;
    st.push(Node(0, C, A));
    st.push(Node(0, calorie[0]+C, A+B));

    while(!st.empty()) {
        auto node = st.top();
        st.pop();

        int n = node.no_;
        int total_calorie = node.calorie_;
        int total_price = node.price_;
        int tmp = total_calorie / total_price;

        if ( tmp > ans ) {
            ans = tmp;
        }

        if (n < N - 1) {
            st.push(Node(n+1, total_calorie, total_price));
            st.push(Node(n+1, total_calorie + calorie[n+1], total_price+B));
        }
    }

    return ans;
}

int main(int argc, char const *argv[]) {
    cin>>N;
    cin>>A>>B;
    cin>>C;

    for (int i = 0; i < N; ++i) {
        int c;
        cin>>c;
        calorie.push_back(c);
    }

    sort(calorie.begin(), calorie.end(), greater<int>());
    int total_calorie = C;
    int total_price = A;
    int ans = C / A;
    for (int i = 0; i < N; ++i) {
        total_calorie += calorie[i];
        total_price += B;
        ans = max(ans, total_calorie/total_price);
    }

    cout<<ans<<endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:59:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   59 |     sort(calorie.begin(), calorie.end(), greater<int>());
      |     ^~~~
      |     short
Language: C++

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

int main(){
  int n;
  while(cin >> n){
    int a,b, k_a;
    vector<int> v(n);
    cin >> a >> b;
    cin >> k_a;
    for(int i=0;i<n;i++) cin >> v[i];

    sort(v.begin(),v.end());

    int ans = k_a / a, sum = 0;
    for(int i=1;i<=n;i++){
      sum += v[n-i];
      ans = max(ans,(k_a+sum)/(a+i*b));
    }
    cout << ans << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   15 |     sort(v.begin(),v.end());
      |     ^~~~
      |     short
Language: C++

#include<iostream>
#include<algorithm>

using namespace std;

const int MAX_B = 1001;

typedef struct{
  int price;
  int cal;
}Top;

int numtop,price;
int maxave = 0;
Top base;
int item[MAX_B];

void solve(int num,Top T){
  if(T.cal/T.price > maxave) maxave = T.cal/T.price;
  for(int i = num+1; i <= numtop; i++){
    Top next = T;
    next.price += price;
    next.price += item[i];
    solve(i,next);
    solve(i,T);
  }
  cout << now.cal << " " << now.price << endl;
  return (int)(now.cal/now.price);
}

int main(){
  cin >> numtop;
  cin >> base.price >> price;
  cin >> base.cal;
  for(int i = 1; i <= numtop; i++){
    cin >> item[i];
  }
  solve(0,base);
  cout << maxave << endl;
  return 0;
}

Compiler output:
a.cc: In function 'void solve(int, Top)':
a.cc:27:11: error: 'now' was not declared in this scope
   27 |   cout << now.cal << " " << now.price << endl;
      |           ^~~
Language: C++

#include <iostream>
#include <fstream>
using namespace std;
int a, b, c, d[100], n;
//iツ氾板姪堋づ個トツッツピツδ督グツづーツ使ツつ、(f=true)/ツ使ツづュツづ按つ「(f=false)ツづつォ1ツドツδ仰督鳴つスツづィツづ個カツδ債δ環ーツ青板づーツ陛板つキ(kツづ債つサツづェツづ慊づづ個カツδ債δ環ーツづ個和,mツづ債つサツづェツづ慊づづ個値ツ段ツづ個和)
double dfs(int i, int m, int k, bool f)
{
	if (i == n-1)
	{
		if (f)
			return ((double)k+(double)d[i])/((double)m+(double)b);
		else
			return (double)k/(double)m;
	}
	if (f)
		return (double)max(dfs(i+1, m+b, k+d[i], true), dfs(i+1, m+b, k+d[i], false));
	else
		return (double)max(dfs(i+1, m, k, true), dfs(i+1, m, k, false));
}
int main()
{
	int i;
	ifstream cin(argv[1]);

	cin >> n >> a >> b >> c;
	for (i = 0; i < n; i++)
		cin >> d[i];

	cout << (int)max(dfs(0, a, c, true), dfs(0, a, c, false)) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:22: error: 'argv' was not declared in this scope
   23 |         ifstream cin(argv[1]);
      |                      ^~~~
Language: C++

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

int maxn;
int kv,tv;
int kc;
vector<int> tc;

int dp[101][101];

int main(void)
{
	cin >> maxn;
	cin >> kv >> tv;
	cin >> kc;
	for(int i=0;i<maxn;++i){
		int a; cin >> a;
		tc.push_back(a);
	}
	memset(dp,-1,sizeof(dp));
	dp[0][0] = 0;
	for(int t=0;t<tc.size();++t)//なにをトッピングする?
	{
		for(int i=0;i<101;++i){
			int now = t;
			if(dp[now][i] == -1) continue;
			if(dp[now+1][i] < dp[now][i])
				dp[now+1][i] = dp[now][i];
			if(dp[now+1][i+1] < dp[now][i]+tc[t])
				dp[now+1][i+1] = dp[now][i]+tc[t];
		}
	}
	double max=-1;
	int d = tc.size();
	for(int i=0;i<101;++i){
		if(max < (double)(kc+dp[d][i])/(double)(i*tv+kv))
			max = (double)(kc+dp[d][i])/(double)(i*tv+kv);
	}
	cout << (int)max << endl;
	return 0;
}

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

#include <cstdio>
#include <algorithm>
#include <vector>

using namespace std;

int n,a,b,c,p;//pはピザの値段/カロリー
vector<int> cal;

int main(){
	
	scanf("%d",&n);
	scanf("%d %d",&a,&b);
	scanf("%d",&c);
	for(int j=0;j<n;j++) scanf("%d",&cal[j]);
	sort( cal.begin(), cal.end() );
	float max=c/a; //値段当たりのカロリー
	for(int k=0;k<n;k++){
		int t=0;
		for(int l=0;l<k;l++) t=+cal[l];
		p=(c+t)/(a+k*b);
		if(p>max) max=p;
	}
	double bp = floor(max);
	printf("%f",bp);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:21: error: 'floor' was not declared in this scope
   24 |         double bp = floor(max);
      |                     ^~~~~
Language: C++

#include "iostream"

int main(){
  int n;
  int primes[2];
  int pizaKarori;
  int toppings[100];
  int masterK;
  int masterP;
  cin >> n;
  cin >> primes[0] ;
  cin >> primes[1] ;
  cin >> pizaKarori;
  masterK=pizaKarori;
  masterP=primes[0];
  for(int i=0;i<n;i++){
    cin >> toppings[i];
  }
  for(int j=0;j<n;j++){
 for(int i=0;i<=n;i++){
      if(toppings[i]<toppings[i+1]){
	int c;
	c=toppings[i];
	toppings[i]=toppings[i+1];
	toppings[i+1]=c;
      }
 
 }
      }

  for(int i=0;i<n;i++){
    if((double)(masterK)/masterP < (double)(masterK+toppings[i])/masterP+primes[2]){
      masterK+=toppings[i];
      masterP+=primes[2];
    }
    else{
      break;
    }
  }
  cout << masterK/masterP <<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   10 |   cin >> n;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:40:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   40 |   cout << masterK/masterP <<endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:40:29: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   40 |   cout << masterK/masterP <<endl;
      |                             ^~~~
      |                             std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

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

int f(int x,int y){
	if(x<y)return false;
	return true;
}

int main(){
	int n,a,b,c,d,ans[3];
	vector<int> vi;
	scanf("%d%d%d%d",&n,&a,&b,&c);
	for(int i=0;i<n;i++){
		scanf("%d",&d);
		vi.push_back(d);
	}
	sort(vi.begin(),vi.end(),f);
	ans[0]=c/a;
	ans[1]=(c+d[0])/(a+b);
	ans[2]=(c+d[0]+d[1])/(a+b+b);
	printf("%d\n",max(ans[0],max(ans[1],ans[2])));
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:20: error: invalid types 'int[int]' for array subscript
   21 |         ans[1]=(c+d[0])/(a+b);
      |                    ^
a.cc:22:20: error: invalid types 'int[int]' for array subscript
   22 |         ans[2]=(c+d[0]+d[1])/(a+b+b);
      |                    ^
a.cc:22:25: error: invalid types 'int[int]' for array subscript
   22 |         ans[2]=(c+d[0]+d[1])/(a+b+b);
      |                         ^
Language: C++

#include<algorithm>
#include<functional>
using namespace std;
int main()
{
	int i, n, a, b, c, d[10000],g,max;
	scanf("%d", &n);
	scanf("%d %d", &a, &b);
	scanf("%d", &c);
	for (i = 0; i < n; i++){
		scanf("%d", &d[i]);
	}
	sort(d, d + n, greater<int>());
	max = c / a;
	for (i = 1; i <= n; i++){
		g = 0;
		for (int i2 = 0; i2 < i; i2++){
			g += d[i2];
		}
		g = (g + c) / (a + i*b);
		if (max < g)
			max = g;

	}
	printf("%d\n", max);
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'scanf' was not declared in this scope
    7 |         scanf("%d", &n);
      |         ^~~~~
a.cc:25:9: error: 'printf' was not declared in this scope
   25 |         printf("%d\n", max);
      |         ^~~~~~
a.cc:3:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    2 | #include<functional>
  +++ |+#include <cstdio>
    3 | using namespace std;
Language: C++

/* title: Best Pizza
 * source: JOI2011-2012 Yosen No.3
 * hint:
 * トッピングをx個使用すると仮定した場合、
 * そのx個はカロリーが大きい方からx個選んだものが最適になる
 */



#include <iostream>
#include <numeric> // accumulateを使うため
#include <vector>
using namespace std;


int main()
{
	int N, A, B, C;
	cin >> N >> A >> B >> C;

	vector<int> toppings(N);
	for(int i = 0; i < N; i++) cin >> toppings[i];

	sort(toppings.begin(), toppings.end(), greater<int>());

	int best = 0;
	for(int x = 0; x <= N; x++) {
		int calory = C + accumulate(toppings.begin(), toppings.begin() + x, 0);
		int cost   = A + B * x;
		best = max(best, calory / cost);
	}

	cout << best << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   24 |         sort(toppings.begin(), toppings.end(), greater<int>());
      |         ^~~~
      |         short
Language: Java

public class Main
{
	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		int N=sc.nextInt();
		int K=sc.nextInt();
		
		int[][] curr   =new int[3][2];
		int[][] next   =new int[3][2];
		for(int i=0; i<3; i++)
			curr[i][0]=1;
		
		int[]   dayPlan=new int[N];
		for(int i=0; i<K; i++)
			dayPlan[sc.nextInt()-1] = sc.nextInt();

		for(int i=0; i<N-1; i++)
		{
			if(dayPlan[i] != 0)
			{
				for(int j=0; j<3; j++)
				{
					if(j != dayPlan[i]-1)
					{
						curr[j][0] = 0;
						curr[j][1] = 0;
					}
				}
				
			}
			for(int j=0; j<3; j++)
			{
				for(int k=0; k<3; k++)
					if(j==k){ next[k][1]+=curr[j][0]; next[k][1]%=10000; }
					else    { next[k][0]+=curr[j][0]; next[k][0]%=10000; }
				
				for(int k=0; k<3; k++)
					if(j!=k){ next[k][0]+=curr[j][1]; next[k][0]%=10000; }
			}
			
			for(int j=0; j<3; j++)
			{
				curr[j][0]=next[j][0];
				curr[j][1]=next[j][1];
				next[j][0]=0;
				next[j][1]=0;
			}
		}
		
		int ans = 0;
		for(int i=0; i<3; i++)ans+=curr[i][0];
		for(int i=0; i<3; i++)ans+=curr[i][1];
		ans %= 10000;
		System.out.println(ans);
	}
}

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

import java.util.*;
public class AOJ0568 {
	static int cnt=0;
	static int n;
	static int bfs(int a,int b,int day){
		int cnt=0;
		if(day==n+1){//もしたどり着けたら1を返す。
			return 1;
		}
		if(m[day][a][b]>-1)return m[day][a][b];//メモしていたらそれを返す。
		if(hyou[day]>0){//指定してある場合
			if(hyou[day]==a&&a==b){//全部一緒だったら0を返す。
				return 0;
			}else{
				return bfs(b,hyou[day],day+1)%10000;//違ったら日にち足して次の日に再帰。
			}
		}
		for(int i=1;i<=3;i++){
			if(a==i&&b==a)continue;
			cnt+=bfs(b,i,day+1)%10000;
		}
		m[day][a][b]=cnt%10000;
		return cnt%10000;
	}
	static int m[][][]=new int[101][4][4];
	static int hyou[]=new int[101];
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		n = in.nextInt();
		int k = in.nextInt();
		for(int s=0;s<101;s++){
			hyou[s]=0;
			for(int i=0;i<4;i++){
				for(int z=0;z<4;z++)m[s][i][z]=-1;
			}
		}
		for(int i=0;i<k;i++){
			int w = in.nextInt();
			hyou[w]=in.nextInt();
		}
		int ans = bfs(0,0,1);
		System.out.println(ans);
	}
}

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

import java.util.Scanner;


public class Main {
	public static void main(String[] args) {
		int N,K;
		Scanner sc = new Scanner(System.in);
		N=sc.nextInt();//何日間の予定を考えるか
		K=sc.nextInt();//何日間の予定が決まっているか
		int pasta[][]=new int[6][N+1];
		int pastaplan[]=new int[N+1];
		for(int i=0;i<K;i++){
			int day=sc.nextInt();//何日の予定が決まっているか
			pastaplan[day]=sc.nextInt();//その日のパスタは何か
		}
		if(pastaplan[1]==0){//もし１日目の予定が決まっていなければ
			pasta[1][1]=1;pasta[3][1]=1;pasta[5][1]=1;
		}else if(pastaplan[1]==1){
			pasta[1][1]=1;
		}else if(pastaplan[1]==2){
			pasta[3][1]=1;
		}else if(pastaplan[1]==3){
			pasta[5][1]=1;
		}
		for(int j=2;j<=N;j++){
			if(pastaplan[j]==0){//j日の予定がきまってなければ
				pasta[0][j]=pasta[1][j-1];//２日連続の時には前日の１日目の値がそのままくる。
				pasta[2][j]=pasta[3][j-1];
				pasta[4][j]=pasta[5][j-1];
				pasta[1][j]=pasta[2][j-1]+pasta[3][j-1]+pasta[4][j-1]+pasta[5][j-1];
				pasta[3][j]=pasta[0][j-1]+pasta[1][j-1]+pasta[4][j-1]+pasta[5][j-1];
				pasta[5][j]=pasta[0][j-1]+pasta[1][j-1]+pasta[2][j-1]+pasta[3][j-1];
			}else if(pastaplan[j]==1){//j日の予定がトマトだったら
				pasta[0][j]=pasta[1][j-1];//２日連続の時には前日の１日目の値がそのままくる。
				pasta[1][j]=pasta[2][j-1]+pasta[3][j-1]+pasta[4][j-1]+pasta[5][j-1];
			}else if(pastaplan[j]==2){
				pasta[2][j]=pasta[3][j-1];
				pasta[3][j]=pasta[0][j-1]+pasta[1][j-1]+pasta[4][j-1]+pasta[5][j-1];
			}else{
				pasta[4][j]=pasta[5][j-1];
				pasta[5][j]=pasta[0][j-1]+pasta[1][j-1]+pasta[2][j-1]+pasta[3][j-1];
			}
		}
		int sum=pasta[0][N]+pasta[1][N]+pasta[2][N]+pasta[3][N]+pasta[4][N]+pasta[5][N];
		System.out.println(sum%10000);
	}

Compiler output:
Main.java:46: error: reached end of file while parsing
	}
	 ^
1 error