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

#include <iostream>
using namespace std;

int W;
int w[1001],v[1001];
int N;
int dp[1001][1001];

int rec(int i, int j){

  //もうやった
  if(dp[i][j] >= 0){
    return dp[i][j];
  }
  int res;

  if(i == N){ // もう品物は無い
    res = 0;

  }else if(j < w[i]){ // この品物は入らない
    res = rec(i + 1,j);
 
  }else{ // 品物を加えることが出来るとき
        res = max(rec(i+1,j), rec(i+1,j-w[i]) + v[i]);
    /* 
   int tmp1,tmp2;
    tmp1 = rec(i+1,j);
    tmp2 = rec(i+1,j-w[i]) + v[i];
    if(tmp1 < tmp2){
      res = tmp2;
    }else{
      res = tmp1;
    }
    */
  }
  return dp[i][j] = res;
}


int main(){

  int num = 1;

  while(1){
    cin >> W;
    if(W == 0) break;
    cin >> N;
    //初期化
    /*
    for(int i = 0; i < 1001; i++){
      w[i] = v[i] = -1;
      for(int j = 0; j < 1001; j++)
	dp[i][j] = -1; 
    }
    */
    memset(dp,-1,sizeof(dp));
    memset(w,-1,sizeof(w));
    memset(v,-1,sizeof(v));


    //入力
    char tmp;
    for(int i = 0; i < N; i++) cin >> v[i] >> tmp >> w[i];

    int ans = rec(0,W);

    // dp配列を全て埋める
    for(int i = 0; i < N; i++){
      for(int j = 0; j <= W; j++){
	if(dp[i][j] == -1)
	  rec(i,j);
      }
    }   
  
    cout << "Case "<< num  << ":"<< endl;
    num++;
    cout << ans << endl; 
    int j;
    for( j = 0; dp[0][j] != ans ; j++){}
    cout << j << endl;
    
  }
  return 0;
}

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

import java.io.*;

class Main{
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine)!=null){
int n=new int[10];
for(int i=0;i<13;i++){
n[(int)(line.charAt(i)-'1'+1)]++;
}
for(int i=1;i<=9;i++){
if(n[i]<2){
continue;
}
else{
n[i]-=2;
if(check(n)){
System.out.println(i+" ");
}
}
}
System.out.println("");
}
}
private static boolean check(int[] n){
it min=0;
for(int i=1;i<=9;i++){
n[i]%=3;
}
for(int i=1;i<=7;i++){
min=Math.min(n[i],n[i+1]);
min=Math.min(min,n[i+2]);
n[i]-=min;
n[i+1]-=min;
n[i+2]-=min;
}
for(int i=1;i<=9;i++){
if(n[i]!=0){
return false;
}
}
return true;
}
}

Compiler output:
Main.java:7: error: cannot find symbol
while((line=br.readLine)!=null){
              ^
  symbol:   variable readLine
  location: variable br of type BufferedReader
Main.java:8: error: incompatible types: int[] cannot be converted to int
int n=new int[10];
      ^
Main.java:10: error: array required, but int found
n[(int)(line.charAt(i)-'1'+1)]++;
 ^
Main.java:13: error: array required, but int found
if(n[i]<2){
    ^
Main.java:17: error: array required, but int found
n[i]-=2;
 ^
Main.java:18: error: incompatible types: int cannot be converted to int[]
if(check(n)){
         ^
Main.java:27: error: cannot find symbol
it min=0;
^
  symbol:   class it
  location: class Main
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
7 errors
Language: Java

import java.io.*;

class Main{
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null){
int[] n=new int[10];
for(int i=0;i<13;i++){
n[(int)(line.charAt(i)-'1'+1)]++;
}
for(int i=1;i<=9;i++){
if(n[i]<2){
continue;
}
else{
n[i]-=2;
if(check(n)){
System.out.println(i+" ");
}
}
}
System.out.println("");
}
}
private static boolean check(int[] n){
it min=0;
for(int i=1;i<=9;i++){
n[i]%=3;
}
for(int i=1;i<=7;i++){
min=Math.min(n[i],n[i+1]);
min=Math.min(min,n[i+2]);
n[i]-=min;
n[i+1]-=min;
n[i+2]-=min;
}
for(int i=1;i<=9;i++){
if(n[i]!=0){
return false;
}
}
return true;
}
}

Compiler output:
Main.java:27: error: cannot find symbol
it min=0;
^
  symbol:   class it
  location: class Main
1 error
Language: Java

import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class AOJ0043 {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		String in;
		try {
			while ((in = sc.nextLine()) != null) {
				ArrayList<Integer> ans = new ArrayList<Integer>();
				for (int i = 1; i <= 9; i++) {
					String temp = new String(in) + i;
					if (solve(temp)) {
						ans.add(i);
					}
				}
				if (ans.size() == 0) {
					System.out.println(0);
				} else {
					Collections.sort(ans);
					for (int i = 0; i < ans.size() - 1; i++) {
						System.out.print(ans.get(i) + " ");
					}
					System.out.println(ans.get(ans.size() - 1));
				}
			}
		} catch (Exception e) {
		}
	}

	static int[] toArray(String str) {
		int ret[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, };
		for (char num : str.toCharArray()) {
			ret[num - '0' - 1]++;
		}
		for (int n : ret) {
			if (n > 4)
				return null;
		}
		return ret;
	}

	static boolean solve(String in) {
		for (int i = 0; i < 9; i++) {
			int temp1[] = toArray(in);
			if (temp1 == null) {
				return false;
			}
			if (head(temp1, i)) {
				int[] temp2 = temp1.clone();
				if (solve2(temp2, 0)) {
					return true;
				}
			}
		}

		return false;
	}

	static boolean solve2(int[] in, int dep) {
		for (int i = 0; i < 9; i++) {
			int[] temp = in.clone();
			if (kotu(temp, i)) {
				if (hantei(temp)) {
					return true;
				}
				if (dep < 4) {
					if (solve2(temp, dep + 1)) {
						return true;
					}
				}
			}
		}
		for (int i = 0; i < 7; i++) {
			int[] temp = in.clone();
			if (shuntu(temp, i)) {
				if (hantei(temp)) {
					return true;
				}
				if (dep < 4) {
					if (solve2(temp, dep + 1)) {
						return true;
					}
				}
			}
		}

		return false;
	}

	// 頭をとる。取れたらｔるえ
	static boolean head(int in[], int num) {
		if (in[num] >= 2) {
			in[num] -= 2;
			return true;
		} else {
			return false;
		}
	}

	// こーつをとる。取れたらｔるえ
	static boolean kotu(int in[], int num) {
		if (in[num] >= 3) {
			in[num] -= 3;
			return true;
		} else {
			return false;
		}
	}

	// しゅんつをとる。取れたらｔるえ
	static boolean shuntu(int in[], int num) {
		if (num > 7) {
			return false;
		} else {
			if (in[num] >= 1 && in[num + 1] >= 1 && in[num + 2] >= 1) {
				in[num]--;
				in[num + 1]--;
				in[num + 2]--;
				return true;
			} else {
				return false;
			}
		}
	}

	static boolean hantei(int[] in) {
		for (int n : in) {
			if (n != 0)
				return false;
		}
		return true;
	}
}

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

