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

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

using namespace std;

int main() {

  int n;
  bool f[55][35];

  while(1){

    memset(f, false, sizeof(f));

    cin>>n;
    if(n == 0) break;

    for(int i=0; i<n; i++){
      int t;
      cin>>t;
      if(t == 0) break;
      for(int j=0; j<t; j++){
        int tt;
        cin>>tt;
        f[i][tt] = true;
      }
    }

    set<int> s[55];
    for(int i=0; i<50; i++){
      s[i].insert(i);
    }
    int ans = 1;

    for(int day = 1; day <= 30; day++){
      set<int> v;
      for(int mem = 0; mem < n; mem++){
        if(f[mem][day]){
          set<int>::iterator it = s[mem].begin();
          while(it != s[mem].end()){
            v.insert((*it));
            it++;
          }
        }
      }

      for(int mem = 0; mem < n; mem++){
        if(f[mem][day]){
          s[mem] = v;
        }
      }
      bool flag = false;
      for(int mem = 0; mem < n; mem++){
        if(s[mem].size() == n) flag = true;
      }
      if(flag) break;
      ans++;
    }

    if(ans == 31) cout<<-1<<endl;
    else cout<<ans<<endl;

  }

  return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int,int> pint;
typedef vector<pint> vpint;
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=n-1;i>=(0);i--)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
#define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
#define all(v) (v).begin(),(v).end()
#define eall(v) unique(all(v), v.end())
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))
const int MOD = 1e9 + 7;
const int INF = 1e9;
const ll INFF = 1e18;

class DisjointSet{
public:
	vector<int> rank, p;//rank:??¨????????? p:??????????????????
	DisjointSet(){}
	DisjointSet(int size){//???????????°
		rank.resize(size, 0);
		p.resize(size, 0);
		rep(i, size) makeSet(i);
	}
	bool same(int x, int y){ //????????¨????????????
		return findSet(x) == findSet(y);
	}
	void unite(int x, int y){ // ??¨?????????????????£?????????
		link(findSet(x), findSet(y));
	}
private:
	void makeSet(int x){
		p[x] = x;
		rank[x] = 0;
	}
	int findSet(int x){ //????????¢????????????????????§???
		if(x != p[x]){
			p[x] = findSet(p[x]);A
		}
		return p[x];
	}
	void link(int x, int y){ //??¨??????????????????????????¨?????????????????£?????????
		if(rank[x] > rank[y]){
			p[y] = x;
		}else{
			p[x] = y;
			if(rank[x] == rank[y]) rank[y]++;
		}
	}
};

int main(void){
	while(1){
		int n; cin >> n;
		if(n == 0) break;
		vector<vector<int>> v(31); // v[i] := i??\??????????????????
		rep(i, n){
			int f; cin >> f;
			rep(j, f){
				int d; cin >> d;
				v[d].pb(i);
			}
		}

		DisjointSet uf(n);
		reps(i, 1, 31){
			for(auto s : v[i])for(auto t : v[i]){
				uf.unite(s, t);
			}
			bool flag = true;
			rep(i, n)reps(j, i + 1, n){
				if(!uf.same(i, j)){
					flag = false; break;
				}
				if(!flag) break;
			}
			if(flag){
				printf("%d\n", i); break;
			}
			if(i == 30){
				printf("-1\n"); break;
			}
		}
	}
	return 0;
}

Compiler output:
a.cc: In member function 'int DisjointSet::findSet(int)':
a.cc:45:46: error: 'A' was not declared in this scope
   45 |                         p[x] = findSet(p[x]);A
      |                                              ^
Language: C++

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

int main() {
	int n;
	while(cin >> n, n) {
		vector<vector<int> > v(n);
		for(int i = 0; i < n; i++) {
			int f; cin >> f;
			v[i].resize(f);
			for(int j = 0; j < f; j++) {
				cin >> v[i][j];
			}
			sort(v[i].rbegin(), v[i].rend());
		}
		vector<int> met(n);
		for(int i = 0; i < n; i++) met[i] = 1 << i;
		int res = -1;
		for(int t = 0; t <= 30; t++) {
			int a = 0, b = 0;
			for(int i = 0; i < n; i++) {
				while(v[i].size() && v[i].back() <= t) {
					v[i].pop_back();
					b |= (1 << i);
					a |= met[i];
				}
			}
			for(int i = 0; i < n; i++) {
				if(b & (1 << i)) met[i] |= a;
				if(met[i] == (1 << n) - 1) {
					res = t;
				}
			}
			if(res >= 0) break;
		}
		cout << res << endl;
	}
}

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

#include <iostream>

constexpr int NUM_OF_DAYS = 30;
bool dp[50][50] = { {false} }; //??°???????????????????????????????????? [???][??°???] = hasMap
bool isFree[50][31] = { {false} };

