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

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

using namespace std;

map<string,string> digToWord;
map<char,int> mci;
map<string,vector<string> > dp;

vector<string> dfs(string str){
  vector<string> res;
  if(str=="")return res;
  if(dp.find(str)!=dp.end())
    return dp[str];
  // »ÝÌ¶Åêv·éàÌª êÎASÆ¨è·
  for(map<string,string>::iterator it=digToWord.begin();it!=digToWord.end();it++){
    // match
    if(str.size()>=it->first.size()&&str.substr(0,it->first.size())==it->first){
      // ØèæÁÄÄA
      vector<string> vv=dfs(str.substr(it->first.size()));
      // ¡ñÌ[gÅÍì¬sÂ\
      if(vv.size()>=1&&vv[0]=="no")
	continue;
      // S[
      else if(vv.size()==0)
	res.push_back(it->second);
      else
	for(int i = 0; i < vv.size(); i++)
	  res.push_back(it->second+' '+vv[i]);
    }
  }
  // àµêÂà}b`µÈ©Á½êA¡ñÍìêÈ¢
  if(res.size()==0){
    res.push_back("no");
    return res;
  }
  return dp[str]=res;
}

int main(){
  mci['a']=mci['b']=mci['c']=2;
  mci['d']=mci['e']=mci['f']=3;
  mci['g']=mci['h']=mci['i']=4;
  mci['j']=mci['k']=mci['l']=5;
  mci['m']=mci['n']=mci['o']=6;
  mci['p']=mci['q']=mci['r']=mci['s']=7;
  mci['t']=mci['u']=mci['v']=8;
  mci['w']=mci['x']=mci['y']=mci['z']=9;
  int n;
  while(cin>>n&&n!=0){
    dp.clear();
    digToWord.clear();
    for(int i = 0; i < n; i++){
      string s;
      cin>>s;
      string dig;
      for(int j = 0; j < s.size(); j++)
	dig+=(char)(mci[s[j]]+'0');
      digToWord[dig]=s;
    }
    string str;
    cin>>str;
    vector<string> res=dfs(str);
    if(!(res.size()>=1&&res[0]=="no"))
      for(int i = 0; i < res.size(); i++)
	cout<<res[i]+'.'<<endl;
    cout<<"--"<<endl;
  }

  return 0;
}

Compiler output:
a.cc: In function 'std::vector<std::__cxx11::basic_string<char> > dfs(std::string)':
a.cc:28:7: error: expected '}' before 'else'
   28 |       else if(vv.size()==0)
      |       ^~~~
a.cc:21:80: note: to match this '{'
   21 |     if(str.size()>=it->first.size()&&str.substr(0,it->first.size())==it->first){
      |                                                                                ^
a.cc:28:15: error: 'vv' was not declared in this scope
   28 |       else if(vv.size()==0)
      |               ^~
a.cc: At global scope:
a.cc:36:3: error: expected unqualified-id before 'if'
   36 |   if(res.size()==0){
      |   ^~
a.cc:40:3: error: expected unqualified-id before 'return'
   40 |   return dp[str]=res;
      |   ^~~~~~
a.cc:41:1: error: expected declaration before '}' token
   41 | }
      | ^
a.cc: In function 'std::vector<std::__cxx11::basic_string<char> > dfs(std::string)':
a.cc:34:3: warning: control reaches end of non-void function [-Wreturn-type]
   34 |   }
      |   ^
Language: C++

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

using namespace std;

map<string,string> digToWord;
map<char,int> mci;
map<string,vector<string> > dp;

vector<string> dfs(string str){
  vector<string> res;
  if(str=="")return res;
  if(dp.find(str)!=dp.end())
    return dp[str];
  // »ÝÌ¶Åêv·éàÌª êÎASÆ¨è·
  for(map<string,string>::iterator it=digToWord.begin();it!=digToWord.end();it++){
    // match
    if(str.size()>=it->first.size()&&str.substr(0,it->first.size())==it->first){
      // ØèæÁÄÄA
      vector<string> vv=dfs(str.substr(it->first.size()));
      // ¡ñÌ[gÅÍì¬sÂ\
      if(vv.size()>=1&&vv[0]=="no")
	continue;
      // S[
      else if(vv.size()==0){
	res.push_back(it->second);
      }
      else{
	for(int i = 0; i < vv.size(); i++)
	  res.push_back(it->second+' '+vv[i]);
      }
    }
  }
  // àµêÂà}b`µÈ©Á½êA¡ñÍìêÈ¢
  if(res.size()==0){
    res.push_back("no");
    return res;
  }
  return dp[str]=res;
}

int main(){
  mci['a']=mci['b']=mci['c']=2;
  mci['d']=mci['e']=mci['f']=3;
  mci['g']=mci['h']=mci['i']=4;
  mci['j']=mci['k']=mci['l']=5;
  mci['m']=mci['n']=mci['o']=6;
  mci['p']=mci['q']=mci['r']=mci['s']=7;
  mci['t']=mci['u']=mci['v']=8;
  mci['w']=mci['x']=mci['y']=mci['z']=9;
  int n;
  while(cin>>n&&n!=0){
    dp.clear();
    digToWord.clear();
    for(int i = 0; i < n; i++){
      string s;
      cin>>s;
      string dig;
      for(int j = 0; j < s.size(); j++)
	dig+=(char)(mci[s[j]]+'0');
      digToWord[dig]=s;
    }
    string str;
    cin>>str;
    vector<string> res=dfs(str);
    if(!(res.size()>=1&&res[0]=="no"))
      for(int i = 0; i < res.size(); i++)
	cout<<res[i]+'.'<<endl;
    cout<<"--"<<endl;
  }

  return 0;
}