char t1[12];

int f(int x){
	char t2[12];
	int i,c=4;
	memcpy(t2,t1,12);
	t2[x]-=2;
	for(i=1;i<=9;){
		if(t2[i]){
			if(t2[i]>2)t2[i]-=3;
			else if(t2[i+1]&&t2[i+2]){
				--t2[i];--t2[i+1];--t2[i+2];
			}
			else return 0;
			if(!--c)return 1;
		}
		if(!t2[i])++i;
	}
	return 0;
}

int main(void){
	char s[16];
	int i,j,z;
	for(;fgets(s,16,stdin);){
		memset(t1,0,12);
		for(z=i=0;i<13;)++t1[s[i++]-'0'];
		for(i=1;i<=9;i++){
			if(t1[i]<4){
				++t1[i];
				for(j=1;j<=9;j++){
					if(t1[j]>1&&f(j)){
						z++&&printf(" ");
						printf("%d",i,j);
						break;
					}
				}
				--t1[i];
			}
		}
		puts(z?"":"0");
	}
	return 0;
}

Compiler output:
main.c: In function 'f':
main.c:6:9: error: implicit declaration of function 'memcpy' [-Wimplicit-function-declaration]
    6 |         memcpy(t2,t1,12);
      |         ^~~~~~
main.c:1:1: note: include '<string.h>' or provide a declaration of 'memcpy'
  +++ |+#include <string.h>
    1 | char t1[12];
main.c:6:9: warning: incompatible implicit declaration of built-in function 'memcpy' [-Wbuiltin-declaration-mismatch]
    6 |         memcpy(t2,t1,12);
      |         ^~~~~~