int main() {
	int n;
	while (std::cin >> n && n) {
		std::memset(dp, false, 50*50);
		std::memset(isFree, false, 50*31);
		for (int i = 0; i < n; i++) {
			int f;
			std::cin >> f;
			//100%???????????????
			if (!f) {
				std::cout << -1 << std::endl;
				return 0;
			}
			for (int j = 0; j < f; j++) {
				int day;
				std::cin >> day;
				isFree[i][day] = true;
			}
		}
		for (int i = 0; i < n; i++) {
			dp[i][i] = true;
		}

		bool isOk[50] = { false };
		for (int i = 1; i < NUM_OF_DAYS; i++) {
			//????????????????????????????????¢???
			for (int j = 0; j < n; j++) {
				isOk[j] = isFree[j][i];
			}

			//???????????????????????????????????§?????°????????????
			for (int j = 0; j < n; j++) { //???
				if (!isFree[j][i]) continue; //???????????????????????????????????????
				for (int k = 0; k < n; k++) { //??°????????? ???
					if (isOk[k]) {
						for (int l = 0; l < n; l++) { //??°???
							dp[j][l] = dp[j][l] || dp[k][l];
						}
					}
				}
			}

			//????????£???????????????
			for (int j = 0; j < n; j++) {
				bool isGather = true;
				for (int k = 0; k < n; k++) {
					isGather = isGather && dp[j][k];
				}
				if (isGather) {
					std::cout << i << std::endl;
					return 0;
				}
			}
		}
		std::cout << -1 << std::endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:22: error: 'memset' is not a member of 'std'; did you mean 'wmemset'?
   10 |                 std::memset(dp, false, 50*50);
      |                      ^~~~~~
      |                      wmemset
a.cc:11:22: error: 'memset' is not a member of 'std'; did you mean 'wmemset'?
   11 |                 std::memset(isFree, false, 50*31);
      |                      ^~~~~~
      |                      wmemset
Language: C++

#include<iostream>
#include<algorithm>
#include<stack>
#include<queue>
#include<string>
#include<functional>
#include<set>
using namespace std;

#define INF 1<<21
#define DIV 1000000007
#define MAX 100005


int main(){
  int n;
  while (cin >> n,n) {
	int meet[55][35];
	int have[55][55];
	memset(meet, 0, sizeof(meet));
	memset(have, 0, sizeof(have));
	for (int i = 1; i <= n; i++) {
	  int f;
	  cin >> f;
	  int m;
	  for (int j = 0; j < f; j++) {
		cin >> m;
		meet[i][m] = 1;
	  }
	}
	for (int i = 1; i <= n; i++) {
	  have[i][i] = 1;
	}
	int flag = 0;
	for (int t = 1; t <= 30; t++) {
	  set<int> S;
	  for (int i = 1; i <= n; i++) {
		if (!meet[i][t])continue;

		for (int j = 1; j <= n; j++) {
		  if (have[i][j])S.insert(j);
		}
	  }

	  for (int i = 1; i <= n; i++) {
		if (!meet[i][t])continue;

		for (auto s = S.begin(); s != S.end(); s++) {
		  have[i][*s] = 1;
		}
	  }

	  if (S.size() == n) {
		cout << t << endl;
		break;
	  }
	  if (S.size() < n&&t == 30)flag = 1;
	}
	if (flag)cout << -1 << endl;
  }
}

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

#include<bits/stdc++.h>

#define INF 1e9
#define llINF 1e18
#define MOD 1e9+7
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long
using namespace std;
int main(){
  int n;
  while(cin>>n,n){
    vector<vector<int> >vvi(n+100);
    for(int i=0;i<n;i++){
      int a;cin>>a;
      for(int j=0;j<a;j++){
	int b;cin>>b;
	vvi[b-1].pb(i);
      }
    }
    bool flag[500][500]={};
    int num=-1;
    UF uni(n+100);
    for(int i=0;i<30;i++){
      if(num>0)break;
      for(int j=0;j<vvi[i].size();j++){
	for(int k=0;k<vvi[i].size();k++){
	  flag[vvi[i][j]][vvi[i][k]]=true;
	}
      }
      for(int j=0;j<500;j++){
	int cnt=0;
	for(int k=0;k<500;k++){
	  if(flag[j][k])
	    cnt++;
	}
	if(cnt==n)num=i+1;
      }
    }
    cout<<num<<endl;
  }
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:25:5: error: 'UF' was not declared in this scope; did you mean 'F'?
   25 |     UF uni(n+100);
      |     ^~
      |     F
Language: C++

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

int main(){
    int n;
    while(cin>>n&&n!=0){
        set<int> schedules[101];
        for(int i = 0; i < n; i++){
            int t;
            cin>>t;
            for(int j = 0; j < t; j++){
                int p;
                cin>>p;
                schedules[i].insert(p);
            }
        }
        // ツつサツづェツつシツづェツつェツつ「ツづ慊づづ個地ツ図ツづーツ篠敖づづつ「ツづゥツつゥ
        bool m[51][51];
        memset(m,0,sizeof(m));
        for(int i = 0; i < n; i++)
            m[i][i]=true;
        int idx=31;
        for(int i = 1; i <= 30; i++){
            vector<int> v;
            set<int> s;
            for(int j = 0; j < n; j++){
                if(schedules[j].find(i)!=schedules[j].end()){
                    v.push_back(j);
                    for(int k = 0; k < n; k++){
                        if(m[j][k])
                            s.insert(k);
                    }
                }
            }
            if(s.size()==n){
                idx=i;
                break;
            }
            for(set<int>::iterator it = s.begin(); it!=s.end(); it++)
                for(int j = 0; j < n; j++)
                    m[j][*it]=true;
        }
        if(idx==31)
            cout<<-1<<endl;
        else
            cout<<idx<<endl;
    }

    return 0;
}

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

/**
 *  Gather the Maps! (Problem F, Practice Contest for Japan Domestic, 2005-06-19)
 *  by Kenji Inoue, 2007-01-04
 **/

#include <iostream>
#include <set>

using namespace std;

int main() {
  int d[51][31]; // available dates
  int m[51][51]; // maps collected

  int n;
  while (cin >> n, n) {
    memset(d, 0, sizeof(d));
    memset(m, 0, sizeof(m));

    for (int i=0; i<n; i++) {
      int num;
      cin >> num;
      for (int j=0; j<num; j++) {
        int t;
        cin >> t;
        d[i][t] = 1;
      }
      m[i][i] = 1; // he only has his own map
    }

    for (int t=1; t<=30; t++) {
      // find which maps can be collected
      set<int> maps;
      for (int i=0; i<n; i++) {
        if (!d[i][t]) { continue; }

        for (int j=0; j<n; j++) {
          if (m[i][j]) { maps.insert(j); }
        }
      }

      // merge
      for (int i=0; i<n; i++) {
        if (!d[i][t]) { continue; }

        for (set<int>::iterator it = maps.begin(); it != maps.end(); it++) {
          m[i][*it] = 1;
        }
      }

      // check if all gathered
      if (maps.size() == n) {
        cout << t << endl;
        goto NEXT;
      }
    }

    cout << -1 << endl;
  NEXT: ;
  }

  return 0;
}

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

#include <algorithm>
#include <vector>

using namespace std;

int main( void )
{
	long long OK;
	bool T[50][30];
	vector<int> V[30];
	long long A[50];
	int n;
	while(cin >> n, n) {
		OK = 1;
		OK = (OK << n) - 1;
		fill(A, A+50, 1);
		for(int i=0; i < 30; ++i) V[i].clear();
		for(int i=0; i < n; ++i) {
			A[i] = A[i] << i;
			//cout << A[i] << endl;
			fill(T[i], T[i]+30, false);
			int f; cin >> f;
			for(int j=0; j < f; ++j) {
				int d; cin >> d;
				T[i][d-1] = true;
				V[d-1].push_back(i);
			}
		}
		//cout << OK << endl;
		int ans = -1;
		for(int i=0; i < 30; ++i) {
			long long check = 0;
			for(int j=0; j < n; ++j) {
				if(T[j][i]) {
					for(int k=0; k < V[i].size(); ++k) {
						//A[j] |= (1 << V[i][k]);
						A[j] |= A[V[i][k]];
					}
					check |= A[j];
				}
			}
			//cout << check << endl;
			if(check == OK) {
				ans = i + 1;
				break;
			}
		}
		cout << ans << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:15: error: 'cin' was not declared in this scope
   13 |         while(cin >> n, n) {
      |               ^~~
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:48:17: error: 'cout' was not declared in this scope
   48 |                 cout << ans << endl;
      |                 ^~~~
a.cc:48:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:48:32: error: 'endl' was not declared in this scope
   48 |                 cout << ans << 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 |
Language: C++

#include<stdio.h>
#include<set>
#include<vector>
using namespace std;
vector<int> sc[30];
set<int> p[50];
set<int> t;
int main(){
	int n;
	int i,j;
	while(1){
	scanf("%d",&n);
	if(n==0)return 0;
	for(i=0;i<30;i++)sc[i].clear();
	for(i=0;i<n;i++)p[i].clear();
	for(i=0;i<n;i++){
		int k;
		scanf("%d",&k);
		for(j=0;j<k;j++){
			int x;
			scanf("%d",&x);
			sc[x-1].push_back(i);
		}
	}
	int k;
	for(i=0;i<30;i++){
		t.clear();
		for(j=0;j<sc[i].size();j++){
			for(k=0;k<sc[i].size();k++){
				p[sc[i][j]].insert(sc[i][k]);
			}
		}
		for(j=0;j<n;j++){
			set<int>::iterator it;
			for(it=p[j].begin();it!=p[j].end();++it)t.insert(*it);
		}
		if(t.size()==n)break;
	}
	printf("%d\n",i+1);
}

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

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


#define reps(i,f,n) for(int i = f; i < int(n); i++)
#define rep(i,n) reps(i,0,n)
typedef __int64 ll;

using namespace std;

int main(void){
	
	int n;

	while(scanf("%d", &n), n){
		ll p[60]={0};
		bool ans = false;
		vector<int> x[50];
		
		rep(i,60)
			p[i] = (ll)(1)<<i;
		
		rep(i,n){
			int m;
			scanf("%d", &m);
			rep(j,m){
				int t;
				scanf("%d", &t);
				x[t].push_back(i);
			}
		}
		
		reps(i,1,31){
			ll b = 0;
			rep(j,x[i].size())
				b |= p[x[i][j]];
			rep(j, x[i].size())
				p[x[i][j]] = b;
				
			if(b == ((ll)1<<n)-1){
				ans = true;
				printf("%d\n", i);
				break;
			}
		}
		if(!ans){
			puts("-1");
		}
	}
	return 0;
}

Compiler output:
a.cc:17:9: error: '__int64' does not name a type; did you mean '__int64_t'?
   17 | typedef __int64 ll;
      |         ^~~~~~~
      |         __int64_t
a.cc: In function 'int main()':
a.cc:26:17: error: 'll' was not declared in this scope
   26 |                 ll p[60]={0};
      |                 ^~
a.cc:31:25: error: 'p' was not declared in this scope
   31 |                         p[i] = (ll)(1)<<i;
      |                         ^
a.cc:44:27: error: expected ';' before 'b'
   44 |                         ll b = 0;
      |                           ^~
      |                           ;
a.cc:46:33: error: 'b' was not declared in this scope
   46 |                                 b |= p[x[i][j]];
      |                                 ^
a.cc:46:38: error: 'p' was not declared in this scope
   46 |                                 b |= p[x[i][j]];
      |                                      ^
a.cc:48:33: error: 'p' was not declared in this scope
   48 |                                 p[x[i][j]] = b;
      |                                 ^
a.cc:48:46: error: 'b' was not declared in this scope
   48 |                                 p[x[i][j]] = b;
      |                                              ^
a.cc:50:28: error: 'b' was not declared in this scope
   50 |                         if(b == ((ll)1<<n)-1){
      |                            ^
a.cc:50:38: error: expected ')' before numeric constant
   50 |                         if(b == ((ll)1<<n)-1){
      |                                 ~    ^
      |                                      )
a.cc:54:26: error: expected ')' before '}' token
   54 |                         }
      |                          ^
      |                          )
   55 |                 }
      |                 ~         
a.cc:50:27: note: to match this '('
   50 |                         if(b == ((ll)1<<n)-1){
      |                           ^
a.cc:55:17: error: expected primary-expression before '}' token
   55 |                 }
      |                 ^
Language: C++

import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (true) {
			int n = sc.nextInt();
			if (n == 0)
				break;
			boolean[][] canMeet = new boolean[30][n];
			for (int i = 0; i < 30; i++)
				for (int j = 0; j < n; j++)
					canMeet[i][j] = false;
			for (int i = 0; i < n; i++) {
				int t = sc.nextInt();
				for (int j = 0; j < t; j++) {
					canMeet[sc.nextInt() - 1][i] = true;
				}
			}
			boolean[][] hasMaps = new boolean[n][n];
			for (int i = 0; i < n; i++)
				for (int j = 0; j < n; j++)
					hasMaps[i][j] = false;
			for (int i = 0; i < n; i++)
				hasMaps[i][i] = true;
			int result = -1;
			for (int t = 0; t < 30; t++) {
				ArrayList<Integer> meetList = new ArrayList<Integer>();
				for (int i = 0; i < n; i++) {
					if (canMeet[t][i]) {
						meetList.add(i);
					}
				}
				Set<Integer> mapsSet = new HashSet<Integer>();
				for (Integer i : meetList) {
					for (int j = 0; j < n; j++) {
						if (hasMaps[i][j]) {
							mapsSet.add(j);
						}
					}
				}
				for (Integer i : meetList)
					for (Integer j : mapsSet) {
						hasMaps[i][j] = true;
					}
				if (mapsSet.size() == n) {
					result = t;
					break;
				}
			}
			System.out.println(result);
		}
		sc.close();
	}
}

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

#include <iostream>
#include <vector>
#include <cstring>

using namespace std;

#define MAX 50

int N, day;
bool ok[MAX][31];
bool G[MAX][MAX];
bool visited[MAX];

void init(){
  day = 0;
  memset(ok, false, sizeof(ok));
  memset(G, false, sizeof(G));
}

void rec(int now){
  for(int i = 0 ; i < N ; i++){
    if(!visited[i] && G[now][i]){
      visited[i] = true;
      rec(i);
    }
  }
}

bool check(){
  for(int i = 0 ; i < N ; i++){
    memset(visited, false, sizeof(visited));
    visited[i] = true;
    rec(i);
    if(count(visited, visited+N, true) == N){
      return true;
    }
  }
  return false;
}

int solve(){
  int ans = -1;
  for(int i = 0 ; i < day ; i++){
    for(int j = 0 ; j < N-1 ; j++){
      if(!ok[j][i]) continue;
      for(int k = j+1 ; k < N ; k++){
        if(ok[k][i]){
          G[j][k] = G[k][j] = true;
        }
      }
    }
    if(check()){
      ans = i+1;
      break;
    }
  }
  return ans;
}

int main(){
  int K, in;
  while(cin >> N && N){
    init();
    for(int i = 0 ; i < N ; i++){
      cin >> K;
      for(int j = 0 ; j < K ; j++){
        cin >> in;
        ok[i][in-1] = true;
        day = max(day, in);
      }
    }
    cout << solve() << endl;
  }

  return 0;
}

Compiler output:
a.cc: In function 'bool check()':
a.cc:34:8: error: 'count' was not declared in this scope
   34 |     if(count(visited, visited+N, true) == N){
      |        ^~~~~
Language: Java

public class Main {

	public static void main(String[] args) {
		// インプットデータ取得
		Scanner sc = new Scanner(System.in);

        while(true) {
        	double m=sc.nextDouble();
        	if(m==0) {break;}
        	double x_double=0;
        	double y_double=0;
        	double z_double=0;
        	
        	//mの三乗根に一番近い整数値をzに入れたい
        	z_double=Math.cbrt(m);
        	System.out.println(z_double);

        }

	}

}



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: C

#include <stdio.h>

int main(){
int e,x,y,z,s;
s=1000000
scanf("%d",&e);
if (e!=0) {
for (z=0;z<=100;z++) {
for (y=0;y<=1000;y++) {
x=e-z*z*z-y*y;
if (x+y+z<s) {s=x+y+z;}
}
}
scanf("%d",&e);
}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:10: error: expected ';' before 'scanf'
    5 | s=1000000
      |          ^
      |          ;
    6 | scanf("%d",&e);
      | ~~~~~
Language: C

#include <stdio.h>

int main(){
int e,x,y,z,m;
s=1000000;
scanf("%d",&e);
if (e!=0) {
for (z=0;z<=100;z++) {
for (y=0;y<=1000;y++) {
x=e-z*z*z-y*y;
if (x+y+z<m) {m=x+y+z;}
}
}
printf("%d\n",m);
scanf("%d",&e);
}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:1: error: 's' undeclared (first use in this function)
    5 | s=1000000;
      | ^
main.c:5:1: note: each undeclared identifier is reported only once for each function it appears in
Language: C

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

//Space Crab

/* Minimize x + y + z
   Subject to x + y^2 + z^3 = E
   Input is E
*/

int solve(int E) {
  int ans = INT_MAX;
  for (int x = 0; x<=E; x++) {
    for (int y = 0; y*y<=E; y++) {
      int z = cbrt(E - x - y * y);
      if (!(x + y * y + z * z * z == E)) continue;
      if (x + y + z < ans) ans = (x + y + z);
    }
  }
  return ans;
}
	
int main(int argc, char *argv[])
{
  int d;
  while (fscanf(stdin, "%d", &d)) {
  int ans = solve(d);
  printf("%d\n",ans);
    }
  return 0;
}

Compiler output:
/usr/bin/ld: /tmp/ccrJHoH9.o: in function `solve':
main.c:(.text+0x4a): undefined reference to `cbrt'
collect2: error: ld returned 1 exit status
Language: C

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

int solve(int E) {
  int ans = INT_MAX;
  for (int x = 0; x<=E; x++) {
    for (int y = 0; y*y<=E; y++) {
      int z = cbrt(E - x - y * y);
      if (!(x + y * y + z * z * z == E)) continue;
      if (x + y + z < ans) ans = (x + y + z);
    }
  }
  return ans;
}
	
int main(int argc, char *argv[])
{
  int d;
  while (fscanf(stdin, "%d", &d)) {
  int ans = solve(d);
  printf("%d\n",ans);
    }
  return 0;
}

Compiler output:
/usr/bin/ld: /tmp/ccjr1uKb.o: in function `solve':
main.c:(.text+0x4a): undefined reference to `cbrt'
collect2: error: ld returned 1 exit status
Language: C

#include <stdio.h>

int main(void)
{
	int x,y,z,m,e;
	while(1){
	scanf("%d",&e);
	if(e==0){
		break;
	}
	m=e;
	for(z=0;z*z*z*<=e;z++){
		for(y-0;y*y+z*z*z<=e;y++){
			x=e-z*z*z-y*y;
			if(m>x+y+z){
				m=x+y+z;
			}
		}
	}
	printf("%d\n",m);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:23: error: expected expression before '<=' token
   12 |         for(z=0;z*z*z*<=e;z++){
      |                       ^~
Language: C

#define rep(i,a) for(int i=0;i<a;i++) 
n;
main(){
	while(scanf("%d",&n),n){
		int mi=999;
		rep(i,110)rep(j,1010)mi=min(mi,(n<i*i*i+j*j?inf:i+j+n-i*i*i-j*j));
		cout<<mi<<endl;
	}
}

Compiler output:
main.c:2:1: warning: data definition has no type or storage class
    2 | n;
      | ^
main.c:2:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main(){
      | ^~~~
main.c: In function 'main':
main.c:4:15: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    4 |         while(scanf("%d",&n),n){
      |               ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | #define rep(i,a) for(int i=0;i<a;i++)
main.c:4:15: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 |         while(scanf("%d",&n),n){
      |               ^~~~~
main.c:4:15: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:6:41: error: implicit declaration of function 'min'; did you mean 'main'? [-Wimplicit-function-declaration]
    6 |                 rep(i,110)rep(j,1010)mi=min(mi,(n<i*i*i+j*j?inf:i+j+n-i*i*i-j*j));
      |                                         ^~~
      |                                         main
main.c:6:61: error: 'inf' undeclared (first use in this function); did you mean 'int'?
    6 |                 rep(i,110)rep(j,1010)mi=min(mi,(n<i*i*i+j*j?inf:i+j+n-i*i*i-j*j));
      |                                                             ^~~
      |                                                             int
main.c:6:61: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:17: error: 'cout' undeclared (first use in this function)
    7 |                 cout<<mi<<endl;
      |                 ^~~~
main.c:7:27: error: 'endl' undeclared (first use in this function)
    7 |                 cout<<mi<<endl;
      |                           ^~~~
Language: C

#define rep(i,a) for(int i=0;i<a;i++) 
n;
main(){
	while(scanf("%d",&n),n){
		int mi=999;
		rep(i,110)rep(j,1010)mi=min(mi,(n<i*i*i+j*j?inf:i+j+n-i*i*i-j*j));
		printf("%d\n",mi);
	}
}

Compiler output:
main.c:2:1: warning: data definition has no type or storage class
    2 | n;
      | ^
main.c:2:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main(){
      | ^~~~
main.c: In function 'main':
main.c:4:15: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    4 |         while(scanf("%d",&n),n){
      |               ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | #define rep(i,a) for(int i=0;i<a;i++)
main.c:4:15: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 |         while(scanf("%d",&n),n){
      |               ^~~~~
main.c:4:15: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:6:41: error: implicit declaration of function 'min'; did you mean 'main'? [-Wimplicit-function-declaration]
    6 |                 rep(i,110)rep(j,1010)mi=min(mi,(n<i*i*i+j*j?inf:i+j+n-i*i*i-j*j));
      |                                         ^~~
      |                                         main
main.c:6:61: error: 'inf' undeclared (first use in this function); did you mean 'int'?
    6 |                 rep(i,110)rep(j,1010)mi=min(mi,(n<i*i*i+j*j?inf:i+j+n-i*i*i-j*j));
      |                                                             ^~~
      |                                                             int
main.c:6:61: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:17: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    7 |                 printf("%d\n",mi);
      |                 ^~~~~~
main.c:7:17: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:7:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:7:17: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

n,i;
#define rep(i,a) for(i=0;i<a;i++) 
main(){
	while(scanf("%d",&n),n){
		int mi=999;
		rep(i,110)rep(j,1010)mi=min(mi,(n<i*i*i+j*j?999:i+j+n-i*i*i-j*j));
		printf("%d\n",mi);
	}
}

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | n,i;
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int]
    1 | n,i;
      |   ^
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main(){
      | ^~~~
main.c: In function 'main':
main.c:4:15: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    4 |         while(scanf("%d",&n),n){
      |               ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | n,i;
main.c:4:15: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 |         while(scanf("%d",&n),n){
      |               ^~~~~
main.c:4:15: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:6:31: error: 'j' undeclared (first use in this function)
    6 |                 rep(i,110)rep(j,1010)mi=min(mi,(n<i*i*i+j*j?999:i+j+n-i*i*i-j*j));
      |                               ^
main.c:2:22: note: in definition of macro 'rep'
    2 | #define rep(i,a) for(i=0;i<a;i++)
      |                      ^
main.c:6:31: note: each undeclared identifier is reported only once for each function it appears in
    6 |                 rep(i,110)rep(j,1010)mi=min(mi,(n<i*i*i+j*j?999:i+j+n-i*i*i-j*j));
      |                               ^
main.c:2:22: note: in definition of macro 'rep'
    2 | #define rep(i,a) for(i=0;i<a;i++)
      |                      ^
main.c:6:41: error: implicit declaration of function 'min'; did you mean 'main'? [-Wimplicit-function-declaration]
    6 |                 rep(i,110)rep(j,1010)mi=min(mi,(n<i*i*i+j*j?999:i+j+n-i*i*i-j*j));
      |                                         ^~~
      |                                         main
main.c:7:17: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    7 |                 printf("%d\n",mi);
      |                 ^~~~~~
main.c:7:17: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:7:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:7:17: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

n,i,j;
#define rep(i,a) for(i=0;i<a;i++) 
main(){
	while(scanf("%d",&n),n){
		int mi=999;
		rep(i,110)rep(j,1010)mi=min(mi,(n<i*i*i+j*j?999:i+j+n-i*i*i-j*j));
		printf("%d\n",mi);
	}
}

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | n,i,j;
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int]
    1 | n,i,j;
      |   ^
main.c:1:5: error: type defaults to 'int' in declaration of 'j' [-Wimplicit-int]
    1 | n,i,j;
      |     ^
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main(){
      | ^~~~
main.c: In function 'main':
main.c:4:15: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    4 |         while(scanf("%d",&n),n){
      |               ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | n,i,j;
main.c:4:15: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 |         while(scanf("%d",&n),n){
      |               ^~~~~
main.c:4:15: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:6:41: error: implicit declaration of function 'min'; did you mean 'main'? [-Wimplicit-function-declaration]
    6 |                 rep(i,110)rep(j,1010)mi=min(mi,(n<i*i*i+j*j?999:i+j+n-i*i*i-j*j));
      |                                         ^~~
      |                                         main
main.c:7:17: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    7 |                 printf("%d\n",mi);
      |                 ^~~~~~
main.c:7:17: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:7:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:7:17: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include <stdio.h>
#define min(a, b) ((a < b) ? a : b)

int main() {
    int x, y, z, e, ans;

    while (cin >> e) {
        if (!e) { break; }
        ans = e;

        for (z = 0; z*z*z <= e; z++) {
            for (y = 0; y*y + z*z*z <= e; y++) {
                x = e - y*y - z*z*z;
                ans = min(ans, x+y+z);
            }
        }
        printf("%d\n", ans);
    }
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:7:12: error: 'cin' undeclared (first use in this function); did you mean 'min'?
    7 |     while (cin >> e) {
      |            ^~~
      |            min
main.c:7:12: note: each undeclared identifier is reported only once for each function it appears in
Language: C

y,m,z,e;main(k){
	for(;m=1e7,scanf("%d",&e),e;printf("%d\n",m))
		for(z=0;(k=z*z*z)<=e;z++)
			y=sqrt(e-k);
			k=y+z+e-y*y-k;
			if(m>k)m=k;
		}
	}
}

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | y,m,z,e;main(k){
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'y' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'int' in declaration of 'm' [-Wimplicit-int]
    1 | y,m,z,e;main(k){
      |   ^
main.c:1:5: error: type defaults to 'int' in declaration of 'z' [-Wimplicit-int]
    1 | y,m,z,e;main(k){
      |     ^
main.c:1:7: error: type defaults to 'int' in declaration of 'e' [-Wimplicit-int]
    1 | y,m,z,e;main(k){
      |       ^
main.c:1:9: error: return type defaults to 'int' [-Wimplicit-int]
    1 | y,m,z,e;main(k){
      |         ^~~~
main.c: In function 'main':
main.c:1:9: error: type of 'k' defaults to 'int' [-Wimplicit-int]
main.c:2:20: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    2 |         for(;m=1e7,scanf("%d",&e),e;printf("%d\n",m))
      |                    ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | y,m,z,e;main(k){
main.c:2:20: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    2 |         for(;m=1e7,scanf("%d",&e),e;printf("%d\n",m))
      |                    ^~~~~
main.c:2:20: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:2:37: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    2 |         for(;m=1e7,scanf("%d",&e),e;printf("%d\n",m))
      |                                     ^~~~~~
main.c:2:37: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:2:37: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:2:37: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:4:27: error: implicit declaration of function 'sqrt' [-Wimplicit-function-declaration]
    4 |                         y=sqrt(e-k);
      |                           ^~~~
main.c:1:1: note: include '<math.h>' or provide a declaration of 'sqrt'
  +++ |+#include <math.h>
    1 | y,m,z,e;main(k){
main.c:4:27: warning: incompatible implicit declaration of built-in function 'sqrt' [-Wbuiltin-declaration-mismatch]
    4 |                         y=sqrt(e-k);
      |                           ^~~~
main.c:4:27: note: include '<math.h>' or provide a declaration of 'sqrt'
main.c: At top level:
main.c:8:9: error: expected identifier or '(' before '}' token
    8 |         }
      |         ^
main.c:9:1: error: expected identifier or '(' before '}' token
    9 | }
      | ^
Language: C

#include <stdio.h>

int power( int, int );

int main( void ) {
	int i, power2[ 1001 ], power3[ 101 ], e, ee, x, y, z, min;

	for ( i = 0; i < 1001; i++ )
		power2[ i ] = power( i, 2 );
	for ( i = 0; i < 101; i++ )
		power3[ i ] = power( i, 3 );

	while ( scanf( "%d", &e ), e ) {
		min = e;
		for ( z = 0; power[ z ] <= e; z++ ) {
			ee = e - power[ z ];

			for ( y = 0; power[ y ] <= ee; y++ ) {
				x = ee - power[ y ];

				if ( x + y + z < min )
					min = x + y + z;
			}
		}

		printf( "%d\n", min );
	}

	return 0;
}

int power( int x, int n ) {
	int tmp = 1;

	while( n-- )
		tmp *= x;

	return tmp;
}

Compiler output:
main.c: In function 'main':
main.c:15:35: error: subscripted value is neither array nor pointer nor vector
   15 |                 for ( z = 0; power[ z ] <= e; z++ ) {
      |                                   ^
main.c:16:39: error: subscripted value is neither array nor pointer nor vector
   16 |                         ee = e - power[ z ];
      |                                       ^
main.c:18:43: error: subscripted value is neither array nor pointer nor vector
   18 |                         for ( y = 0; power[ y ] <= ee; y++ ) {
      |                                           ^
main.c:19:47: error: subscripted value is neither array nor pointer nor vector
   19 |                                 x = ee - power[ y ];
      |                                               ^
Language: C

#include <stdio.h>

int main( void ) {
	int i, e, ee, x, y, z, min;

	while ( scanf( "%d", &e ), e ) {
		min = e;
		for ( z = 0; z * z * z <= e; z++ ) {
			ee = e - z * z * z;

			for ( y = 0; y * y <= ee; y++ ) ;
			x = ee - y * y;

			if ( x + y + z < min )
				min = x + y + z;
			}
		}

		printf( "%d\n", min );
	}

	return 0;
}

Compiler output:
main.c:22:9: error: expected identifier or '(' before 'return'
   22 |         return 0;
      |         ^~~~~~
main.c:23:1: error: expected identifier or '(' before '}' token
   23 | }
      | ^
Language: C

#include <cstdio>

void aizu(int e){
    int x, y, z;
    int xyz;

    for(xyz = 1; xyz <= e; xyz++){
        for(x = 0; x <= xyz; x++){
            for(y = 0; x + y <= xyz; y++){
                z = xyz - x - y;
                if(x + y * y + z * z * z == e){
                    printf("%d\n", xyz);
                    return;
                }
            }
        }
    }
}

int main(void)
{
    int e;
    while(scanf("%d", &e), e != 0){
        aizu(e);
    }
    return 0;
}

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

#include<stdio.h>
#include<math.h>
#define min(a,b) (a) < (b) ? (a) : (b)
#define INF 9999999
int e;

int all(){
	double limx=pow(e,1.0/3.0);
	int x,y,p,q,minm=INF;
	for(y=(int)sqrt(e);y>=0;y--){
		p=y*y;
		for(x=0;x<=(int)limx;x++){
			q=x*x*x+p;
			if(q>e)break;
			minm=min(minm,x+y+(e-q));
		}
	}
	return minm;
}

int main(){
	int i,j;
	while((scanf("%d",&e))!=-1){
		if(e==0)break;
		printf("%d\n",all());
	}
	return 0;
}
	int x,y,p,q,minm=INF;
	for(y=(int)sqrt(e);y>=0;y--){
		p=y*y;
		for(x=0;x<=limx;x++){
			q=x*x*x+p;
			if(q>e)break;
			minm=min(minm,x+y+(e-q));
		}
	}
	return minm;
}

int main(){
	int i,j;
	while((scanf("%d",&e))!=-1){
		if(e==0)break;
		printf("%d\n",all());
	}
	return 0;
}

Compiler output:
main.c:30:9: error: expected identifier or '(' before 'for'
   30 |         for(y=(int)sqrt(e);y>=0;y--){
      |         ^~~
main.c:30:29: error: expected '=', ',', ';', 'asm' or '__attribute__' before '>=' token
   30 |         for(y=(int)sqrt(e);y>=0;y--){
      |                             ^~
main.c:30:34: error: expected '=', ',', ';', 'asm' or '__attribute__' before '--' token
   30 |         for(y=(int)sqrt(e);y>=0;y--){
      |                                  ^~
main.c:38:9: error: expected identifier or '(' before 'return'
   38 |         return minm;
      |         ^~~~~~
main.c:39:1: error: expected identifier or '(' before '}' token
   39 | }
      | ^
main.c:41:5: error: redefinition of 'main'
   41 | int main(){
      |     ^~~~
main.c:21:5: note: previous definition of 'main' with type 'int()'
   21 | int main(){
      |     ^~~~
Language: C

#include<stdio.h>
#include<math.h>
#include<stdio.h>
#ifndef min
#define min(a,b) (a) < (b) ? (a) : (b)
#endif
#define INF 9999999
int *d;

void init(){
	int x,y,z,p;
	for(x=0;x<=100;x++)for(y=0;y<=1000;y++){
		p=x*x*x+y*y;
		if(p<=1000000){
			if(d[p])d[p]=min(d[p],x+y);
			else d[p]=x+y;
		}
	}
	for(x=2;x<1000000;x++)if(!d[x])for(y=x-1,z=1;;y--,z++)if(d[y]){
					d[x]=d[y]+z;
					break;
	}
}
int main(){
	int i,j;
	d=(int *)malloc(sizeof(int)*1000000);
	for(i=0;i<=1000000;i++)d[i]=0;
	init();
	while((scanf("%d",&e))!=-1){
		if(e==0)break;
		printf("%d\n",d[e]);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:26:18: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
   26 |         d=(int *)malloc(sizeof(int)*1000000);
      |                  ^~~~~~
main.c:3:1: note: include '<stdlib.h>' or provide a declaration of 'malloc'
    2 | #include<math.h>
  +++ |+#include <stdlib.h>
    3 | #include<stdio.h>
main.c:26:18: warning: incompatible implicit declaration of built-in function 'malloc' [-Wbuiltin-declaration-mismatch]
   26 |         d=(int *)malloc(sizeof(int)*1000000);
      |                  ^~~~~~
main.c:26:18: note: include '<stdlib.h>' or provide a declaration of 'malloc'
main.c:29:28: error: 'e' undeclared (first use in this function)
   29 |         while((scanf("%d",&e))!=-1){
      |                            ^
main.c:29:28: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<stdio.h>
using namespace std;
int main() {
	int e;
	while (scanf("%d", &e), e) {
		int m = 10000000;
		for (int y = 0; y <= 1000; y++) {
			for (int z = 0; z <= 1000; z++) {
				int x=e + y - y * y + z - z * z * z;
					if(x>=0&&e>=y*y+z*z*z)m = min(x,m);
			}
		}
		printf("%d",&m);
	}
}




Compiler output:
a.cc: In function 'int main()':
a.cc:10:67: error: 'min' was not declared in this scope; did you mean 'main'?
   10 |                                         if(x>=0&&e>=y*y+z*z*z)m = min(x,m);
      |                                                                   ^~~
      |                                                                   main
Language: C++

#include <bits/stdc++.h>
#define int long long
using namespace std;
main(){
  int e;
  while(cin>>e,e){
    int ans=1e9;
    for(int z=0;;z++){
      if(z*z*z>e)break;
      for(int y=0;;y++){
        if(z*z*z+y*y>e)break;
        int a=e-z*z*z+y*y;
        ans=min(ans,x+y+z);
      }
    }
    cout<<ans<<endl;
  }
}



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:13:21: error: 'x' was not declared in this scope
   13 |         ans=min(ans,x+y+z);
      |                     ^
Language: C++


import java.util.Scanner;

/**
 * Created by Reopard on 2014/07/03.
 */
public class Main{
    public static void main(String[] args){
        int x, y, z, e, m, min;

        Scanner scan = new Scanner(System.in);
        while((e = scan.nextInt()) != 0){
            min = Integer.MAX_VALUE;
            for(z = 0; z*z*z <= e; ++z){
                for(y = 0; y*y + z*z*z <= e; ++y){
                    for(x = 0; x + y*y + z*z*z <= e; ++x){
                        if(x + y*y + z*z*z == e){
                            m = x + y + z;
                            min = Math.min(m, min);
                        }
                    }
                }
            }
            System.out.println(min);
        }
    }
}

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

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

int Bsearch(int e,int n){
  //cout << n << endl;
  int l=0,r=e;
  int i=(l+r)/2;
  while(r-l>=1){
    i=(l+r)/2;
    //cout << "i:" << i << endl;
    if(e == pow(i,n)){
      //cout << "aaa:" << i << endl;
      return i;
    }else if(e > pow(i,n)){
      l=i+1;
    }else{
      r=i;
    }
  }
  //cout << "i:" << i << endl;
  return i;
}

int a[2000][2000];

int main(){
  int x,y,z,e;
  while(cin>>e,e){
    memset(a,0,sizeof(a));
    y=Bsearch(e,2);
    z=Bsearch(e,3);

    int m=1000000;
    //cout << "z:" << z << " y:" << y << endl;
    for(int i=0;i<=y;i++){
      for(int j=0;j<=z;j++){
	x=e-i*i-j*j*j;
	if(x>=0)m = min(x+i+j,m);
      }
    }
    cout << "ans:" <<m << endl; 
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:5: error: 'memset' was not declared in this scope
   31 |     memset(a,0,sizeof(a));
      |     ^~~~~~
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<iostream>
#include<cmath>
#include<vector>
#include<functional>
using namespace std;
int main(){
	int e;

	while(cin>>e,e){
	int m=0;
	vector<int>anss(0);
	for(int i=0;i<=e;i++){
		for(int j=0;j*j<=e;j++){
			for(int k=0;k*k*k<=e;k++){
				if(i+j*j+k*k*k<e)break;
				if(i+j*j+k*k*k==e)anss.push_back(i+j+k);
			}
		}
	}
		sort(anss.begin(),anss.end());
		cout<<anss[0]<<endl;
	}
	return 0;
}

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

#include <iostream>
using namespace std;
int main() {
  int ene;
  for (int i=0; cin >> ene && ene>0; i++){
    int min = 1000000;
    int z=0;
    while (z<=100) {
      int xy = e - z^3;
      int y=0;
      while (y<xy) {
	int x = xy - y^2;
	if (x+y+z<min) min = x+y+z;
      }
    }
    cout << min << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:16: error: 'e' was not declared in this scope
    9 |       int xy = e - z^3;
      |                ^
Language: C++

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

int main()
{
	long e;
	while (cin >> e && e != 0)
	{
		long m = LONG_MAX;
		for (long x = 0; x < 1000000; x++)
		{
			for (long y = 0; y <= e - x; y++)
			{
				for (long z = 0; z <= e - x - (y * y); z++)
				{
					if (e == x + y * y + z * z * z)
					{
						m = min(m, x + y + z);
					}
				}
			}
		}

		cout << m << endl;
	}


	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:26: error: 'LONG_MAX' was not declared in this scope
   10 |                 long m = LONG_MAX;
      |                          ^~~~~~~~
a.cc:3:1: note: 'LONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    2 | #include<algorithm>
  +++ |+#include <climits>
    3 | using namespace std;