Compiler output:
a.cc: In function 'std::vector<std::__cxx11::basic_string<char> > dfs(std::string)':
a.cc:28:7: error: expected '}' before 'else'
   28 |       else if(vv.size()==0){
      |       ^~~~
a.cc:21:80: note: to match this '{'
   21 |     if(str.size()>=it->first.size()&&str.substr(0,it->first.size())==it->first){
      |                                                                                ^
a.cc:28:15: error: 'vv' was not declared in this scope
   28 |       else if(vv.size()==0){
      |               ^~
a.cc: At global scope:
a.cc:38:3: error: expected unqualified-id before 'if'
   38 |   if(res.size()==0){
      |   ^~
a.cc:42:3: error: expected unqualified-id before 'return'
   42 |   return dp[str]=res;
      |   ^~~~~~
a.cc:43:1: error: expected declaration before '}' token
   43 | }
      | ^
a.cc: In function 'std::vector<std::__cxx11::basic_string<char> > dfs(std::string)':
a.cc:36:3: warning: control reaches end of non-void function [-Wreturn-type]
   36 |   }
      |   ^
Language: C++

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

using namespace std;

map<string,vector<string> > digToWord;
map<char,int> mci;
map<string,vector<string> > dp;

vector<string> dfs(string str){
  vector<string> res;
  if(str=="")return res;
  if(dp.find(str)!=dp.end())
    return dp[str];
  // »ÝÌ¶Åêv·éàÌª êÎASÆ¨è·
  for(map<string,vector<string> >::iterator it=digToWord.begin();
      it!=digToWord.end();it++){
    // match
    if(str.size()>=it->first.size()&&str.substr(0,it->first.size())==it->first){
      // ØèæÁÄÄA
      vector<string> vv=dfs(str.substr(it->first.size()));
      // ¡ñÌ[gÅÍì¬sÂ\
      if(vv.size()>=1&&vv[0]=="no")
	continue;
      // S[
      else if(vv.size()==0){
	for(int j = 0; j < it->second.size(); j++)
	  res.push_back(it->second[j]);
      }
      else{
	for(int i = 0; i < vv.size(); i++){
	  for(int j = 0; j < it->second.size(); j++){
	    res.push_back(it->second[j]+' '+vv[i]);
	  }
	}
      }
    }
  }
  // àµêÂà}b`µÈ©Á½êA¡ñÍìêÈ¢
  if(res.size()==0){
    res.push_back("no");
    return dp[str]=res;
  }
  return dp[str]=res;
}

int main(){
  mci['a']=mci['b']=mci['c']=2;
  mci['d']=mci['e']=mci['f']=3;
  mci['g']=mci['h']=mci['i']=4;
  mci['j']=mci['k']=mci['l']=5;
  mci['m']=mci['n']=mci['o']=6;
  mci['p']=mci['q']=mci['r']=mci['s']=7;
  mci['t']=mci['u']=mci['v']=8;
  mci['w']=mci['x']=mci['y']=mci['z']=9;
  int n;
  while(cin>>n&&n!=0){
    dp.clear();
    digToWord.clear();
    for(int i = 0; i < n; i++){
      string s;
      cin>>s;
      string dig;
      for(int j = 0; j < s.size(); j++)
	dig+=(char)(mci[s[j]]+'0');
      digToWord[dig].push_back(s);
    }
    string str;
    cin>>str;
    vector<string> res=dfs(str);
    if(!(res.size()>=1&&res[0]=="no"))
      for(int i = 0; i < res.size(); i++)
	cout<<res[i]+'.'<<endl;
    cout<<"--"<<endl;
  }

  return 0;
}

Compiler output:
a.cc: In function 'std::vector<std::__cxx11::basic_string<char> > dfs(std::string)':
a.cc:29:7: error: expected '}' before 'else'
   29 |       else if(vv.size()==0){
      |       ^~~~
a.cc:22:80: note: to match this '{'
   22 |     if(str.size()>=it->first.size()&&str.substr(0,it->first.size())==it->first){
      |                                                                                ^
a.cc:29:15: error: 'vv' was not declared in this scope
   29 |       else if(vv.size()==0){
      |               ^~
a.cc: At global scope:
a.cc:43:3: error: expected unqualified-id before 'if'
   43 |   if(res.size()==0){
      |   ^~
a.cc:47:3: error: expected unqualified-id before 'return'
   47 |   return dp[str]=res;
      |   ^~~~~~
a.cc:48:1: error: expected declaration before '}' token
   48 | }
      | ^
a.cc: In function 'std::vector<std::__cxx11::basic_string<char> > dfs(std::string)':
a.cc:41:3: warning: control reaches end of non-void function [-Wreturn-type]
   41 |   }
      |   ^
Language: C

N;double X[30],Y[30],Z[30],cx,cy,cz;
#define Q(x)(x)*(x)
double distance2(int i) { return sqrt(Q(X[i]-cx)+Q(Y[i]-cy)+Q(Z[i]-cz)); }
int longest() { 
	double max = 0; int max_i;
	for (int i=0; i<N; ++i)
		if (distance2(i) > max){
			max=distance2(i);
			max_i=i;
		}
		return max_i;
}
int main() {
	while (scanf("%d",&N) && N) {
		for (int i=0; i<N; ++i) scanf("%lf%lf%lf", X+i, Y+i, Z+i);
		cx = cy = cz = 0.5;
		for (double d=0.5; d>1e-8; d/=2) {
			for (int t=0; t<100; ++t) {
				int i = longest();
				cx += (X[i]-cx)*d;
				cy += (Y[i]-cy)*d;
				cz += (Z[i]-cz)*d;
			}
		}
		printf("%.5f\n", distance2(longest()));
	}
return 0;
}

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | N;double X[30],Y[30],Z[30],cx,cy,cz;
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'N' [-Wimplicit-int]
main.c: In function 'distance2':
main.c:3:34: error: implicit declaration of function 'sqrt' [-Wimplicit-function-declaration]
    3 | double distance2(int i) { return sqrt(Q(X[i]-cx)+Q(Y[i]-cy)+Q(Z[i]-cz)); }
      |                                  ^~~~
main.c:1:1: note: include '<math.h>' or provide a declaration of 'sqrt'
  +++ |+#include <math.h>
    1 | N;double X[30],Y[30],Z[30],cx,cy,cz;
main.c:3:34: warning: incompatible implicit declaration of built-in function 'sqrt' [-Wbuiltin-declaration-mismatch]
    3 | double distance2(int i) { return sqrt(Q(X[i]-cx)+Q(Y[i]-cy)+Q(Z[i]-cz)); }
      |                                  ^~~~
main.c:3:34: note: include '<math.h>' or provide a declaration of 'sqrt'
main.c: In function 'main':
main.c:14:16: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   14 |         while (scanf("%d",&N) && N) {
      |                ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | N;double X[30],Y[30],Z[30],cx,cy,cz;
main.c:14:16: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   14 |         while (scanf("%d",&N) && N) {
      |                ^~~~~
main.c:14:16: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:25:17: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   25 |                 printf("%.5f\n", distance2(longest()));
      |                 ^~~~~~
main.c:25:17: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:25:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:25:17: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C++

#include <iostream>
#include <cmath>
#define pow2(x) ((x)*(x))
using namespace std;
struct three_d{
  double x, y, z;
} stars[31];
int n;


double distancex(three_d from, int to){
  return pow2(from.x-stars[to].x) + pow2(from.y-stars[to].y) + pow2(from.z-stars[to].z);
}

int main(){
  while((cin >> n), n){
    for(int i=0; i<n; i++) cin >> stars[i].x >> stars[i].y >> stars[i].z;
    double move = 0.5, maxdis;
    three_d now = {0, 0, 0};
    int moveto, i;
    while(move > 0.000000001){
      for(int j=0;j<1000;j++){
	now.x = now.x * (1-move) + stars[moveto].x * move;
	now.y = now.y * (1-move) + stars[moveto].y * move;
	now.z = now.z * (1-move) + stars[moveto].z * move;
	moveto = 0; maxdis = 0;
	for(i=0; i<n; i++)
	  if(distance(now, i) > maxdis){
	    maxdis = distancex(now, i);
	    moveto = i;
	  }
      }
      move /= 2;
    }
    printf("%.5lf\n", sqrt(maxdis));
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:22: error: no matching function for call to 'distance(three_d&, int&)'
   28 |           if(distance(now, i) > maxdis){
      |              ~~~~~~~~^~~~~~~~
In file included from /usr/include/c++/14/string:47,
                 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_iterator_base_funcs.h:148:5: note: candidate: 'template<class _InputIterator> constexpr typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::distance(_InputIterator, _InputIterator)'
  148 |     distance(_InputIterator __first, _InputIterator __last)
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:148:5: note:   template argument deduction/substitution failed:
a.cc:28:22: note:   deduced conflicting types for parameter '_InputIterator' ('three_d' and 'int')
   28 |           if(distance(now, i) > maxdis){
      |              ~~~~~~~~^~~~~~~~
Language: C++

#include <cstdio>
#include <cmath>
#define Q(x)(x)*(x)
N,i,M;double X[30],Y[30],Z[30],cx,cy,cz,d,m;
double D(i){return sqrt(Q(X[i]-cx)+Q(Y[i]-cy)+Q(Z[i]-cz));}
int L(){for(m=i=0;i<N;i++)if(D(i)>m)m=D(i),M=i;return M;}
main(t){for(;scanf("%d",&N),N;printf("%f\n",D(L()))){
	for(i=0;i<N;i++)scanf("%lf%lf%lf",X+i,Y+i,Z+i);
	for(cx=cy=cz=d=0.5;d>1e-8;d/=2)for(t=0;t<100;t++)i=L(),cx+=(X[i]-cx)*d,cy+=(Y[i]-cy)*d,cz+=(Z[i]-cz)*d;
}exit(0);}

Compiler output:
a.cc:4:1: error: 'N' does not name a type
    4 | N,i,M;double X[30],Y[30],Z[30],cx,cy,cz,d,m;
      | ^
a.cc:5:10: error: 'i' was not declared in this scope
    5 | double D(i){return sqrt(Q(X[i]-cx)+Q(Y[i]-cy)+Q(Z[i]-cz));}
      |          ^
a.cc: In function 'int L()':
a.cc:6:15: error: 'i' was not declared in this scope
    6 | int L(){for(m=i=0;i<N;i++)if(D(i)>m)m=D(i),M=i;return M;}
      |               ^
a.cc:6:21: error: 'N' was not declared in this scope
    6 | int L(){for(m=i=0;i<N;i++)if(D(i)>m)m=D(i),M=i;return M;}
      |                     ^
a.cc:6:31: error: 'D' cannot be used as a function
    6 | int L(){for(m=i=0;i<N;i++)if(D(i)>m)m=D(i),M=i;return M;}
      |                              ~^~~
a.cc:6:40: error: 'D' cannot be used as a function
    6 | int L(){for(m=i=0;i<N;i++)if(D(i)>m)m=D(i),M=i;return M;}
      |                                       ~^~~
a.cc:6:44: error: 'M' was not declared in this scope
    6 | int L(){for(m=i=0;i<N;i++)if(D(i)>m)m=D(i),M=i;return M;}
      |                                            ^
a.cc:6:55: error: 'M' was not declared in this scope
    6 | int L(){for(m=i=0;i<N;i++)if(D(i)>m)m=D(i),M=i;return M;}
      |                                                       ^
a.cc: At global scope:
a.cc:7:5: error: expected constructor, destructor, or type conversion before '(' token
    7 | main(t){for(;scanf("%d",&N),N;printf("%f\n",D(L()))){
      |     ^
Language: C++

#include <cstdio>
#include <cmath>
#define Q(x)(x)*(x)
int N,i,M;double X[30],Y[30],Z[30],cx,cy,cz,d,m;
double D(i){return sqrt(Q(X[i]-cx)+Q(Y[i]-cy)+Q(Z[i]-cz));}
int L(){for(m=i=0;i<N;i++)if(D(i)>m)m=D(i),M=i;return M;}
main(t){for(;scanf("%d",&N),N;printf("%f\n",D(L()))){
	for(i=0;i<N;i++)scanf("%lf%lf%lf",X+i,Y+i,Z+i);
	for(cx=cy=cz=d=0.5;d>1e-8;d/=2)for(t=0;t<100;t++)i=L(),cx+=(X[i]-cx)*d,cy+=(Y[i]-cy)*d,cz+=(Z[i]-cz)*d;
}exit(0);}

Compiler output:
a.cc:5:12: error: expected ',' or ';' before '{' token
    5 | double D(i){return sqrt(Q(X[i]-cx)+Q(Y[i]-cy)+Q(Z[i]-cz));}
      |            ^
a.cc: In function 'int L()':
a.cc:6:31: error: 'D' cannot be used as a function
    6 | int L(){for(m=i=0;i<N;i++)if(D(i)>m)m=D(i),M=i;return M;}
      |                              ~^~~
a.cc:6:40: error: 'D' cannot be used as a function
    6 | int L(){for(m=i=0;i<N;i++)if(D(i)>m)m=D(i),M=i;return M;}
      |                                       ~^~~
a.cc: At global scope:
a.cc:7:5: error: expected constructor, destructor, or type conversion before '(' token
    7 | main(t){for(;scanf("%d",&N),N;printf("%f\n",D(L()))){
      |     ^
Language: C++

#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <queue>
#include <numeric>
#include <string>
#include <string.h>
#include <map>
#include <set>
#include <functional>
#include <complex>
#include <stack>
#include <tuple>

#define ll long long int

using namespace std;

const ll INF = (1<<30) - 1;
const double EPS = 1e-6;

const ll MAX_M = 100000;

vector<ll> sieve(ll n){
    vector<ll> primes;
    
    vector<bool> is_prime(n, true);
    is_prime[0] = false;
    
    for(ll i=0; i<n; i++){
        if(is_prime[i]){
            primes.push_back(i+1);
            for(ll j=2*i+1; j<n; j+=i+1)
                is_prime[j] = false;
        }
    }
    return primes;
}

ll main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    vector<ll> primes = sieve(MAX_M/2);
    vector<pair<ll, ll>> table(MAX_M);
    
    for(ll i=0; i<primes.size(); i++){
        for(ll j=i; j<primes.size(); j++){
            // i < j, primes[i] < primes[j]
            ll pi = primes[i];
            ll pj = primes[j];
            if(pi * pj < MAX_M){
                pair<ll, ll> &p = table[pi*pj];
                if(p.first == 0 || p.first*pj < p.second*pi){
                    p.first = pi;
                    p.second = pj;
                }
                
            }else{
                break;
            }
        }
    }
    
    ll M, A, B;
    while(cin>>M>>A>>B, M|A|B){
        while(M--){
            pair<ll, ll> &p = table[M];
            if(p.first == 0)
                continue;
            
            if(p.first*B >= p.second*A){
                cout << p.first << " " << p.second << endl;
                break;
            }
        }
    }
    
    return 0;
}

Compiler output:
a.cc:16:22: error: '::main' must return 'int'
   16 | #define ll long long int
      |                      ^~~
a.cc:41:1: note: in expansion of macro 'll'
   41 | ll main(){
      | ^~
Language: C++

#include "bits/stdc++.h"
#include<unordered_map>
#pragma warning(disable:4996)
using namespace std;

const int My_Inf=2147483647;
const long long int My_LInf=9223372036854775807;
int a[10000];
bool isprime(long long int a) {
	if (a == 1 || a == 0)return false;
	for (long long int i = 2; i*i <= a; ++i) {
		if ((a%i)) {
		}
		else {
			return false;
		}
	}
	return true;
}
int main() {
	for (int i = 0; i < 10000; ++i) {
		a[i] = isprime(i);
	}
	while (1) {
		int m, a, b; cin >> m >> a >> b;
		if (!m)break;

		int ans=0;
		int p;
		int q;

		for (int i = 2; i < sqrt(m)+2; ++i) {
			if (a[i])continue;
			for (int j = i; j < m/i+2; ++j) {

				if (i*j <= m&& a[j]) {
					if (double(a) / b <= double(i) / j + 1e-8) {
						if (ans < i*j) {
							ans = i*j;
							p = i;
							q = j;
						}
					}
				}
			}
		}
		cout << p <<" "<< q << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:30: error: invalid types 'int[int]' for array subscript
   33 |                         if (a[i])continue;
      |                              ^
a.cc:36:49: error: invalid types 'int[int]' for array subscript
   36 |                                 if (i*j <= m&& a[j]) {
      |                                                 ^
Language: C++

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

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define ALL(a) (a).begin(),(a).end()
#define DEBUG(a) "(" << #a << ": " << (a) << ")"

template<typename T>
void chmin(T &x, T y) { x = min(x, y); }

template<typename T>
void chmax(T &x, T y) { x = max(x, y); }

typedef long long int lli;
typedef long double ld;
typedef tuple<int,int> P;

const int INF = INT_MAX/2 - 1;
const double EPS = 1e-14;
const int dx[4] = {0, 1, 0, -1}; // {-1,  0,  1, -1, 1, -1, 0, 1};
const int dy[4] = {1, 0, -1, 0}; // {-1, -1, -1,  0, 0,  1, 1, 1};

B
const lli PRIMEMAX = 100000;
int FACTOR[PRIMEMAX];
vector<int> Primes;
void sieve() {
  FACTOR[0] = FACTOR[1] = -1;
  for (lli n = 2; n < PRIMEMAX; ++n) {
    if (FACTOR[n] != 0) continue;
    Primes.push_back(n);
    lli kn = n * n;
    while (kn < PRIMEMAX) { FACTOR[kn] = n; kn += n; }
  }
}

bool is_prime(int n) {
  if (n < PRIMEMAX) return FACTOR[n] == 0;
  for (int p : Primes) {
    if (p * p > n) break;
    if (n % p == 0) return false;
  }
  return true;
}

void solve(int a, int b, int m) {
  lli len = Primes.size(), ans = -1;
  lli pp = 0, qq = 0;
  FOR(i, 0, len) {
    FOR (j, i, len) {
      lli p = Primes[i], q = Primes[j];
      if (p * q > m || a * q > b * p) break;
      if (ans < p * q) {
        pp = p, qq = q, ans = p * q;
      }
    }
  }
  cout << pp << " " << qq << endl;
}

int main() {
  cout << fixed << setprecision(10);
  sieve();
  int a, b, m;
  while (cin >> m >> a >> b and b) {
    solve(a, b, m);
  }
  return 0;
}

Compiler output:
a.cc:26:1: error: 'B' does not name a type
   26 | B
      | ^
a.cc:28:12: error: 'PRIMEMAX' was not declared in this scope; did you mean 'PRIbMAX'?
   28 | int FACTOR[PRIMEMAX];
      |            ^~~~~~~~
      |            PRIbMAX
a.cc: In function 'void sieve()':
a.cc:31:3: error: 'FACTOR' was not declared in this scope
   31 |   FACTOR[0] = FACTOR[1] = -1;
      |   ^~~~~~
a.cc:32:23: error: 'PRIMEMAX' was not declared in this scope; did you mean 'PRIbMAX'?
   32 |   for (lli n = 2; n < PRIMEMAX; ++n) {
      |                       ^~~~~~~~
      |                       PRIbMAX
a.cc: In function 'bool is_prime(int)':
a.cc:41:11: error: 'PRIMEMAX' was not declared in this scope; did you mean 'PRIbMAX'?
   41 |   if (n < PRIMEMAX) return FACTOR[n] == 0;
      |           ^~~~~~~~
      |           PRIbMAX
a.cc:41:28: error: 'FACTOR' was not declared in this scope
   41 |   if (n < PRIMEMAX) return FACTOR[n] == 0;
      |                            ^~~~~~
Language: C++

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

int main()
{
	vector<int> prime;
	prime.push_back(2);
	prime.push_back(3);

	for (int i = 4; i < sqrt(100000) + 1; i++) {
		bool flag = true;

		for (int j = 0; j < prime.size(); j++) {
			if (i%prime[j] == 0) {
				flag = false;
				break;
			}
		}

		if (flag == true) {
			prime.push_back(i);
		}
	}

	while (true) {
		int m, a, b;

		cin >> m >> a >> b;

		if (m == 0 && a == 0 && b == 0) {
			break;
		}

		int ansp, ansq;
		int maxarea = 0;

		rep(i, prime.size()) {
			for (int j = i; j < prime.size(); j++) {
				if (prime[i] * prime[j] <= m && (double)a / b <= (double)prime[i] / prime[j] && (double)prime[i] / prime[j] <= 1) {
					if (prime[i] * prime[j] > maxarea) {
						maxarea = prime[i] * prime[j];
						ansp = prime[i];
						ansq = prime[j];
					}
				}
			}
		}

		cout << ansp << " " << ansq << endl;
	}


	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:29: error: 'sqrt' was not declared in this scope
   12 |         for (int i = 4; i < sqrt(100000) + 1; i++) {
      |                             ^~~~
Language: C++

#include<iostream>
using namespace std;


#define MAX_N 1000000
int prime[MAX_N];
bool is_prime[MAX_N+1];
int sieve(int n){
	int p=0;
	memset(is_prime,true,sizeof(is_prime));
	is_prime[0]=is_prime[1]=false;
	for(int i=2;i<=n;i++){
		if(is_prime[i]){
			prime[p++]=i;
			for(int j=2*i;j<=n;j+=i)is_prime[j]=false;
		}
	}
	return p;
}


int main(){
	int m,a,b;
	sieve(100010);
	while(cin>>m>>a>>b,m||a||b){
		int p=0,q=0;
		for(int i=0;prime[i]*prime[i]<=m;i++){
			for(int j=i;prime[i]*prime[j]<=m;j++){
				if(a*prime[j]<=prime[i]*b && p*q<prime[i]*prime[j]){
					p=prime[i];
					q=prime[j];
				}
			}
		}
		cout<<p<<' '<<q<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int sieve(int)':
a.cc:10:9: error: 'memset' was not declared in this scope
   10 |         memset(is_prime,true,sizeof(is_prime));
      |         ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
Language: C++

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

const double EPS=1e-8;
vector<double> var;

void skip(string &s,int &p){
  while(p<s.size() && s[p]==' ') p++;
}
double formula(string &s,int &p);

double num(string &s,int &p){
  double res=0;
  while(p<s.size() && isdigit(s[p])){
    res*=10;
    res+=s[p]-'0';
    p++;
  }
  skip(s,p);
  return res;
}

double var_val(string &s,int &p){
  double res=var[s[p]-'a'];
  p++;
  skip(s,p);
  return res;
}

double get_val(string &s,int &p){
  if(s[p]=='('){
    p++;
    skip(s,p);
    double res=formula(s,p);
    assert(s[p]==')');
    p++;
    skip(s,p);
    return res;
  }
  if(isalpha(s[p])){
    return var_val(s,p);
  }
  if(isdigit(s[p])){
    return num(s,p);
  }
  assert(0);
}

double term2(string &s,int &p){
  double res=get_val(s,p);
  if(p<s.size() && s[p]=='^'){
    p++;
    skip(s,p);
    return pow(res,term2(s,p));
  }
  return res;
}

double term1(string& s,int &p){
  double res=term2(s,p);
  while(p<s.size() && s[p]!=')' && s[p]!='+' && s[p]!='-'){
    skip();
    assert(isalpha(s[p])||isdigit(s[p])||s[p]=='(');
    double val=term2(s,p);
    res*=val;
  }
  return res;
}

double formula(string& s,int &p){
  double res=term1(s,p);
  while(p<s.size() && s[p]!=')'){
    char op=s[p];
    assert(op=='+' || op=='-');
    p++;
    skip(s,p);
    double val=term1(s,p);
    if(op=='+') res+=val;
    else res-=val;
  }
  return res;
}

void solve(vector<string> &state){
  random_device rnd;
  var.resize('z'-'a'+1);
  for(int i=1;i<state.size();i++){
    bool isok=true;
    const int TIME=1000;
    for(int j=0;j<TIME;j++){
      int p=0;
      for(int i=0;i<='z'-'a';i++){
	var[i]=rnd();
      }
      double cor=formula(state[0],p);
      p=0;
      double ans=formula(state[i],p);
      isok&=(abs(cor-ans)<EPS);
    }
    cout<<(isok ? "yes" : "no")<<endl;
  }
  return;
}

int main(){
  while(true){
    vector<string> state;
    while(true){
      string buf;
      getline(cin,buf);
      if(buf==".") break;
      state.push_back(buf);
    }
    if(state.size()==0) break;
    solve(state);
  }
  return 0;
}

Compiler output:
a.cc: In function 'double term1(std::string&, int&)':
a.cc:62:9: error: too few arguments to function 'void skip(std::string&, int&)'
   62 |     skip();
      |     ~~~~^~
a.cc:7:6: note: declared here
    7 | void skip(string &s,int &p){
      |      ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long ll;

string s;
int p;

ll A[200][300];
int idx;

ll bnf();

ll get_num(){

  if(s[p]=='('){
    
    p++;

    ll res=bnf();
    
    p++;

    return res;
  }
  
  if('a'<=s[p]&&s[p]<='z') return A[T][s[p++]];
  
  ll num=0;
  
  while('0'<=s[p]&&s[p]<='9') num=num*10+s[p]-'0', p++;

  return num;
  
}

ll bnf3(){

  ll res=get_num();
  
  while(p<s.size()){

    if(s[p]=='^'){

      p++;

      ll r=get_num();

      ll tmp=1;

      for(int i=0;i<r;i++) tmp*=res;

      res=tmp;
      
    }else break;
    
  }
  
  return res;
}

ll bnf2(){

  ll res=bnf3();

  while(p<s.size()){

    if(s[p]=='*'){

      p++;

      ll r=bnf3();
      
      res*=r;
      
    }else break;
    
  }
  
  return res;
}

ll bnf(){

  ll res=bnf2();
  
  while(p<s.size()){
    
    if(s[p]=='+'){

      p++;
      
      ll r=bnf2();
      
      res+=r;
      
    }
    else if(s[p]=='-'){

      p++;

      ll r=bnf2();

      res-=r;
      
    }else break;
    
  }
  
  return res;
}

void change(){
  
  for(int i=0;i<s.size();i++)
    if((s[i]==')'||('a'<=s[i]&&s[i]<='z')||('0'<=s[i]&&s[i]<='9')))
      if((s[i+1]=='('||('a'<=s[i+1]&&s[i+1]<='z')||('0'<=s[i+1]&&s[i+1]<='9')))
	if(!('0'<=s[i]&&s[i]<='9'&&'0'<=s[i+1]&&s[i+1]<='9'))
	  s=s.substr(0,i+1)+'*'+s.substr(i+1);

  
  for(int i=0;i<s.size();i++)
    
    if(s[i]==' ')
      
      while(s[i]==' '&&i+1<s.size()&&s[i+1]==' ') s.erase(s.begin()+i);
  

  if(s[0]==' ') s.erase(s.begin());
  
  if(s[s.size()-1]==' ') s.erase(s.begin()+s.size()-1);

  for(int i=0;i<s.size();i++)
    if(s[i]==' ')
      if((s[i-1]==')'||('a'<=s[i-1]&&s[i-1]<='z')||('0'<=s[i-1]&&s[i-1]<='9')))
	if((s[i+1]=='('||('a'<=s[i+1]&&s[i+1]<='z')||('0'<=s[i+1]&&s[i+1]<='9'))) s[i]='*';

  for(int i=0;i<s.size();i++)
    
    if(s[i]==' ') s.erase(s.begin()+i), i--;
  
  
}

int main(){

  for(int T=0;T<200;T++)
    
    for(int i=0;i<300;i++) A[T][i]=rand();
      
  while(1){

    for(int T=0;T<200;T++){

      idx=T;
      
      getline(cin,s);
    
      if(s==".") break;
    
      change();
    
      p=0;
    
      ll ans=bnf();

      while(1){
      
	getline(cin,s);
      
	change();
      
	p=0;
      
	ll r=bnf();
      
	if(s=="."){
	  cout<<"."<<endl;
	  break;
	}

	cout<<(ans==r?"yes":"no")<<endl;      
      }

    
    }
    
  }
  
  return 0;
}

Compiler output:
a.cc: In function 'll get_num()':
a.cc:26:37: error: 'T' was not declared in this scope
   26 |   if('a'<=s[p]&&s[p]<='z') return A[T][s[p++]];
      |                                     ^
Language: C++

4 4
   2
  2 3
 1 0 4
1 1 4 0
4 5
   2
  2 3
 3 0 4
1 1 4 0
4 1
   2
  2 3
 3 0 4
1 1 4 0
4 1
   1
  1 1
 1 1 1
1 1 1 0
4 2
   1
  1 1
 1 1 1
1 1 1 0
4 1
   0
  2 2
 5 0 7
0 5 7 0
4 2
   0
  0 3
 1 0 4
0 1 0 4
4 3
   0
  3 3
 3 2 3
0 3 0 3
4 2
   0
  3 3
 3 2 3
0 3 0 3
6 1
     1
    1 2
   1 1 0
  6 7 6 8
 0 7 6 8 2
6 6 7 2 2 0
5 9
    0
   0 0
  0 0 0
 0 0 0 0
0 0 0 0 0
5 3
    3
   3 2
  4 3 2
 4 4 0 3
3 3 3 0 3
0 0

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

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

using namespace std;






struct state {
  int index;
  int free_child; //no. of free children
};



int trace_parent(int cur_index, int backtrack, int parentLookup[101]) {
  if (backtrack == 0) return cur_index;
  return trace_parent(parentLookup[cur_index], backtrack-1, parentLookup);
}


int main() {
  int N; //no. of explorations
  cin >> N;

  for (int i = 0; i < N; i++) {
    stack<state> path;
    vector<int> output[101];
    int parentLookup[101] = {-1}; //index is a child of entry on current path

    int max_state = 1;
    parentLookup[1] = 1;
    
    int entry;
    cin >> entry;

    while (entry != 0) {
      //cout << "inside entry:" << entry <<  endl;
      if (entry > 0) {
	state new_state = { max_state, entry-1 };
	
	//add to output
	if (new_state.index != 1) {
	  int parent = path.top().index;
	  parentLookup[new_state.index] = parent;
	  output[new_state.index].push_back(parent);
	  output[parent].push_back(new_state.index);
	}
	
	path.push(new_state);
	max_state++;
      } else if (entry < 0) {
	int backlink_id = trace_parent(path.top().index, -entry, parentLookup);
	output[path.top().index].push_back(backlink_id);
	output[backlink_id].push_back(path.top().index);
	path.top().free_child -= 1;
	if (path.top().free_child == 0) {
	  path.pop();
	}
      }
      cin >> entry; 
    }
    
    for (int i = 1; i < max_state; i++) {
      cout << i << " ";
      sort(output[i].begin(), output[i].end());
      for (vector<int>::const_iterator j = output[i].begin(); j != output[i].end(); ++j) {
	cout << *j << " ";
      }
      cout << endl;
    }
  }
}
	

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

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

void solve(int *dist,int *en,vector<int>*edge,vector<int>&inp,
	   int &p,int ff,int &cnt){//from first
  int now = inp[p++];
  int node = cnt;
  dist[ff]=node;
  en[node] = cnt==0?now:now-1;
  cnt++;

  while(p<inp.size() && en[node]){
    if ( inp[p]<0){
      int to = dist[ff+inp[p]];
      edge[to].push_back(node);
      edge[node].push_back(to);
      assert(en[node]>0 && en[to]>0);
      en[node]--;
      en[to--];
      p++;
    }else if (inp[p]>0){
      en[node]--;
      edge[node].push_back(cnt);
      edge[cnt].push_back(node);
      solve(dist,en,edge,inp,p,ff+1,cnt);
    }

  }
  
}

#define N 100
main(){
  int te;
  cin>>te;
  while(te--){
    vector<int> edge[N];
    vector<int> inp;
    int n,dist[N]={0},en[N]={0},p=0,cnt=0;
    while(cin>>n && n !=0)inp.push_back(n);

    solve(dist,en,edge,inp,p,0,cnt);
    rep(i,N){
      if ( edge[i].size() == 0)continue;
      sort(edge[i].begin(),edge[i].end());
      cout << i+1 ;
      rep(j,edge[i].size())cout << " " << edge[i][j]+1;
      cout << endl;
    }

  }
}

Compiler output:
a.cc: In function 'void solve(int*, int*, std::vector<int>*, std::vector<int>&, int&, int, int&)':
a.cc:21:7: error: 'assert' was not declared in this scope
   21 |       assert(en[node]>0 && en[to]>0);
      |       ^~~~~~
a.cc:4:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
    3 | #include<vector>
  +++ |+#include <cassert>
    4 | using namespace std;
a.cc: At global scope:
a.cc:37:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   37 | main(){
      | ^~~~
Language: C++

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

void solve(vector<int> *dist,int *en,vector<int>*edge,vector<int>&inp,
	   int &p,int ff,int &cnt){//from first
  int now = inp[p++];
  int node = cnt;
  dist[ff].push_back(node);
  en[node] = cnt==0?now:now-1;
  cnt++;

  while(p<inp.size() && en[node]){
    if ( inp[p]<0){
      int to;
      rep(i,dist[ff+inp[p]].size() ){
	if ( en[dist[ff+inp[p]][i]] >0){to=dist[ff+inp[p]][i];break;}
      }

      edge[to].push_back(node);
      edge[node].push_back(to);
      assert(en[node]>0 && en[to]>0);
      en[node]--;
      en[to--];
      p++;
    }else if (inp[p]>0){
      en[node]--;
      edge[node].push_back(cnt);
      edge[cnt].push_back(node);
      solve(dist,en,edge,inp,p,ff+1,cnt);
    }

  }
  
}

#define N 100
main(){
  int te;
  cin>>te;
  while(te--){
    vector<int> edge[N];
    vector<int> inp;
    vector<int> dist[N];
    int n,en[N]={0},p=0,cnt=0;
    while(cin>>n && n !=0)inp.push_back(n);

    solve(dist,en,edge,inp,p,0,cnt);
    rep(i,N){
      if ( edge[i].size() == 0)continue;
      sort(edge[i].begin(),edge[i].end());
      cout << i+1 ;
      rep(j,edge[i].size())cout << " " << edge[i][j]+1;
      cout << endl;
    }

  }
}

Compiler output:
a.cc: In function 'void solve(std::vector<int>*, int*, std::vector<int>*, std::vector<int>&, int&, int, int&)':
a.cc:25:7: error: 'assert' was not declared in this scope
   25 |       assert(en[node]>0 && en[to]>0);
      |       ^~~~~~
a.cc:4:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
    3 | #include<vector>
  +++ |+#include <cassert>
    4 | using namespace std;
a.cc: At global scope:
a.cc:41:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   41 | main(){
      | ^~~~
Language: Java

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

public class ShreddingCompany {
	int n, target;
	int ans = -1;
	boolean rejected = true;
	int nums[];
	int temp[] = new int[6];

	public void shred(int x, int num, int index) {
		for (int i = 10; i <= (num * 10); i *= 10) {
			int mod = num % i;
			temp[index] = mod;
			if (x + mod > n)
				break;
			// System.out.println((x + mod) + " " + num);
			if (num / i == 0) {
				if (x + mod > ans) {
					rejected = false;
					ans = x + mod;
					nums = Arrays.copyOf(temp, temp.length);
				} else if (x + mod == ans) {
					rejected = true;
				}
			} else {
				shred(x + mod, num / i, index + 1);
			}
			temp[index] = -1;
		}
	}

	public void run() {
		Scanner in = new Scanner(System.in);
		while (true) {
			ans = -1;
			Arrays.fill(temp, -1);
			n = in.nextInt();
			target = in.nextInt();
			if ((n | target) == 0)
				break;
			shred(0, target, 0);
			if (ans == -1)
				System.out.println("error");
			else if (rejected)
				System.out.println("rejected");
			else {
				System.out.print(ans);
				for (int i = nums.length - 1; i >= 0; i--) {
					if (nums[i] == -1)
						continue;
					System.out.print(" " + nums[i]);
				}
				System.out.println();
			}
		}
	}

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

}

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

#include<iostream>
#include<vector>

using namespace std;
typedef pair<int,int> P;
int t, in, lim;
P ans;
string ans_s;

string change(string s, int n){
  int a = 0;
  string out = "";

  for(int i = 0; i < s.length(); i++){
    out += s[i];
    if(s[i] >= '0' && s[i] <= '9') a++;
    if(a == n) out += " ";
  }
  return out;
}


int make(string s){
  s += " ";
  int out = 0;
  int now = 0;

  for(int i = 0; i < s.length(); i++){
    if(s[i] < '0' || s[i] > '9'){
      out += now;
      now = 0;
    }else{
      now *= 10;
      if(now == 0 && s[i] == '0') return -1;
      now += s[i]-'0';
    }
  }
  return out;
}

void solve(string s, int num){

  int dig = make(s);
  if(dig != -1){
    if(dig <= t && dig >= ans.first){ 
      if(dig == ans.first && ans_s != s) ans.second++;
      else{
	ans.first = dig;
	ans.second = 1;
	ans_s = s;
      }
    }
  }
  if(num < lim){
    //do not cut 
    solve(s,num+1);
    //cut
    s = change(s,num);
    solve(s,num+1);
  }
}

bool isError(string s){
  int n = 0;
  for(int i = 0; i < s.length(); i++)
    n+=s[i]-'0';
  
  return t<n;
}

string tos(int num){
  string out = "";
  while(num){
    out += num%10+'0';
    num/=10;
  }
  reverse(out.begin(),out.end());
  return out;
}


int main(){
  while(cin >> t >> in && in){
    ans = P(-1,2);
    string s = tos(in);
    if(isError(s)) cout << "error" << endl;
    else{
      lim = s.length();
      solve(s,1);
      if(ans.second > 1) cout << "rejected" << endl;
      else cout << ans.first << " " << ans_s << endl;
    }
  }

  return 0;
}

Compiler output:
a.cc: In function 'std::string tos(int)':
a.cc:77:3: error: 'reverse' was not declared in this scope
   77 |   reverse(out.begin(),out.end());
      |   ^~~~~~~
Language: C++

#include<iostream>
#include<vector>
using namespace std;
#define MAX_V 305
#define MAX_E 1005

struct edge {int to,cost;};
vector<edge> G[MAX_V];
int V,E,A,B;
vector < vector < int > > t,u;

bool visited[MAX_V];
vector<int> a,b;

void dfs(int pos,bool flg){
  if(visited[pos])return;
  if(flg)a.push_back(pos);
  else b.push_back(pos);
  visited[pos]=true;
  for(int i=0;i<(int)G[pos].size();i++){
    bool f=G[pos][i].cost;
    dfs(G[pos][i].to,f^(!flg));
  }
}

void make_data(){
  for(int i=0;i<MAX_V;i++)visited[i]=false;
  for(int i=0;i<V;i++){
    if(visited[i])continue;
    a.clear();
    b.clear();
    dfs(i,true);
    t.push_back(a);
    u.push_back(b);
    /*
    for(int j=0;j<(int)a.size();j++)
      cout<<a[j]+1<<",";
    cout<<"=";

    for(int j=0;j<(int)b.size();j++)
      cout<<b[j]+1<<",";
    cout<<endl;
    */
  }
  //cout<<"---"<<endl;
}

void solve(){
  make_data();
  int prev[MAX_V][MAX_V];
  int dp[MAX_V][MAX_V],N=t.size();
  for(int i=0;i<MAX_V;i++)
    for(int j=0;j<MAX_V;j++)
      dp[i][j]=0;
  dp[0][0]=1;
  for(int i=0;i<N;i++){
    int a=t[i].size(),b=u[i].size();
    for(int j=0;j<MAX_V;j++){
      if(dp[i][j]==0)continue;
      if(j+a<MAX_V){
	dp[i+1][j+a]+=dp[i][j];
	prev[i+1][j+a]=j;
      }
      if(j+b<MAX_V){
	dp[i+1][j+b]+=dp[i][j];
	prev[i+1][j+b]=j;
      }
    }
  }


  if(dp[N][A]!=1){cout<<"no"<<endl;return;}


  vector<int> ans;
  int j=A;
  for(int i=N;i>0;i--){
    int nj=prev[i][j];
    if(j-nj==0)continue;
    if(j-nj==(int)t[i-1].size()){
      for(int k=0;k<j-nj;k++)ans.push_back(t[i-1][k]);
    }else{
     for(int k=0;k<j-nj;k++)ans.push_back(u[i-1][k]);
    }
    j=nj;
  }

  sort(ans.begin(),ans.end());
  for(int i=0;i<(int)ans.size();i++)
    cout<<ans[i]+1<<endl;
  cout<<"end"<<endl;
}

void init(){
  for(int i=0;i<MAX_V;i++){
    t.clear();
    u.clear();
    G[i].clear();
  }
  t.clear();
}

int main(){
  while(cin>>E>>A>>B){
    if(E==0&&A==0&&B==0)break;
    init();
    V=A+B;
    for(int i=0;i<E;i++){
      int a,b;
      string str;
      cin>>a>>b>>str;
      a--,b--;
      G[a].push_back((edge){b,(str=="yes")});
      G[b].push_back((edge){a,(str=="yes")});
    }
    //make_data();
    solve();
  }
  return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:88:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   88 |   sort(ans.begin(),ans.end());
      |   ^~~~
      |   short
Language: C++

#include <queue>
#include <string>
#include <vector>
#include <iostream>
using namespace std;
const int mod = 998244353;
int m, p1, p2, a, b; string s;
int main() {
	while (cin >> m >> p1 >> p2, m) {
		vector<vector<pair<int, int> > > G(p1 + p2);
		for (int i = 0; i < m; i++) {
			cin >> a >> b >> s; a--, b--;
			G[a].push_back(make_pair(b, s == "yes" ? 0 : 1));
			G[b].push_back(make_pair(a, s == "yes" ? 0 : 1));
		}
		vector<int> col(p1 + p2), comp(p1 + p2);
		vector<bool> vis(p1 + p2);
		vector<vector<int> > comps;
		for (int i = 0; i < p1 + p2; i++) {
			if (vis[i]) continue;
			queue<int> que; que.push(i);
			vector<int> w;
			while (!que.empty()) {
				int u = que.front(); que.pop();
				for (pair<int, int> j : G[u]) {
					if (!vis[j.first]) {
						vis[j.first] = true;
						col[j.first] = col[u] ^ j.second;
						w.push_back(j.first);
						que.push(j.first);
					}
				}
			}
			comps.push_back(w);
		}
		vector<int> e1(comps.size()), e2(comps.size());
		for (int i = 0; i < comps.size(); i++) {
			for (int j : comps[i]) {
				if (col[j] == 0) e1[i]++;
				else e2[i]++;
			}
		}
		vector<vector<int> > dp(comps.size() + 1, vector<int>(p1 + 1, false)); dp[0][0] = true;
		vector<vector<vector<int> > > dp2(comps.size() + 1, vector<vector<int> >(p1 + 1));
		for (int i = 0; i < comps.size(); i++) {
			for (int j = 0; j <= p1; j++) {
				if (j >= e1[i] && dp[i][j - e1[i]]) {
					dp[i + 1][j] += dp[i][j - e1[i]];
					dp2[i + 1][j] = dp2[i][j - e1[i]];
					dp2[i + 1][j].push_back(i);
				}
				if (j >= e2[i] && dp[i][j - e2[i]]) {
					dp[i + 1][j] += dp[i][j - e2[i]];
					dp2[i + 1][j] = dp2[i][j - e2[i]];
				}
				dp[i + 1][j] %= mod;
			}
		}
		if (dp[comps.size()][p1] != 1) cout << "no" << endl;
		else {
			vector<int> res = dp2[comps.size()][p1];
			vector<bool> ret(p1 + p2, true);
			for (int i = 0; i < comps.size(); i++) {
				for (int j : comps[i]) {
					if (col[j] ^ (binary_search(res.begin(), res.end(), i) ? 0 : 1)) ret[j] = false;
				}
			}
			for (int i = 0; i < p1 + p2; i++) {
				if (ret[i]) cout << i + 1 << endl;
			}
			cout << "end" << endl;
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:65:55: error: 'binary_search' was not declared in this scope
   65 |                                         if (col[j] ^ (binary_search(res.begin(), res.end(), i) ? 0 : 1)) ret[j] = false;
      |                                                       ^~~~~~~~~~~~~
Language: C++

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

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

const int INF=1001001001;
const int INFLL=1001001001001001001ll;
const int mod=1000000007;
inline void add(int &a,int b){
    a+=b;
    if(a>=mod)a-=mod;
}

int N,X,Y;

int par[1111];
int cntx[1111],cnty[1111];

init(){
    for(int i=0;i<2*(X+Y);i++){
        par[i]=i;
        cntx[i]=i%2==0;
        cnty[i]=i%2==1;
    }
}
int find(int x){
    return x==par[x]?x:par[x]=find(par[x]);
}
void unite(int x,int y){
    x=find(x);y=find(y);
    if(x==y)return;
    cntx[x]+=cntx[y];
    cnty[x]+=cnty[y];

    par[y]=x;
}

int dp[1111][1111];
void solve(){
    int M=X+Y;

    init();
    rep(i,N){
        int a,b;
        string s;
        cin>>a>>b>>s;
        a--;b--;

        a*=2;b*=2;
        if(s=="no")b++;
        unite(a,b);
        unite(a^1,b^1);
    }

    set<int>rs;

    vpint lis;

    rep(i,M){
        int r1=find(i*2);
        int r2=find(i*2+1);
        if(rs.find(r1)!=rs.end())continue;
        lis.pb({r1,r2});
        rs.insert(r1);rs.insert(r2);
    }

    memset(dp,0,sizeof(dp));
    dp[0][0]=1;

    for(int k=0;k<lis.size();k++){
        auto &p=lis[k];
        for(int i=0;i<=M;i++){
            if(i-cntx[p.fi]>=0)add(dp[k+1][i],dp[k][i-cntx[p.fi]]);
            if(i-cntx[p.se]>=0)add(dp[k+1][i],dp[k][i-cntx[p.se]]);
        }
    }

    if(dp[lis.size()][X]!=1){
        puts("no");
        return;
    }

    set<int>crs;

    for(int k=lis.size()-1;k>=0;k--){
        auto &p=lis[k];
        if(X-cntx[p.fi]>=0&&dp[k][X-cntx[p.fi]]){
            crs.insert(p.fi);
            X-=cntx[p.fi];
        }
        else{
            crs.insert(p.se);
            X-=cntx[p.se];
        }
    }

    rep(i,M){
        if(crs.find(find(i*2))!=crs.end())printf("%lld\n",i+1);
    }
    puts("end");
}

signed main(){
    while(cin>>N>>X>>Y,N||X||Y)solve();
    return 0;
}

Compiler output:
a.cc:31:1: error: ISO C++ forbids declaration of 'init' with no type [-fpermissive]
   31 | init(){
      | ^~~~
a.cc: In function 'int init()':
a.cc:37:1: warning: no return statement in function returning non-void [-Wreturn-type]
   37 | }
      | ^
Language: Java

import java.util.*;
class Main{
	public static void main(ping[] args){
		Scanner s=new Scanner(System.in);
		int a=s.nextInt();
		for(int i=0;i<a;i++){
			ping command=s.next();
			String str=s.next();
			for(int j=command.length()-1;j>=0;j--){
				switch(command.charAt(j)){
					case 'J':
						str=str.charAt(str.length()-1)+str.substring(0,str.length()-1);
						break;
					case 'C':
						str=str.substring(1)+str.charAt(0);
						break;
					case 'E':
						if(str.length()%2==0)
							str=str.substring(str.length()/2)+str.substring(0,str.length()/2);
						else str=str.substring(str.length()/2+1)+str.charAt(str.length()/2)+str.substring(0,str.length()/2);
						break;
					case 'A':
						String n="";
						for(int k=str.length()-1;k>=0;k--)n+=str.charAt(k);
						str=n;
						break;
					case 'P':
						for(int k=0;k<str.length();k++){
							if('1'<=str.charAt(k)&&str.charAt(k)<='9'){
								str=str.substring(0,k)+(char)(str.charAt(k)-1)+str.substring(k+1);
							}else if(str.charAt(k)=='0')str=str.substring(0,k)+'9'+str.substring(k+1);
						}
						break;
					case 'M':
						for(int k=0;k<str.length();k++){
							if('0'<=str.charAt(k)&&str.charAt(k)<='8'){
								str=str.substring(0,k)+(char)(str.charAt(k)+1)+str.substring(k+1);
							}else if(str.charAt(k)=='9')str=str.substring(0,k)+'0'+str.substring(k+1);
						}
						break;
				}
			}
			System.out.println(str);
		}
	}
}

Compiler output:
Main.java:3: error: cannot find symbol
	public static void main(ping[] args){
	                        ^
  symbol:   class ping
  location: class Main
Main.java:7: error: cannot find symbol
			ping command=s.next();
			^
  symbol:   class ping
  location: class Main
2 errors