main.c:6:9: note: include '<string.h>' or provide a declaration of 'memcpy'
main.c: In function 'main':
main.c:25:14: error: implicit declaration of function 'fgets' [-Wimplicit-function-declaration]
   25 |         for(;fgets(s,16,stdin);){
      |              ^~~~~
main.c:25:25: error: 'stdin' undeclared (first use in this function)
   25 |         for(;fgets(s,16,stdin);){
      |                         ^~~~~
main.c:1:1: note: 'stdin' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
  +++ |+#include <stdio.h>
    1 | char t1[12];
main.c:25:25: note: each undeclared identifier is reported only once for each function it appears in
   25 |         for(;fgets(s,16,stdin);){
      |                         ^~~~~
main.c:26:17: error: implicit declaration of function 'memset' [-Wimplicit-function-declaration]
   26 |                 memset(t1,0,12);
      |                 ^~~~~~
main.c:26:17: note: include '<string.h>' or provide a declaration of 'memset'
main.c:26:17: warning: incompatible implicit declaration of built-in function 'memset' [-Wbuiltin-declaration-mismatch]
main.c:26:17: note: include '<string.h>' or provide a declaration of 'memset'
main.c:33:54: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   33 |                                                 z++&&printf(" ");
      |                                                      ^~~~~~
main.c:33:54: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:33:54: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:33:54: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:41:17: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
   41 |                 puts(z?"":"0");
      |                 ^~~~
main.c:41:17: note: include '<stdio.h>' or provide a declaration of 'puts'
Language: C

t1[12],t2[12],i,j,k,z,r,c;

f(x){
	r=c=4;
	memcpy(t2,t1,48);
	t2[x]-=2;
	for(k=1;k<=9;){
		t2[k]--?t2[k]>1?t2[k]-=2,r=--c:t2[k+1]&&t2[k+2]?--t2[k+1],--t2[k+2],r=--c:0:0;
		t2[k]<1&&++i;
}

main(){
	char s[16];
	for(;scanf(" %d",s);){
		memset(t1,0,48);
		for(z=i=0;i<13;)++t1[s[i++]-'0'];
		for(i=1;i<=9;i++){
			if(t1[i]<4){
				++t1[i];
				for(r=j=1;r&&j<=9;j++){
					if(t1[j]>1&&f(j)){
						z++&&printf(32);
						printf("%d",i);
						break;
					}
				}
				--t1[i];
			}
		}
		puts(z?"":"0");
	}
	return 0;
}

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | t1[12],t2[12],i,j,k,z,r,c;
      | ^~
main.c:1:1: error: type defaults to 'int' in declaration of 't1' [-Wimplicit-int]
main.c:1:8: error: type defaults to 'int' in declaration of 't2' [-Wimplicit-int]
    1 | t1[12],t2[12],i,j,k,z,r,c;
      |        ^~
main.c:1:15: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int]
    1 | t1[12],t2[12],i,j,k,z,r,c;
      |               ^
main.c:1:17: error: type defaults to 'int' in declaration of 'j' [-Wimplicit-int]
    1 | t1[12],t2[12],i,j,k,z,r,c;
      |                 ^
main.c:1:19: error: type defaults to 'int' in declaration of 'k' [-Wimplicit-int]
    1 | t1[12],t2[12],i,j,k,z,r,c;
      |                   ^
main.c:1:21: error: type defaults to 'int' in declaration of 'z' [-Wimplicit-int]
    1 | t1[12],t2[12],i,j,k,z,r,c;
      |                     ^
main.c:1:23: error: type defaults to 'int' in declaration of 'r' [-Wimplicit-int]
    1 | t1[12],t2[12],i,j,k,z,r,c;
      |                       ^
main.c:1:25: error: type defaults to 'int' in declaration of 'c' [-Wimplicit-int]
    1 | t1[12],t2[12],i,j,k,z,r,c;
      |                         ^
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | f(x){
      | ^
main.c: In function 'f':
main.c:3:1: error: type of 'x' defaults to 'int' [-Wimplicit-int]
main.c:5:9: error: implicit declaration of function 'memcpy' [-Wimplicit-function-declaration]
    5 |         memcpy(t2,t1,48);
      |         ^~~~~~
main.c:1:1: note: include '<string.h>' or provide a declaration of 'memcpy'
  +++ |+#include <string.h>
    1 | t1[12],t2[12],i,j,k,z,r,c;
main.c:5:9: warning: incompatible implicit declaration of built-in function 'memcpy' [-Wbuiltin-declaration-mismatch]
    5 |         memcpy(t2,t1,48);
      |         ^~~~~~
main.c:5:9: note: include '<string.h>' or provide a declaration of 'memcpy'
main.c:12:1: error: implicit declaration of function 'main' [-Wimplicit-function-declaration]
   12 | main(){
      | ^~~~
main.c:12:7: error: expected ';' before '{' token
   12 | main(){
      |       ^
      |       ;
main.c:33:1: error: expected declaration or statement at end of input
   33 | }
      | ^
Language: C

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

//#pragma comment(linker, "/STACK:400000000")

#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<n;i++)
#define pb push_back
#define sz size()
#define vi vector<int>

string in;
vi a;

int dfs(vi v,int rest){
    if(rest==0)return 1;
    if(rest==14){
        rep(i,9)if(v[i]>=2){
            vi w=v;
            w[i]-=2;
            if(dfs(w,12))return 1;
        }
        return 0;
    }
    rep(i,9)if(v[i]>=3){
        vi w=v;
        w[i]-=3;
        if(dfs(w,rest-3))return 1;
    }
    rep(i,7)if(v[i] && v[i+1] && v[i+2]){
        vi w=v;
        w[i]--; w[i+1]--; w[i+2]--;
        if(dfs(w,rest-3))return 1;
    }
    return 0;
}

int main(){
	while(cin>>in){
        vi v(9,0),ans;
        rep(i,13)v[in[i]-'1']++;
        rep(i,9){
            if(v[i]==4)continue;
            vi w=v;
            w[i]++;
            if(dfs(w,14))ans.pb(i);
        }
        if(ans.sz==0)cout<<0<<endl;
        else{
            rep(i,ans.sz)cout<<ans[i]+1<<( i!=ans.sz-1?" ":"\n");
        }
    }
}

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

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

int m[14],w[10],w2[10],a[9];

void f0(int *ws,int *k)
{
	int j;
	for(j=1;ws[j]==0;j++);
	if(ws[j]>2)
	{
		ws[j]-=3;
		(*k)++;
	}
}

void f1(int *ws,int *k)
{
	int j;
	for(j=1;j<8;)
	{
		if(ws[j]>0&&ws[j+1]>0&&ws[j+2]>0)
		{
			ws[j]--;ws[j+1]--;ws[j+2]--;(*k)++;
		}
		else
			j++;
	}
}

void f2(int *ws,int *k)
{
	int j;
	for(j=1;j<=9;j++)
		if(ws[j]>=3)
		{
			ws[j]-=3;
			(*k)++;
		}
}
int s(int *ws)
{
	int j,k=0;
	f0(ws,&k);
	f1(ws,&k);
	f2(ws,&k);
	return k;
}

int s2(int *ws)
{
	int k=0;
	f0(ws,&k);
	f2(ws,&k);
	f1(ws,&k);
	return k;
}

int main()
{
	int i,j,k,l,x;
	while(scanf("%1d",&m[0])==1)
	{
		for(i=1;i<13;i++)
			scanf("%1d",&m[i]);
		x=0;
		for(i=1;i<=9;i++)
		{
			for(l=1;l<=9;l++)
			{
				k=0;
				memset(w,0,sizeof(w));
				for(j=0;j<13;j++)
					w[m[j]]++;
				if(w[i]+1>4)
					continue;
				w[i]++;
				if(w[l]<2)
					continue;
				w[l]-=2;
				memcpy(w2,w,sizeof(w));
				if(s(w)==4||s2(w2)==4)
				{
					a[x++]=i;
					break;
				}
			}
		}
		if(x==0)
			printf("0\n");
		else
			for(i=0;i<x;i++)
				printf("%d%s",a[i],i==x-1?"\n":" ");
	}
	return 0;
}

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

#include <iostream>
#include <string>
#include <string.h>
#include <vector>
#include <algorithm>

#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define pb push_back

using namespace std;

int ans[10];

void solve(vector<int> a,int n)
{
	int count = 0;
	rep(i,a.size()) count += a[i];

	if(count == 0)
	{
		ans[n] = 1;
		return;
	}

	REP(i,1,10)
	{
		if(a[i] >= 3)
		{
			a[i] -= 3;
			solve(a,n);
			a[i] += 3;
		}
	}

	REP(i,3,10)
	{
		if(a[i-2] && a[i-1] && a[i])
		{
			a[i-2]--; a[i-1]--; a[i]--;
			solve(a,n);
			a[i-2]++; a[i-1]++; a[i]++;
		}
	}
}


int main()
{
	string s;
	while(cin >> s)
	{
		vector<int> a;
		memset(ans,0,sizeof(ans));

		rep(i,10) a.pb(0);
		rep(i,s.size()) a[s[i] - '0']++;

		REP(i,1,10)
		{
			if(a[i] == 4)
			{
				continue;
			}
			else
			{
				a[i]++;
				REP(i,1,10)
				{
					if(a[j] >= 2)
					{
						a[j] -= 2;
						solve(a,i);
						a[j] += 2;
					}
				}
				a[i]--;
			}
		}

		bool count_0 = true;
		int ans_max = 0;
		REP(i,1,10)
		{
			if(ans[i])
			{
				count_0 = false;
				ans_max = max(ans_max,i);
			}
		}

		if(count_0) 
		{
			cout << 0 << endl;
		}
		else
		{
			bool flag = true;
			REP(i,1,10)
			{
				if(ans[i] == 1)
				{
					if(i == ans_max)
					{
						cout << i << endl;
					}
					else
					{
						cout << i << " ";
					}
				}
			}
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:70:46: error: 'j' was not declared in this scope
   70 |                                         if(a[j] >= 2)
      |                                              ^
Language: C++

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

string str;

bool c (map<char,int> m) {
    for (auto i = m.begin(); i !=  m.end(); i++) {
        if (i->second != 0) return false;
    }
    return true;
}

bool dfs(map<char,int> m) {
    if (c(m)) return true;
    for (char i = '1'; i <= '9'; i++) {
        if (m[i] >= 3) {
            m[i] -= 3;
            if (dfs (m)) return true;;
            m[i] += 3;
        }
        if (i + 2 <= '9' && m[i] > 0 && m[i+1] > 0 &&  m[i+2] > 0) {
            m[i]--; m[i + 1]--; m[i + 2]--;
            if (dfs(m)) return true;
            m[i]++; m[i + 1]++; m[i + 2]++;
        }
    }
    return false;
}

int main ()
{
    while (cin >> str) {
        map<char,int> m;
        for (char i = '1' ; i <= '9'; i++) m[i] = 0;
        for (int i = 0; i < str.size(); i++) {
            m[str[i]]++;
        }

        vector<char> res;
        for (char i = '1'; i <= '9'; i++) {
            if (m[i] >= 4) continue;
            m[i]++;
            for (char j = '1'; j <= '9'; j++) {
                if (m[j] >= 2) {
                    m[j] -= 2;
                    if (dfs(m)) {
                        res.push_back(i);
                        m[j] += 2;
                        break;
                    }
                    m[j] += 2;
                }
            }
            m[i]--;
        }
        if (res.size()) {
            cout << res[0];
            for (int i = 1; i < res.size(); i++) cout << " " << res[i];
        else cout << 0;
        cout << endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:63:9: error: expected '}' before 'else'
   63 |         else cout << 0;
      |         ^~~~
a.cc:60:25: note: to match this '{'
   60 |         if (res.size()) {
      |                         ^
Language: C++

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

int tmp[10];

bool solve(int n, int f) {
	bool judge = false;
	if (f == 4) {
		for (int i = 1; i < 10; i++) {
			if (tmp[i] == 2) {
				return true;
			}
		}
		return false;
	}

	if (tmp[n] >= 3) {
		tmp[n] -= 3;
		judge = solve(n, f + 1);
		tmp[n] += 3;
	}

	if (n <= 7 && tmp[n] >= 1 && tmp[n + 1] >= 1 && tmp[n + 2] >= 1) {
		tmp[n]--; tmp[n + 1]--; tmp[n + 2]--;
		judge = solve(n, f + 1);
		tmp[n]++; tmp[n + 1]++; tmp[n + 2]++;
	}

	if (n < 9) {
		judge = solve(n + 1, f);
	}
	return judge;
}

int main() {
	string source;
	int pai[10];
	while (getline(cin, source)) {
		fill(pai[0], pai[10], 0);
		for (int i = 0; i < 13; i++) {
			pai[source[i] - '0']++;
		}

		vector<int> v;
		for (int i = 1; i < 10; i++) {
			if (pai[i] < 4) {
				pai[i]++;
				for (int j = 1; j < 10; j++) {
					tmp[j] = pai[j];
				}
				if (solve(1, 0)) {
					v.push_back(i);
				}
				pai[i]--;
			}
		}

		if (v.empty()) cout << 0 << endl;
		else {
			for (int i = 0; i < v.size() - 1; i++) {
				cout << v[i] << ' ';
			}
			cout << v[v.size() - 1] << endl;
		}
	}
	return 0;
}

Compiler output:
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: In instantiation of 'typename __gnu_cxx::__enable_if<std::__is_scalar<_Tp>::__value, void>::__type std::__fill_a1(_ForwardIterator, _ForwardIterator, const _Tp&) [with _ForwardIterator = int; _Tp = int; typename __gnu_cxx::__enable_if<__is_scalar<_Tp>::__value, void>::__type = void]':
/usr/include/c++/14/bits/stl_algobase.h:998:21:   required from 'void std::__fill_a(_FIte, _FIte, const _Tp&) [with _FIte = int; _Tp = int]'
  998 |     { std::__fill_a1(__first, __last, __value); }
      |       ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:1029:20:   required from 'void std::fill(_ForwardIterator, _ForwardIterator, const _Tp&) [with _ForwardIterator = int; _Tp = int]'
 1029 |       std::__fill_a(__first, __last, __value);
      |       ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:42:7:   required from here
   42 |                 fill(pai[0], pai[10], 0);
      |                 ~~~~^~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:952:9: error: invalid type argument of unary '*' (have 'int')
  952 |         *__first = __tmp;
      |         ^~~~~~~~
Language: C++

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

using db = double;
using ll = long long;
using vi = vector <int>;
#define op operator
#define pb push_back

const int N = 15;
int c[N];
bool ans;

void dfs(int a, int b) {
	if(!a && !b) {
		ans = 1;
		return;
	}
	int i = find_if(c, c + N, [](int i) { return i > 0; }) - c;
	if(a) {
		if(c[i] >= 3) {
			c[i] -= 3;
			dfs(a - 1, b);
			c[i] += 3;
		}
		if(c[i] && c[i + 1] && c[i + 2]) {
			c[i] --; c[i + 1] --; c[i + 2] --;
			dfs(a - 1, b);
			c[i] ++; c[i + 1] ++; c[i + 2] ++;
		}
	}
	if(b && c[i] >= 2) {
		c[i] -= 2;
		dfs(a, b - 1);
		c[i] += 2;
	}
}

int main() {
	ios :: sync_with_stdio(0);

	for(string s; cin >> s; ) {
		memset(c, 0, sizeof c);
		for(char i : s)
			c[i - '0'] ++;
		vector <int> v;
		for(int i = 1; i <= 9; i ++) if(c[i] < 4) {
			c[i] ++;
			ans = 0;
			dfs(4, 1);
			if(ans)
				v.pb(i);
			c[i] --;
		}
		if(v.size() == 0)
			cout << "0\n";
		else {
			for(int i = 0; i < v.size(); i ++)
				cout << x << (i + 1 == v.size() ? '\n' : ' ');
			cout << '\n';
		}
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:59:41: error: 'x' was not declared in this scope
   59 |                                 cout << x << (i + 1 == v.size() ? '\n' : ' ');
      |                                         ^
Language: C++

#include<iostream>

using namespace std;

const int MAX_LINELEN = 14;
const int DIGIT_NUM = 10;

int puzzleCheck(int [], int, int, int *);
void checkNum(char *, int []);

int main(void)
{
	while( true ){
		int i;
		int isThisLineClear = 0;
		char lineData[MAX_LINELEN] = "";
		
		scanf("%s", lineData);
		if( strlen( lineData ) < 13){
			break;
		}

		for(i = 1; i <= DIGIT_NUM; i++){
			int j;
			int foundFlag = 0;
			int invalidPuzzle = 0;
			int num[DIGIT_NUM] = {0,};
			
			lineData[MAX_LINELEN - 1] = i + '0';
			checkNum(lineData, num);
			
			for(j = 0; j < DIGIT_NUM; j++){
				if(num[j] >= 5){
					invalidPuzzle = 1;
				}
			}
			if(invalidPuzzle){continue;}
			
			puzzleCheck(num, i, 0, &foundFlag);
			if(foundFlag){isThisLineClear = 1;}
		}
		if(isThisLineClear){
			printf("\b\n");
		}else{
			printf("0\n");
		}
	}
	return 0;
}

int puzzleCheck(int num[], int nowNumber, int twoPairFlag, int *foundFlag)
{
	int isComplete = 0;
	for(int i = 0; i < DIGIT_NUM; i++){
		if(num[i] == 0){
			isComplete++;
		}
	}
	if(isComplete == DIGIT_NUM && *foundFlag == 0){
		printf("%d ", nowNumber);
		*foundFlag = 1;
	}
	
	for(int i = 0; i < DIGIT_NUM; i++){
		if(num[i] >= 2 && twoPairFlag == 0){
			num[i] -= 2;
			puzzleCheck(num, nowNumber, 1, foundFlag);
			num[i] += 2;
		}
		if(num[i] >= 3){
			num[i] -= 3;
			puzzleCheck(num, nowNumber, twoPairFlag, foundFlag);
			num[i] += 3;
		}
		if(i <= DIGIT_NUM - 3){
			if(num[i] >= 1 && num[i+1] >= 1 && num[i+2] >= 1){
				num[i]--;num[i+1]--;num[i+2]--;
				puzzleCheck(num, nowNumber, twoPairFlag, foundFlag);
				num[i]++;num[i+1]++;num[i+2]++;
			}
		}
	}
	return 0;
}

void checkNum(char *lineData, int num[])
{
	const char digits[DIGIT_NUM] = "123456789";
	
	for(unsigned int i = 0; i < strlen(lineData); i++){
		for(int j = 0; j < DIGIT_NUM; j++){
			if(lineData[i] == digits[j]){
				num[j]++;
			}
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:21: error: 'strlen' was not declared in this scope
   19 |                 if( strlen( lineData ) < 13){
      |                     ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | 
a.cc: In function 'void checkNum(char*, int*)':
a.cc:90:37: error: 'strlen' was not declared in this scope
   90 |         for(unsigned int i = 0; i < strlen(lineData); i++){
      |                                     ^~~~~~
a.cc:90:37: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<vector>
using namespace std;
int x[14];
bool r[14][100];
bool tempai(int num, int jan, int chou, bool make){
  for(int i=0; i<14; i++){
    if(!r[i][num]){
      if(jan == 1 && i<13){
	if(x[i] == x[i+1] && !(r[i+1][num])){
	  for(int j=0; j<14; j++){r[j][num+1] = r[j][num];}
	  r[i][num+1] = 1;
	  r[i+1][num+1] = 1;
	  make = tempai(num+1,0,chou,make);
	}
      }
      if(chou>0 && i<12){
	if(x[i] == x[i+1] && x[i+1] == x[i+2]&& !(r[i+1][num]) && !(r[i+2][num])){
	  for(int j=0; j<14; j++){r[j][num+1] = r[j][num];}
	  r[i][num+1] = 1;
	  r[i+1][num+1] = 1;
	  r[i+2][num+1] = 1;
	  make = tempai(num+1,jan,chou-1,make);
	}
      }
      if(chou>0 && x[i]<8){
	int a = -1,b = -1;
	for(int j=i+1; j<14; j++){
	  if(x[j] == x[i]+1 && !(r[j][num])){a = j;}
	  if(x[j] == x[i]+2 && !(r[j][num])){b = j;}
	}
	if(a!=-1 && b!=-1){
	  for(int j=0; j<14; j++){r[j][num+1] = r[j][num];}
	  r[i][num+1] = 1;
	  r[a][num+1] = 1;
	  r[b][num+1] = 1;
	  make = tempai(num+1,jan,chou-1,make);
	}
      }
    }
  }
  if(!(jan) && !(chou)){make = true;}
  return make;
}
int main(){
  for(;;){
    int hai[14] = {0};
    vector<int> ans;
    for(int i=0; i<13; i++){
      if(scanf("%1d",&hai[i]) == EOF){break;}
    }
    for(int i=1; i<10; i++){
      hai[13] = i;
      for(int j=0; j<14; j++){x[j] = hai[j];}
      sort(x,x+14);
      for(int j=0,r=-1,cou=0; j<14; j++){
	if(r != x[j]){r = x[j];cou = 1;}
	else{cou++;}
	if(cou > 4){goto jump;}
      }
      bool f = tempai(0,1,4,false);
      if(f){ans.push_back(i);}
    jump:;
    }
    if(ans.empty()){cout<<"0"<<endl;}
    else{
      for(int i=0; i<ans.size(); i++){
	if(!i){cout<<ans[i];}
	else{cout<<" "<<ans[i];}
      }
      cout <<endl;
    }
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:66:5: error: jump to label 'jump'
   66 |     jump:;
      |     ^~~~
a.cc:62:26: note:   from here
   62 |         if(cou > 4){goto jump;}
      |                          ^~~~
a.cc:64:12: note:   crosses initialization of 'bool f'
   64 |       bool f = tempai(0,1,4,false);
      |            ^
Language: C++

import java.util.Scanner;
public class Main
{
	public static void main(String arg[])
	{
		Scanner in = new Scanner(System.in);
		while(in.hasNext())
		{
			String str=in.next();
			int a[]=new int[10];
			for(int i=0;i<str.length();i++)
				a[str.charAt(i)-'0']++;
			int ans[]=new int[10];
			for(int i=1;i<=9;i++)
			{
				if(a[i]==4)
					continue;
				a[i]++;
				for(int j=1 ; j <= 9 ; j++ )
				{
					if( a[j] >= 2 )
					{
						a[j] -= 2;
						sol(a,i,ans);
						a[j] += 2;
					}
				}
				a[i]--;
			}
			int j=0;
			for(int i=1;i<=9;i++)
			{
				if(ans[i]==1)
				{
					if(j!=0)
						System.out.print(" ");
					System.out.print(i);
					j=1;
				}
			}
			if(j==0)
				System.out.print(0);
			System.out.println();
		}
	}

	public static void sol(int a[],int n,int ans[])
	{
		int s=0;
		for(int i=1;i<=9;i++)
			s+=a[i];
		if(s==0)
			ans[n]=1;

		for(int i=1; i <= 9 ; i++ )
		{
			if( a[i] >= 3 )
			{
				a[i] -= 3;
				sol( a , n , ans );
				a[i] += 3;
			}
		}
		for(int i=1 ; i <= 7 ; i++ )
		{
			if(a[i]>=1&&a[i+1]>=1&&a[i+2]>=1)
			{
				a[i]--;
				a[i+1]--;
				a[i+2]--;
				sol( a , n , ans );
				a[i]++;
				a[i+1]++;
				a[i+2]++;
			}

		}
	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: expected unqualified-id before 'public'
    2 | public class Main
      | ^~~~~~
Language: C++

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

#define REP(i,n) for(int i=0; i<n; ++i)
#define IREP(it,array) for(vector<int>::iterator it=array.begin(); it!=array.end(); ++it)

bool judgeTriple(int tmp2[], int count){
  if(count==4)
    return true;
  for(int i=1; i<=7; i++){
    if(tmp2[i]>=1 && tmp2[i+1]>=1 && tmp2[i+2]>=1){
      tmp2[i]--;
      tmp2[i+1]--;
      tmp2[i+2]--;
      if(judgeTriple(tmp2,count+1))
	return true;
      tmp2[i]++;
      tmp2[i+1]++;
      tmp2[i+2]++;
    }
  }
  REP(i,10){
    if(tmp2[i]>=3){
      tmp2[i]-=3;
      if(judgeTriple(tmp2,count+1))
	return true;
      tmp2[i]+=3;
    }
  }
  return false;
}

bool isEnd(int tmp[]){
  REP(i,10){
    if(tmp[i]>=5)
      return false;
  }
  // remove head
  for(int i=1; i<10; i++){
    if(tmp[i]>=2){
      tmp[i]-=2;
      if( judgeTriple(tmp,0) )
	return true;
      tmp[i]+=2;
    }
  }
  return false;
}

int main()
{
  string str;
  while(cin>>str){
    int nums[10];
    memset(nums, 0, sizeof(nums));

    REP(i,str.size())
      nums[str[i]-'0']++;

    vector<int> res;

    for(int i=1; i<=9; i++){
      int tmp[10];
      memcpy(tmp, nums, sizeof(nums));
      tmp[i]++;

      if(isEnd(tmp)){
	res.push_back(i);
      }
    }

    if(res.empty())
      cout << "0" << endl;
    else{
      bool first=true;
      IREP(it,res){
	if(!first)
	  cout << " ";
	first = false;
	cout << *it;
      }
      cout << endl;
    }
  }

  return 0;
}

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

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

#define REP(i,n) for(int i=0; i<n; ++i)
#define IREP(it,array) for(vector<int>::iterator it=array.begin(); it!=array.end(); ++it)

bool judgeTriple(int tmp2[], int count){
  if(count==4)
    return true;
  for(int i=1; i<=7; i++){
    if(tmp2[i]>=1 && tmp2[i+1]>=1 && tmp2[i+2]>=1){
      tmp2[i]--;
      tmp2[i+1]--;
      tmp2[i+2]--;
      if(judgeTriple(tmp2,count+1))
	return true;
      tmp2[i]++;
      tmp2[i+1]++;
      tmp2[i+2]++;
    }
  }
  REP(i,10){
    if(tmp2[i]>=3){
      tmp2[i]-=3;
      if(judgeTriple(tmp2,count+1))
	return true;
      tmp2[i]+=3;
    }
  }
  return false;
}

bool isEnd(int tmp[]){
  REP(i,10){
    if(tmp[i]>=5)
      return false;
  }
  // remove head
  for(int i=1; i<10; i++){
    if(tmp[i]>=2){
      tmp[i]-=2;
      if( judgeTriple(tmp,0) )
	return true;
      tmp[i]+=2;
    }
  }
  return false;
}

int main()
{
  string str;
  while(cin>>str){
    int nums[10];
    memset(nums, 0, sizeof(nums));

    REP(i,str.size())
      nums[str[i]-'0']++;

    vector<int> res;

    for(int i=1; i<=9; i++){
      int tmp[10];
      memcpy(tmp, nums, sizeof(nums));
      tmp[i]++;

      if(isEnd(tmp)){
	res.push_back(i);
      }
    }

    if(res.empty())
      cout << "0" << endl;
    else{
      bool first=true;
      IREP(it,res){
	if(!first)
	  cout << " ";
	first = false;
	cout << *it;
      }
      cout << endl;
    }
  }

  return 0;
}

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

#include<cstring>
#include<vector>

using namespace std;

bool  slove(int tmp[])
{
  for(int i=1;i<10;i++)
    {
      while(tmp[i]!=0)
	{
	  if(tmp[i]>=3)
	    {
	      tmp[i]-=3;
//	      cout<<i<<":3set"<<endl;
	    }
	  else if(i<8&&tmp[i]>0&&tmp[i+1]>0&&tmp[i+2]>0)
	    {
	      tmp[i]--;
	      tmp[i+1]--;
	      tmp[i+2]--;
//	      cout<<i<<":3zyun"<<endl;
	    }
	  else
	    {
	      return false;
	    }
	}
    }
  return true;
}


int main()
{
  string str;
  for(;cin>>str;)
    {
      int data[10];
      memset(data,0,sizeof(data));
      for(int i=0;i<str.size();i++)
	{
	  data[str[i]-'0']++;
	}
      for(int i=0;i<10;i++)
	{
	}

      vector<int> ans;
      //      int tmp1[10];
      //      memcpy(tmp1, data, sizeof(data));
      for(int i=1;i<10;i++)
	{
	  if(data[i]>3)
	    continue;
//	  cout<<i<<":add"<<endl;
	  for(int j=1;j<10;j++)
	    {
	      int tmp[10];
	      memcpy(tmp, data, sizeof(tmp));
	      tmp[i]++;
	      if(tmp[j]>1)
		{
		  /*
		  for(int xx=1;xx<10;xx++)
		    for(int yy=tmp[xx];yy>0;yy--)
		      cout<<xx;		  
		  cout<<endl;
		  */
		  tmp[j]-=2;
	//	  cout<<j<<":head"<<endl;		  
		  if(slove(tmp))
		    {
		      ans.push_back(i);
		      j=10;
		    }		  
		}
	    }
	 	  
	}

       for(int i=0;i<ans.size();i++)
	    {
	      cout<<ans[i];
	      if(i==ans.size()-1)
		cout<<endl;
	      else
		cout<<" ";
	    }
if(ans.size()<1)
  cout<<0<<endl;      
       
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:3: error: 'string' was not declared in this scope
   36 |   string str;
      |   ^~~~~~
a.cc:3:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
    2 | #include<vector>
  +++ |+#include <string>
    3 | 
a.cc:37:8: error: 'cin' was not declared in this scope
   37 |   for(;cin>>str;)
      |        ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include<vector>
  +++ |+#include <iostream>
    3 | 
a.cc:37:13: error: 'str' was not declared in this scope; did you mean 'std'?
   37 |   for(;cin>>str;)
      |             ^~~
      |             std
a.cc:84:15: error: 'cout' was not declared in this scope
   84 |               cout<<ans[i];
      |               ^~~~
a.cc:84:15: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:86:23: error: 'endl' was not declared in this scope
   86 |                 cout<<endl;
      |                       ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    2 | #include<vector>
  +++ |+#include <ostream>
    3 | 
a.cc:91:3: error: 'cout' was not declared in this scope
   91 |   cout<<0<<endl;
      |   ^~~~
a.cc:91:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:91:12: error: 'endl' was not declared in this scope
   91 |   cout<<0<<endl;
      |            ^~~~
a.cc:91:12: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.mth.BigInteger;

class Main{
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null){
int a=Integer.parseInt(line);
BigInteger x=new BigInteger(a);
System.out.print(x.nextProbablePrime()+" "+prevProbablePrime(a));
}
}
private static int prevProbablePrime(int a){
a--;
while(true){
BigInteger y=new BigInteger(a);
if(y.isProbablePrime(16)){
return a;
}
a--;
}
}
}

Compiler output:
Main.java:4: error: package java.mth does not exist
import java.mth.BigInteger;
               ^
Main.java:12: error: cannot find symbol
BigInteger x=new BigInteger(a);
^
  symbol:   class BigInteger
  location: class Main
Main.java:12: error: cannot find symbol
BigInteger x=new BigInteger(a);
                 ^
  symbol:   class BigInteger
  location: class Main
Main.java:19: error: cannot find symbol
BigInteger y=new BigInteger(a);
^
  symbol:   class BigInteger
  location: class Main
Main.java:19: error: cannot find symbol
BigInteger y=new BigInteger(a);
                 ^
  symbol:   class BigInteger
  location: class Main
5 errors
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;

class Main{
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null){
int a=Integer.parseInt(line);
BigInteger x=new BigInteger(a);
System.out.print(x.nextProbablePrime()+" "+prevProbablePrime(a));
}
}
private static int prevProbablePrime(int a){
a--;
while(true){
BigInteger y=new BigInteger(a);
if(y.isProbablePrime(16)){
return a;
}
a--;
}
}
}

Compiler output:
Main.java:12: error: no suitable constructor found for BigInteger(int)
BigInteger x=new BigInteger(a);
             ^
    constructor BigInteger.BigInteger(byte[]) is not applicable
      (argument mismatch; int cannot be converted to byte[])
    constructor BigInteger.BigInteger(int[]) is not applicable
      (argument mismatch; int cannot be converted to int[])
    constructor BigInteger.BigInteger(String) is not applicable
      (argument mismatch; int cannot be converted to String)
    constructor BigInteger.BigInteger(long) is not applicable
      (BigInteger(long) has private access in BigInteger)
Main.java:19: error: no suitable constructor found for BigInteger(int)
BigInteger y=new BigInteger(a);
             ^
    constructor BigInteger.BigInteger(byte[]) is not applicable
      (argument mismatch; int cannot be converted to byte[])
    constructor BigInteger.BigInteger(int[]) is not applicable
      (argument mismatch; int cannot be converted to int[])
    constructor BigInteger.BigInteger(String) is not applicable
      (argument mismatch; int cannot be converted to String)
    constructor BigInteger.BigInteger(long) is not applicable
      (BigInteger(long) has private access in BigInteger)
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
2 errors
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;

class Main{
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null){
int a=Integer.parseInt(line);
BigInteger x=new BigInteger(a);
System.out.print(x.nextProbablePrime()+" "+prevProbablePrime(a));
}
}
public static int prevProbablePrime(int a){
a--;
while(true){
BigInteger y=new BigInteger(a);
if(y.isProbablePrime(16)){
return a;
}
a--;
}
}
}

Compiler output:
Main.java:12: error: no suitable constructor found for BigInteger(int)
BigInteger x=new BigInteger(a);
             ^
    constructor BigInteger.BigInteger(byte[]) is not applicable
      (argument mismatch; int cannot be converted to byte[])
    constructor BigInteger.BigInteger(int[]) is not applicable
      (argument mismatch; int cannot be converted to int[])
    constructor BigInteger.BigInteger(String) is not applicable
      (argument mismatch; int cannot be converted to String)
    constructor BigInteger.BigInteger(long) is not applicable
      (BigInteger(long) has private access in BigInteger)
Main.java:19: error: no suitable constructor found for BigInteger(int)
BigInteger y=new BigInteger(a);
             ^
    constructor BigInteger.BigInteger(byte[]) is not applicable
      (argument mismatch; int cannot be converted to byte[])
    constructor BigInteger.BigInteger(int[]) is not applicable
      (argument mismatch; int cannot be converted to int[])
    constructor BigInteger.BigInteger(String) is not applicable
      (argument mismatch; int cannot be converted to String)
    constructor BigInteger.BigInteger(long) is not applicable
      (BigInteger(long) has private access in BigInteger)
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
2 errors
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;

class Main{
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null){
int a=Integer.parseInt(line);
BigInteger x=new BigInteger(a);
System.out.println(x.nextProbablePrime()+" "+prevProbablePrime(a));
}
}
public static int prevProbablePrime(int a){
a--;
while(true){
BigInteger y=new BigInteger(a);
if(y.isProbablePrime(16)){
return a;
}
a--;
}
}
}

Compiler output:
Main.java:12: error: no suitable constructor found for BigInteger(int)
BigInteger x=new BigInteger(a);
             ^
    constructor BigInteger.BigInteger(byte[]) is not applicable
      (argument mismatch; int cannot be converted to byte[])
    constructor BigInteger.BigInteger(int[]) is not applicable
      (argument mismatch; int cannot be converted to int[])
    constructor BigInteger.BigInteger(String) is not applicable
      (argument mismatch; int cannot be converted to String)
    constructor BigInteger.BigInteger(long) is not applicable
      (BigInteger(long) has private access in BigInteger)
Main.java:19: error: no suitable constructor found for BigInteger(int)
BigInteger y=new BigInteger(a);
             ^
    constructor BigInteger.BigInteger(byte[]) is not applicable
      (argument mismatch; int cannot be converted to byte[])
    constructor BigInteger.BigInteger(int[]) is not applicable
      (argument mismatch; int cannot be converted to int[])
    constructor BigInteger.BigInteger(String) is not applicable
      (argument mismatch; int cannot be converted to String)
    constructor BigInteger.BigInteger(long) is not applicable
      (BigInteger(long) has private access in BigInteger)
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
2 errors
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;

class Main{
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null){
int a=Integer.parseInt(line);
BigInteger x=new BigInteger((long)a);
System.out.println(x.nextProbablePrime()+" "+prevProbablePrime(a));
}
}
public static int prevProbablePrime(int a){
a--;
while(true){
BigInteger y=new BigInteger((long)a);
if(y.isProbablePrime(16)){
return a;
}
a--;
}
}
}

Compiler output:
Main.java:12: error: no suitable constructor found for BigInteger(long)
BigInteger x=new BigInteger((long)a);
             ^
    constructor BigInteger.BigInteger(byte[]) is not applicable
      (argument mismatch; long cannot be converted to byte[])
    constructor BigInteger.BigInteger(int[]) is not applicable
      (argument mismatch; long cannot be converted to int[])
    constructor BigInteger.BigInteger(String) is not applicable
      (argument mismatch; long cannot be converted to String)
    constructor BigInteger.BigInteger(long) is not applicable
      (BigInteger(long) has private access in BigInteger)
Main.java:19: error: no suitable constructor found for BigInteger(long)
BigInteger y=new BigInteger((long)a);
             ^
    constructor BigInteger.BigInteger(byte[]) is not applicable
      (argument mismatch; long cannot be converted to byte[])
    constructor BigInteger.BigInteger(int[]) is not applicable
      (argument mismatch; long cannot be converted to int[])
    constructor BigInteger.BigInteger(String) is not applicable
      (argument mismatch; long cannot be converted to String)
    constructor BigInteger.BigInteger(long) is not applicable
      (BigInteger(long) has private access in BigInteger)
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
2 errors
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;

class Main{
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null){
int a=Integer.parseInt(line);
BigInteger x=BigInteger.valueOf(a);
System.out.println(prevProbablePrime(a)+" "+x.nextProbablePrime());
}
}
public static int prevProbablePrime(int a){
a--;
while(true){
BigInteger y=BigInteger.valueOf(a);
if(y.isProbablePrime()){
return a;
}
a--;
}
}
}

Compiler output:
Main.java:20: error: method isProbablePrime in class BigInteger cannot be applied to given types;
if(y.isProbablePrime()){
    ^
  required: int
  found:    no arguments
  reason: actual and formal argument lists differ in length
1 error
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;

class Main{
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null){
int a=Integer.parseInt(line);
BigInteger x=BigInteger.valueOf(a);
System.out.println(prevProbablePrime(a)+" "+x.nextProbablePrime());
}
}
public static int prevProbablePrime(int a){
BigInteger y=BigInteger.valueOf(a);
y=y.subtract(BigInteger.valueOf("1"));
while(true){
if(y.isProbablePrime(1)){
return a;
}
y=y.subtract(BigInteger.valueOf("1"));
}
}
}

Compiler output:
Main.java:18: error: no suitable method found for valueOf(String)
y=y.subtract(BigInteger.valueOf("1"));
                       ^
    method BigInteger.valueOf(long) is not applicable
      (argument mismatch; String cannot be converted to long)
    method BigInteger.valueOf(int[]) is not applicable
      (argument mismatch; String cannot be converted to int[])
Main.java:23: error: no suitable method found for valueOf(String)
y=y.subtract(BigInteger.valueOf("1"));
                       ^
    method BigInteger.valueOf(long) is not applicable
      (argument mismatch; String cannot be converted to long)
    method BigInteger.valueOf(int[]) is not applicable
      (argument mismatch; String cannot be converted to int[])
2 errors