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

#include <iostream>
#include <algorithm>
#include <numeric>
#include <vector>
#include <map>
#include <set>
#include <list>
#include <unordered_set>
#include <cmath>
using namespace std;
typedef long long ll;
typedef unordered_set<int> uset;

int main( int argc, char* argv[] ){
  string s;
  int K;
  cin >> s >> K;
  int L=s.size();
  set<string> v;
  for( int i=0; i<L; ++i ){
    for( int l=1; l<=L-i; ++l ){
      string x = s.substr(i,l);
      if( v.size() < K ){
        v.insert(x);
      } else {
        if( *(v.rbegin()) < x ){ continue; } 
        v.insert(x);
        v.erase( *(v.rbegin()) ); 
      // for( auto a : v ) cerr << " " << a ; cerr << endl;
    }
  }
  cout << *(v.rbegin()) << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:34:2: error: expected '}' at end of input
   34 | }
      |  ^
a.cc:14:35: note: to match this '{'
   14 | int main( int argc, char* argv[] ){
      |                                   ^
Language: C++

#include<iostream>
#include<map>
#include<ctime>
#include<algorithm>
#include<cmath>
using namespace std;
struct str{
   char * start,* end;
   str(char * c1=0,char *c2=0):start(c1),end(c2){}
   void pri()
   {
      while(1)
      {
         printf("%c",*start);
         if(start==end)
            break;
         start++;
      }
   }
   bool operator==(str s2)
   {
      str s1=*this;
      while(1)
      {
         
         if(*s1.start==*s2.start){
            if(s1.start==s1.end||s2.start==s2.end)
               break;
            s1.start++;s2.start++;
            
         }
         else
            return 0;
      }
      if(s1.start==s1.end&&s2.start==s2.end)
         return 1;
      return 0;
   }
};

bool cmp(str s1,str s2)
{
   while(1)
   {
      if(*s1.start<*s2.start)
         return 1;
      else if(*s1.start>*s2.start)
         return 0;
      if(s1.start==s1.end)
         return 1;
      if(s2.start==s2.end)
         return 0;
      s1.start++;s2.start++;
   }
}
char s[5005];
str asend[25003],t[5];
int main()
{
   int k;
   cin>>s>>k;
   int l=strlen(s),p=0;
   for(int i=0;i<l;i++){
      for(int j=i,k=0;j<l&&k<5;j++,k++)
      {
         asend[p++]=str(s+i,s+j);
      }
   }
   sort(asend, asend+p, cmp);
   if(k!=1)
      for(int i=2,j=2;;j++,i++)
      {
         if(asend[i]==asend[i-1])
            j--;
         if(j==k)
         {
            asend[i].pri();
            return 0;
         }
      }
   else
      asend[0].pri();
   
   
}









//int cow[5005];
//int f[5005];
//int n,res;
//int cow_rev(int k)
//{
//   memset(f, 0, sizeof f);
//   int ans=0,sum;
//   for(int i=0;i+k<n;i++)
//   {
//
//   }
//   for(int i=n-k;i<n;i++)
//   {
//
//   }
//   return ans;
//}
//
//int main()
//{
//   cin>>n;
//   char c;
//   for(int i=0;i<n;i++)
//   {
//      cin>>c;
//      cow[i]=c=='F'?0:1;
//   }
//   for(int i=1;i<=n;i++)
//   {
//
//   }
//}


Compiler output:
a.cc: In function 'int main()':
a.cc:62:10: error: 'strlen' was not declared in this scope
   62 |    int l=strlen(s),p=0;
      |          ^~~~~~
a.cc:6:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    5 | #include<cmath>
  +++ |+#include <cstring>
    6 | using namespace std;
a.cc:66:16: error: 'p' was not declared in this scope
   66 |          asend[p++]=str(s+i,s+j);
      |                ^
a.cc:69:22: error: 'p' was not declared in this scope
   69 |    sort(asend, asend+p, cmp);
      |                      ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int n;
char s[5001];
char* findsub(char *str,int begin,int range)
{
char res[5001]="\0";
for(int i=begin;i<(begin+range);i++)
{
char c[2]={str[i],'\0'};
res=strcat(res,c);
}
return res;
}
char* getsub(char *str,int begin)
{
return &(str[begin]);
}
bool comp(int x,int y)
{
return ((strcmp(getsub(s,x),getsub(s,y))>0)?true:false);
}
int main()
{
int i,j,begin,range;
vector<int> lex;
cin>>s>>n;
int len=strlen(s);
for(i=0;i<len;i++)
lex.push_back(i);
sort(lex.begin(),lex.end(),comp);
int begin_lex=0;
begin=lex[begin_lex];range=1;
for(i=0;i<n;i++)
{
if((begin+range)==len)
{
begin_lex++;
begin=lex[begin_lex];
range=1;
}
else range++;
}
cout<<findsub(s,begin,range);
return 0;
}

Compiler output:
a.cc: In function 'char* findsub(char*, int, int)':
a.cc:11:4: error: incompatible types in assignment of 'char*' to 'char [5001]'
   11 | res=strcat(res,c);
      | ~~~^~~~~~~~~~~~~~
a.cc:13:8: warning: address of local variable 'res' returned [-Wreturn-local-addr]
   13 | return res;
      |        ^~~
a.cc:7:6: note: declared here
    7 | char res[5001]="\0";
      |      ^~~
Language: C++

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

int main(){
	string s;
  	int k;
  	cin >> s >> k;
  	set<string> da;
  	for (int i=0;i<s.size();i++){
    	for (int j=1;j<=min(k,s.size()-i);j++){
      	string t=s.substr(i,j);
        da.insert(t);
        }
    }
  	auto pos = da.begin();
    for(int i = 0; i < k-1; i++)pos++;
  	cout << *pos << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:28: error: no matching function for call to 'min(int&, std::__cxx11::basic_string<char>::size_type)'
   10 |         for (int j=1;j<=min(k,s.size()-i);j++){
      |                         ~~~^~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:10:28: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'})
   10 |         for (int j=1;j<=min(k,s.size()-i);j++){
      |                         ~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:10:28: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   10 |         for (int j=1;j<=min(k,s.size()-i);j++){
      |                         ~~~^~~~~~~~~~~~~~
Language: C++

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

int main() {
    string s;
    int k;
    cin >> s >> k;

    vector<string> vc;

    int sl = s.length();
    for (int i = 0; i < sl; i++) {
        for (int j = 1; j <= min(k, sl - i); j++) {
            vc.push_back(s.substr(i, j));
        }
    }

    sort(vc.begin(), vc.end());
    vc.erase(unique(vc.begin(), vc.end()), vc.end());
    cout << vc[i-1] << "\n";
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:16: error: 'i' was not declared in this scope
   23 |     cout << vc[i-1] << "\n";
      |                ^
Language: C++

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

int main() {
    string s;
    int k;
    cin >> s >> k;

    string mins = s.substr(0, 5);
    for (int i = 0; i < s.length() - 4; i++) {
        if (s.substr(i, 5) < mins ) {
            mins = s.substr(i, 5);
        }
    }
    cout << mins << "\n";
    return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:17:14: error: expected '}' at end of input
   17 |     return 0;
      |              ^
a.cc:5:12: note: to match this '{'
    5 | int main() {
      |            ^
Language: C++

s=raw_input()
k=input()
t=len(s)
a=[]
for i in  range(0,t):
    for j in range(i,min(i+5,t)):
        a.append(s[i:j+1])
a=sorted(set(a))
print a[k-1]

Compiler output:
a.cc:1:1: error: 's' does not name a type
    1 | s=raw_input()
      | ^
Language: Java

import java.util.*;

class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    int k = sc.nextInt();
    List<String> sub = new ArrayList<String>();
    String c;
    int count;
    for(int i = 0;i < s.length();i++){
      count++;
      for(int j = i+1;j <= s.length();j++){
        c = s.substring(i,j);
        if(!sub.contains(c)){
          sub.add(c);
        }
        count++;
        if(count == k){
          break;
        }
      }
    }
    Collections.sort(sub);
    System.out.println(sub.get(k-1));
  }
}

Compiler output:
Main.java:12: error: variable count might not have been initialized
      count++;
      ^
1 error
Language: C++

#include <iostream>
#include <cmath>
#include <string>
#include <set>
#include <vector>
using namespace std;
int main(){
        string s; cin >> s;
        int k; cin >> k;
        set<string> sets;
        for(int i=0; i<s.size(); i++) {
                for(int j=1; j<s.size()-i+1; j++) {
                        sets.insert(s.substr(i,j));
                }
        }

        vector<string> ss(sets.begin(),sets.end());
        sort(ss.begin(),ss.end());
        cout << ss[k-1] << endl;
        return 0;
}


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

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

int int_sort( const void * a , const void * b ) {
  return strcmp(( char * )a , ( char * )b );
}

int main(void){
	char s[5001];
	int K;
	int i,j;
	scanf("%s",s);
	scanf("%d",&K);
	
	char kouho[25000][6];
	int index = 0;
	
	
	for(i=0;s[i] != '\0';i++){
		for(j=1; s[i+j-1] != '\0' ;j++){
			if(j>5) break;
			copy(kouho[index],&s[i],j);
			index++;
		}
	}
		
	
	qsort(kouho,index,sizeof(kouho[0]),int_sort);

	int ex[25000];
	for(i=0;i<25000;i++){
		ex[i] = 1;
	}
	for(i=0;i<index;i++){
		if(check(kouho[i],kouho[i+1]) == 0){
			ex[i+1] = -1;
		}
	}
	
		
	int count = 0,flag = 0;
	i = 0;
	while(flag <= K){
		if(ex[i] > 0){
			count = i;
			flag++;
		}
		i++;
	}
	
	
	printf("%s",kouho[count-1]);
	
	
	return 0;}

Compiler output:
main.c: In function 'main':
main.c:23:25: error: implicit declaration of function 'copy'; did you mean 'bcopy'? [-Wimplicit-function-declaration]
   23 |                         copy(kouho[index],&s[i],j);
      |                         ^~~~
      |                         bcopy
main.c:36:20: error: implicit declaration of function 'check' [-Wimplicit-function-declaration]
   36 |                 if(check(kouho[i],kouho[i+1]) == 0){
      |                    ^~~~~
Language: C++

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

int main() {

    string s;
    cin >> s;
    vector<string> v;

    for(int i = 0; i < s.size(); i++) {
        for(int j = i; j < s.size() && j < i+6; j++) {
            v.push_back(s.substr(i, j-i+1));
        }
    }
    sort(v.begin(), v.end());
    v.erase(unique(v.begin(), v.end()), v.end());

    int k;
    cin >> k;
    cout << v[k-1] << endl;

    return 0;
}

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

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

int main(void){
	string s;
	int pos;
	cin >> s;
	cin >> pos;

	vector<string> t;
	for(int i=0; i<s.size(); i++){
		for(int j=1; j<=5; j++){
			t.push_back(s.substr(i,j));
		}
	}
	sort(t.begin(),t.end());
	unique(t.begin(),t.end());
	cout << t[pos-1] << endl;
}

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

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

int main(){
	string s;
	cin >> s;
	
	int K;
	cin >> K;
	
	vector<string> strs;
	
	for(int i = 0; i < s.size(); i++){
		for(int j = 1; j < K; j++){
			if(i + j > s.size()) continue;
			strs.push_back(s.substr(i, j));
		}
	}
	
	sort(strs.begin(), strs.end());
	strs.erase(unique(strs.begin(), strs.end()), strs.end());
	
	cout << strs[K-1] << endl;
	
	return 0;
}

Compiler output:
a.cc:1:10: fatal error: bits/c++.h: No such file or directory
    1 | #include <bits/c++.h>
      |          ^~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <vector>
typedef long long ll;

#define FOR(i,a,b) for(ll i = (a);i < (b);++i)
#define REP(i,n) FOR(i,0,n)

#define debug(x) cout << #x << "=" << x << endl;

using namespace std;

int main(void){

    string str;
    int n;

    cin >> str;
    cin >> n;

    vector<string> vec;
    REP(i,str.size()){
        FOR(width,1,n+1){
            if(i+width <= str.size())
                vec.push_back(str.substr(i,width));
        }
    }

    sort(vec.begin(), vec.end());
    unique(vec.begin(), vec.end());
    cout << vec[n-1] << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   28 |     sort(vec.begin(), vec.end());
      |     ^~~~
      |     short
a.cc:29:5: error: 'unique' was not declared in this scope
   29 |     unique(vec.begin(), vec.end());
      |     ^~~~~~
Language: Java

import java.io.PrintWriter;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;


public class TestClass {

  private static final Scanner in = new Scanner(System.in);
  private static final PrintWriter out = new PrintWriter(System.out);
  private static final Set<String> set = new TreeSet<>();

  private static long[] nextArray(int n) {
    long[] arr = new long[n];
    for (int i = 0; i < n; i++) {
      arr[i] = in.nextLong();
    }
    return arr;
  }

  public static void main(String[] args) {
    String s = in.next();
    int k = in.nextInt();
    solve(s,k);
    int i = 0;
    for (String string : set){
      if (i == k - 1){
        out.println(string);
      }
      i++;
    }
    out.flush();
    out.close();
  }

  private static void solve(String str, int k) {
    for (int i = 0; i < str.length(); i++) {
      for (int j = i + 1; j <= str.length(); j++) {
        if (str.substring(i, j).length() <= k) {
          set.add(str.substring(i, j));
        }
      }
    }
  }


}

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

#include<bits/stdc+++.h>
#include<vector>
using namespace std;
vector<string> v;
string buf[5001];
int main(){
	string s=buf;
	cin>>buf;
	for(int i=0;i<s.length();i++){
		for(int j=i+1;j<s.length;j<s.length()&&j<i+k;j++){
			v=push_back(s.substr(i,j-i+1));
		}
	}
	sort(v.begin,v.end);
	int k;
	cin>>k;
	k--;
	erase(unique(v.begin(),v.end()),v.end());
	cout<<v[k];
}

Compiler output:
a.cc:1:9: fatal error: bits/stdc+++.h: No such file or directory
    1 | #include<bits/stdc+++.h>
      |         ^~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc+++.h>
using namespace std;
vector<string> c;
string buf[5001];
int main(){
	string s=buf;
	cin>>buf;
	for(int i=0;i<s.length();i++){
		for(int j=i+1;j<s.length;j<s.length()&&j<i+k;j++){
			v=push_back(s.substr(i,j-i+1));
		}
	}
	sort(v.begin,v.end);
	int k;
	cin>>k;
	k--;
	erase(unique(v.begin(),v.end()),v.end());
	cout<<v[k];
}

Compiler output:
a.cc:1:9: fatal error: bits/stdc+++.h: No such file or directory
    1 | #include<bits/stdc+++.h>
      |         ^~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namespace std;
vector(string);
string s;
int main()
{
	cin>>s;
	int k;
	cin>>k;
	for(int i=0;i<s.length();i++)
	{
		for(int j=i;j<s.length()&&j<i+k;j++)
		{
			v.push_back(s.substr(i,j-i+1))
		}
	}
	sort(v.begin(),v.end());
	k--;
	v.erase(unique(v.begin),v.end(),v.end())
	printf("%s\n",v[k].c_str());
	return 0;
}

Compiler output:
a.cc:3:1: error: deduction guide for 'std::vector<_Tp, _Alloc>' must have trailing return type
    3 | vector(string);
      | ^~~~~~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:428:11: note: 'template<class _Tp, class _Alloc> class std::vector' declared here
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
a.cc: In function 'int main()':
a.cc:14:25: error: 'v' was not declared in this scope
   14 |                         v.push_back(s.substr(i,j-i+1))
      |                         ^
a.cc:17:14: error: 'v' was not declared in this scope
   17 |         sort(v.begin(),v.end());
      |              ^
Language: C++

#include<bits/stdc++.h>
#include<vector>
using namespace std;
vector<string> v;
string buf[5002],s;

int main()
{
	cin>>s;
	for(int i=0;i<s.size();i++)
		for(int j=i;j<s.size() && j<i+6;j++) {
			v.push_back(s.substr(i,j-i+1))
		}
	sort(v.begin(),v.end());
	int k;
	cin>>k;
	k--;
	v.erase(unique(v.begin(),v.end()),v.end());
	cout<<v[k];
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:55: error: expected ';' before '}' token
   12 |                         v.push_back(s.substr(i,j-i+1))
      |                                                       ^
      |                                                       ;
   13 |                 }
      |                 ~
Language: C++

#include<bits/stdc++.h>
#include<vector>
using namespace std;
vector<string> v;
string buf[5002];

int main()
{
	cin>>s;
	for(int i=0;i<s.size();i++)
		for(int j=i;j<s.size() && j<i+6;j++) {
			v.push_back(s.substr(i,j-i+1))
		}
	sort(v.begin(),v.end());
	int k;
	cin>>k;
	k--;
	v.erase(unique(v.begin(),v.end()),v.end());
	cout<<v[k];
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:14: error: 's' was not declared in this scope
    9 |         cin>>s;
      |              ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
	string s;
 	int k;
 	cin >>s>>k;
	set<string> str;
	int len = s.length();
	for( int i = 0; i < len; i++ ) 
	{
    	for( int w = 0; i + w < len; w++ )
		{
    		string t = s.substr( i, w + 1 );
   			str.insert( t );
   			if( t.length() > K ) 
			{
    			break;
    		}
		}
  	}
  	int cnt = 0;
  	for( auto itr = str.begin(); itr != str.end(); itr++ ) 
	{
    	if( cnt == K - 1 ) 
		{
      		cout << *itr << endl;
    	}
        cnt+=1;
  	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:42: error: 'K' was not declared in this scope
   16 |                         if( t.length() > K )
      |                                          ^
a.cc:25:20: error: 'K' was not declared in this scope
   25 |         if( cnt == K - 1 )
      |                    ^
Language: C++

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

long long gcd(long long aaa,long long bbb) {
    if(bbb==0) {
        return aaa;
    }
    return gcd(bbb,aaa%bbb);
}

int main (){

    string s,tmp[25000000],tmpp;
    ll K,count=0,countt=0;
    map<string,ll>m;
    cin >> s >> K;
    ll tmppp = max(s.size(),K);
    for(int i = tmppp; i >= 1; i--) {
        for(int j = 0; j <= s.size()-i; j++) {
            tmpp = s.substr(j,i);
            m[tmpp]++;
            if(m[tmpp] == 1) {
                tmp[count] = s.substr(j, i);
                count++;
            }
        }
    }
    sort(tmp,tmp+count);
    cout << tmp[K-1] << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:19: error: no matching function for call to 'max(std::__cxx11::basic_string<char>::size_type, ll&)'
   18 |     ll tmppp = max(s.size(),K);
      |                ~~~^~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:18:19: note:   deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'll' {aka 'long long int'})
   18 |     ll tmppp = max(s.size(),K);
      |                ~~~^~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:18:19: note:   mismatched types 'std::initializer_list<_Tp>' and 'long unsigned int'
   18 |     ll tmppp = max(s.size(),K);
      |                ~~~^~~~~~~~~~~~
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <tuple>
#include <algorithm>
#define REP(i,k,n) for(int(i)=(k);(i)<(n);++(i))
using namespace std;

string s;
int K;

int main()
{
  cin >> s >> K;
  int N = s.length();           // |s|

  // sの長さKまでの部分文字列
  vector<string> vec;

  REP(j,1,K+1) {
    REP(i,0,N) {
      // cout << "i = " << i << ' ';
      // cout << "j = " << j << ' ';
      // cout << "N = " << N << endl;

      if (i + j > N) break;     // ??
      // 長さ j の部分文字列
      vec.push_back(s.substr(i,j));
      // cout << s.substr(i,j) << endl;
    }
  }

  sort(vec.begin(), vec.end());
  unique(vec.begin(), vec.end());

  assert(vec.size() >= K);
  cout << vec[K - 1] << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:9: warning: ignoring return value of '_FIter std::unique(_FIter, _FIter) [with _FIter = __gnu_cxx::__normal_iterator<__cxx11::basic_string<char>*, vector<__cxx11::basic_string<char> > >]', declared with attribute 'nodiscard' [-Wunused-result]
   34 |   unique(vec.begin(), vec.end());
      |   ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:5:
/usr/include/c++/14/bits/stl_algo.h:891:5: note: declared here
  891 |     unique(_ForwardIterator __first, _ForwardIterator __last)
      |     ^~~~~~
a.cc:36:3: error: 'assert' was not declared in this scope
   36 |   assert(vec.size() >= K);
      |   ^~~~~~
a.cc:6:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
    5 | #include <algorithm>
  +++ |+#include <cassert>
    6 | #define REP(i,k,n) for(int(i)=(k);(i)<(n);++(i))
Language: Java

package yuta4030.com.github.AtCoderBeginnerContest._097;
/*
https://beta.atcoder.jp/contests/abc097/tasks/arc097_a
 */

import java.util.*;

public class K_thSubstring {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        int ans2 = sc.nextInt();
        Set<String> set = new HashSet<>();

        for (int i = 0; i < str.length(); i++) {
            set.add(String.valueOf(str.charAt(i)));

            if(set.size() == 26){
                break;
            }
        }

        List<String> list = new ArrayList<>(set);
        Collections.sort(list);

        Set<String> ans = new HashSet<>();
        int pos = 0;
        for (int i = 0; i < set.size(); i++) {
            while(true){
                pos = str.indexOf(list.get(i), pos);
                if(pos == -1){
                    break;
                }

                int count = 0;
                for (int k = pos; k < str.length(); k++) {
                    ans.add(str.substring(pos, k + 1));

                    if(count++ == 6){
                        break;
                    }
                }
                pos++;
            }

            if(ans.size() > ans2){
                break;
            }
        }

        list = new ArrayList<>(ans);
        Collections.sort(list);
        System.out.println(list.get(ans2 - 1));
    }

}


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

#include "stdafx.h"
#include<iostream>
#include<cmath>
#include<algorithm>
#include<string>
#include<vector>
using namespace std;



int main()
{
	string s;
	int k;
	cin >> s >> k;
	bool find_k_nd_sub_s;
	vector<string> substrings;
	for (int i1 = 1; i1 <= s.size(); ++i1) {		//i1はsubstringsの大きさ
		for (int i2 = 0; i2 < s.size() - i1 + 1; ++i2) {					//i2はsubstringをsのどこからはじめるかを示す
			//i1とi2で定められた大きさと開始位置に従って一意なsubstringを形成
			string substring = "";
			for (int i3 = 0; i3 < i1; ++i3) {
				substring += s[i3 + i2];
			}
			//形成されたsubstringをvectorに格納する
			substrings.push_back(substring);
		}
	}
	sort(substrings.begin(), substrings.end());
	vector<string> substr;
	string cu;
	string pr = "";
	for (int i = 0; i < substrings.size(); ++i) {
		cu = substrings[i];
		if (cu != pr) {
			substr.push_back(substrings[i]);
		}
	}

	cout << substr[k - 1];
}

Compiler output:
a.cc:1:10: fatal error: stdafx.h: No such file or directory
    1 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <string>
#include <vector>

using namespace std;

string substrsearch(string s,int k){
    substrsearch(s,k);
    return s;
}

int main(){
    int k;
    string s;
    int a[5000];
    cin >> s;
    cin >> k;
    string ans;
    bool flag=false;
//    cout <<(int)s.size()-k<<endl;
    ans="zzzzzzzzzzzzzzzzzzzzzzzzzzzz";
    for(int i=0;i<=(int)(s.size())-k;i++){
//        cout <<s.substr(i,k)<<endl;
        ans=(ans < s.substr(i,k)) ? ans : s.substr(i,k);
        flag=true;
    }
    if(flag){
        cout <<ans<<endl;
        return 0;
    }

    vector<string> l(k+1);
    int m=k;
    for(int tmp=0;tmp<m;tmp++){
        l[tmp]="zzzzzzzz";
    }
//    string second="zzzzzz";
    for(int j=1;j<k ;){
        for(int i=0;i<=(int)s.size()-j;i++){
            for(int tmp=0;tmp<m;tmp++){
                if (l[tmp]==s.substr(i,j))continue;
                if (l[tmp]>s.substr(i,j)){
                    l[tmp]=s.substr(i,j);
//                    cout <<l[tmp]<<endl;
                    break;
                }
            }
        }
        j++;
    }
    sort(l.begin(),l.end());
    
    cout << l[k-1] <<endl;

    return 0;
}

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

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

int main(int argc, char *argv[]) {  
	std::string s;
	int k;
	std::cin >> s >> k;
//	std::vector<std::string> ss;
	std::set<std::string> ss;
	for (int i = 0; i < s.length(); i++) {
		for (int j = 1; j <= std::min(s.length()-i, 5); j++) {
//			ss.push_back(s.substr(i, j));
			ss.insert(s.substr(i, j));
		}
	}
//	std::sort(ss.begin(), ss.end());
//	std::unique(ss.begin(), ss.end());
//	std::cout << ss[k-1];
int cnt = 1;
	for (auto it: ss) {
		if (cnt == k) {
			std::cout << it;
		}
		cnt++;
	}
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:14:46: error: no matching function for call to 'min(std::__cxx11::basic_string<char>::size_type, int)'
   14 |                 for (int j = 1; j <= std::min(s.length()-i, 5); j++) {
      |                                      ~~~~~~~~^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:14:46: note:   deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'int')
   14 |                 for (int j = 1; j <= std::min(s.length()-i, 5); j++) {
      |                                      ~~~~~~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:14:46: note:   mismatched types 'std::initializer_list<_Tp>' and 'long unsigned int'
   14 |                 for (int j = 1; j <= std::min(s.length()-i, 5); j++) {
      |                                      ~~~~~~~~^~~~~~~~~~~~~~~~~
Language: C++

#include <stdio.h>  
#include <string.h>  
#define MAXS 30  

 char *search( char *s, char *t);

int main()
{
	char s[MAXS], t[MAXS], *pos;

	gets(s);
	gets(t);
	pos = search(s, t);
	if (pos != NULL)
		printf("%d\n", pos - s);
	else
		printf("-1\n");

	return 0;
}

char *search(char *s, char *t)
{
	int i, j, k = 0, slen, tlen;
	char *p = NULL;

	slen = strlen(s);
	tlen = strlen(t);

	for (i = 0; i<slen; i++) {
		j = i;
		while (s[j] == t[k]) {
			k++;
			j++;
		}
		if (k >= tlen) {
			p = &s[i];
			return p;
		}
		k = 0;
	}

	return p;
}

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

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

int main(void){
    char c = 'a';
    string s, start;
    int K;
    ans[5];
    ma[30][5004];
    ans[1000000];
    
    ans[0] = start[0];

    for(int i ; i < s.length(); i++){
        for(int j =i; i < s.length(); j++){
            ans[i* s.length() + j] = str.substr(i, j);

        }
    }
    std::sort(s.begin(),s.end());
    cout << s[K] << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
    9 |     ans[5];
      |     ^~~
      |     abs
a.cc:10:5: error: 'ma' was not declared in this scope
   10 |     ma[30][5004];
      |     ^~
a.cc:17:38: error: 'str' was not declared in this scope; did you mean 'std'?
   17 |             ans[i* s.length() + j] = str.substr(i, j);
      |                                      ^~~
      |                                      std
Language: C++

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;
struct s
{
    char sr[5000];
    int num;
}ss[50000];
int cmp(s a,s b)
{
    if(strcmp(a.sr,b.sr)==-1)
    return 1;
    else
        return 0;
}
int main()
{
    char str[5000];
    int k,o,p,i,j;
    while(gets(str)!=NULL)
    {
        scanf("%d",&k);
        int m=0;
        int n=strlen(str);
        for(i=0;i<n;i++)
        {
            for(j=i;j<n;j++)
            {
                for(o=i,p=0;o<=j;o++,p++)
                    ss[m].sr[p]=str[o];
                ss[m].sr[p]='\0';
                m+=1;
            }
        }
        sort(ss,ss+((n+1)*n/2),cmp);

        if(k==1)
            printf("%s\n",ss[0].sr);
        else
        {
            j=1;
            for(i=1; i<((n+1)*n/2); i++)
            {
                if(strcmp(ss[i].sr,ss[i-1].sr)==0)
                    i++;
                else
                    j++;
                if(j==k)
                {
                    printf("%s\n",ss[j].sr);
                    break;
                }
            }
        }

    }
    return 0;
}


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

#include <stdio.h>  
#include <string.h>  
#define MAXS 30  
  
charchar *search(charchar *s, charchar *t);  
  
int main()  
{  
    char s[MAXS], t[MAXS], *pos;  
  
    gets(s);  
    gets(t);  
    pos = search(s, t);  
    if ( pos != NULL )  
        printf("%d\n", pos - s);  
    else  
        printf("-1\n");  
  
    return 0;  
}  
  
charchar *search(charchar *s, charchar *t){  
    int i,j,k=0,slen,tlen;  
    charchar *p=NULL;  
  
    slen = strlen(s);  
    tlen = strlen(t);  
  
    for(i=0;i<slen;i++){  
        j=i;  
        while(s[j]==t[k]){  
            k++;  
            j++;  
        }  
        if(k>=tlen){  
            p=&s[i];  
            return p;  
        }  
        k=0;  
    }  
  
    return p;  
}  

Compiler output:
a.cc:5:1: error: 'charchar' does not name a type
    5 | charchar *search(charchar *s, charchar *t);
      | ^~~~~~~~
a.cc: In function 'int main()':
a.cc:11:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
   11 |     gets(s);
      |     ^~~~
      |     getw
a.cc:13:11: error: 'search' was not declared in this scope
   13 |     pos = search(s, t);
      |           ^~~~~~
a.cc: At global scope:
a.cc:22:1: error: 'charchar' does not name a type
   22 | charchar *search(charchar *s, charchar *t){
      | ^~~~~~~~
Language: C++

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

int main(void){
    char c = 'a';
    string s, start;
    int K;
    ans[5];
    ma[30][5004];
    ans[1000000];
    
    ans[0] = start[0];

    for(int i ; i < s.length(); i++){
        for(int j =i; i < s.length(); j++){
            ans[i* s.length() + j] = str.substr(i, j)

        }
    }
    std::sort(s.begin(),s.end());
    cout << s[K] << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
    9 |     ans[5];
      |     ^~~
      |     abs
a.cc:10:5: error: 'ma' was not declared in this scope
   10 |     ma[30][5004];
      |     ^~
a.cc:17:38: error: 'str' was not declared in this scope; did you mean 'std'?
   17 |             ans[i* s.length() + j] = str.substr(i, j)
      |                                      ^~~
      |                                      std
Language: C++

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

typedef struct {
	char* start;
	size_t len;
} Substr;

Substr* substrs[25000000];
int substr_found = 0;

bool isLower(Substr* a, Substr* b) {
	if (a == b) return false;
	char astr[5001] = {0};
	char bstr[5001] = {0};
	strncpy(astr, a->start, a->len);
	strncpy(bstr, b->start, b->len);
	
	return (strcmp(astr, bstr) < 0);
}

void sort(int num) {
	if (substr_found < num) return;
	for (int i = 0; i < num && i < substr_found; i++) {
		int cur_top = i;
		for (int j = i+1; j < substr_found; j++) {
			if (isLower(substrs[j], substrs[cur_top])) cur_top = j;
		}
		
		// swap
		Substr* tmp = substrs[i];
		substrs[i] = substrs[cur_top];
		substrs[cur_top] = tmp;
	}
}
	
bool isAlreadyFound(Substr* s) {
	for (int i = 0; i < substr_found; i++) {
		char str_n[5001] = { 0 };
		strncpy(str_n, s->start, s->len);
		char str[5001] = { 0 };
		strncpy(str, substrs[i]->start, substrs[i]->len);
		if (!strcmp(str_n, str)) return true;
	}
	return false;
}

int main() {
	char s[5000 + 1];
	int k;
	scanf("%s %d", s, &k);
	
	if (!substrs) return 0;
	
	
	char* start = s;
	
	size_t len_all = strlen(s);
	
	bool opt_flag = false;
	if (len_all > 50) {
		int a_num = 0;
		for (char* i = s; i < len_all - 6; i++) 
			if (*i == 'a') a_num++;
		if (a_num) opt_flag = true;
	}
	
	for (; *start; start++) {
		if (len_all > 5 && *start > *s) continue;
		if (opt_flag && *start != 'a') continue;
		size_t slen = strlen(start);
		for (size_t len = 1; len <= slen; len++) {
			Substr* cur = (Substr*) malloc(sizeof(Substr));
			cur->start = start;
			cur->len = len;
			if (!isAlreadyFound(cur)) {
				substrs[substr_found] = cur;
				substr_found++;
			} else free(cur);
		}
	}
	
	sort(k);
	char res[5001] = {0};
	strncpy(res, substrs[k - 1]->start, substrs[k - 1]->len);
	printf("%s", res);
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:65:37: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   65 |                 for (char* i = s; i < len_all - 6; i++)
      |                                   ~~^~~~~~~~~~~~~
Language: C++

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

int main() {
	string s;
	int k, a = 1;
	cin >> s >> k;
	vector<string> sub(a);
	for(int i = 0; i <= s.size(); i++){
		for(int j = 1; j <= s.size() - i; j++){
			if(s.find(s.substr(i, j)) == basic_string::npos){
				sub.resize(a);
				sub.at(a - 1) = s.substr(i, j);
				a++;	
			}
		}
	}
	
	sort(sub.begin(), sub.end()/*, greater<string>()*/);
	
	cout << sub.at(1) << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:54: error: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_string' used without template arguments
   14 |                         if(s.find(s.substr(i, j)) == basic_string::npos){
      |                                                      ^~~~~~~~~~~~
Language: C

S = input()
K = int(input())
N = len(S)
tmp = []
lis = []
lis_uniq = []

for i in range(N):
    tmp = []
    for j in range(N-i):
        tmp.append(str(S[j:i+j+1]))

    tmp = list(set(tmp))
    tmp = sorted(tmp)
    lis_uniq = lis_uniq + tmp
    m = len(lis_uniq)
    #if(m > K+1):break

#print(lis_uniq)
print(lis_uniq[len(lis_uniq)-K])

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | S = input()
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'S' [-Wimplicit-int]
main.c:1:5: error: implicit declaration of function 'input' [-Wimplicit-function-declaration]
    1 | S = input()
      |     ^~~~~
main.c:1:5: error: initializer element is not constant
main.c:2:1: error: expected ',' or ';' before 'K'
    2 | K = int(input())
      | ^
main.c:17:17: error:  ':' without preceding '?'
   17 |     #if(m > K+1):break
      |                 ^
main.c:17: error: unterminated #if
   17 |     #if(m > K+1):break
Language: C++

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

int main() {
	string S;
	int K=0;
	char chara1 = 'a', chara2 ='a', chara3 = 'a', chara4 = 'a', chara5 = 'a';
	int c1, c2, c3, c4, c5;
	string sub;
	cin >> S>>K;
	for (int i = 0; i < S.size(); i++) {
		if (chara1 <= S[i]) {
			chara5 = chara4;
			chara4 = chara3;
			chara3 = chara2;
			chara2 = chara1;
			chara1 = S[i];
			c1 = i;
		}
		else if(chara2 <= S[i]) {
			chara5 = chara4;
			chara4 = chara3;
			chara3 = chara2;
			chara2 <= S[i];
			c2 = i;
		}
		else if (chara3 <= S[i]) {
			chara5 = chara4;
			chara4 = chara3; 
			chara3 <= S[i];
			c3 = i;
		}
		else if (chara4 <= S[i]) {
			chara5 = chara4;
			chara4 <= S[i];
			c4 = i;
		}
		else if (chara5 <= S[i]) {
			chara5 <= S[i];
			c5 = i;
		}

	}
	int flag = 0;
	int start,end;
	vector<int> a = { c1,c2,c3,c4,c5 };
	for (int i = 0; i < 5 ; i++) {
		for (int j = S.size-a[i]; j; j--) {
			flag ++ ;
			if (flag == K) {
				start = i;
				end = j;
				break;
			}
		}
		if (flag == K) break;
	}
	for (int i = start; i < end; i++) {
		cout << S[i];
	}
	cout << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:50:32: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   50 |                 for (int j = S.size-a[i]; j; j--) {
      |                              ~~^~~~
      |                                    ()
Language: C++

#include <iostream>
#include <string>
#include <set>
using namespace std;
int main(void){
	set<string> st;
	string s,ss;
	int k,len,i,j,diff;
	cin >> s;
	cin >> k;
	len = s.length();

	for(i = 'a'; i <= 'z'; i++){
		for(auto itr = s.begin(); itr != s.end(); itr++){
			if(*itr == i){
				diff = itr - s.begin();
				for(j = 1; diff+j <= len; j++)
					st.insert(s.substr(diff,j));			
			}
		}
		if(st.size() => k){
				i = 0;
				for(auto itr = st.begin(); itr != st.end(); ++itr) {
						i++;
						if(i == k)
							cout << *itr << endl;
				}
				return 0;
		}
	}
	
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:31: error: expected primary-expression before '>' token
   21 |                 if(st.size() => k){
      |                               ^
Language: Java

import java.io.PrintWriter;
import java.util.*;


public class TestClass {

  private static final Scanner in = new Scanner(System.in);
  private static final PrintWriter out = new PrintWriter(System.out);
  static List<String> list = new ArrayList<>();

  private static int[] nextArray(int n) {
    int[] arr = new int[n];
    for (int i = 0; i < n; i++) {
      arr[i] = in.nextInt();
    }
    return arr;
  }

  public static void main(String[] args) {
    String s = in.next();
    int k = in.nextInt();
    solve(s);
    if (list.size() < k) {
      out.println(list.get(list.size() - 1));
    } else {
      out.println(list.get(k - 1));
    }
    out.flush();
    out.close();
  }

  private static void solve(String str) {
    for (int i = 0; i < str.length(); i++) {
      for (int j = i + 1; j <= str.length(); j++) {
        list.add(str.substring(i, j));
      }
    }
    list = new ArrayList<>(new HashSet<>(list));
    Collections.sort(list);
  }
}


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

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

int main() {
	string s;
	int k;
	cin >> s;
	cin >> k;
	int n = s.size();
	string s1[5000], s2[5000], s3[5000], s4[5000], s5[5000];
	for (int i = 0;i < n;i++) s1[i] = s.at(i + 1);
	for (int i = 0;i < n - 1;i++)s2[i] = s.substr(i, 2);
	for (int i = 0;i < n - 2;i++)s3[i] = s.substr(i, 3);
	for (int i = 0;i < n - 3;i++)s4[i] = s.substr(i, 4);
	for (int i = 0;i < n - 4;i++)s5[i] = s.substr(i, 5);
	sort(s1, s1 + n);
	sort(s2, s2 + n - 1);
	sort(s3, s3 + n - 2);
	sort(s4, s4 + n - 3);
	sort(s5, s5 + n - 4);
	string ss[40000];
	memcpy(ss, s1, n);
	memcpy(&ss, s2, n - 1);
	memcpy(&ss, s3, n - 2);
	memcpy(&ss, s4, n - 3);
	memcpy(&ss, s5, n - 4);
	int ans = 0;
	for (int i = 0;i < k;i++) {
		if (ss[ans] == ss[ans + 1])i--;
		if (i = k - 1) {
			cout << ss[ans];
			break;
		}
		ans++;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:9: error: 'memcpy' was not declared in this scope
   24 |         memcpy(ss, s1, n);
      |         ^~~~~~
a.cc:4:1: note: 'memcpy' 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<bits/stdc++.h>
 2using namespace std;
 3main(){
 4  set<string>st;
 5  string str;
 6  int k;
 7  cin>>str>>k;
 8  for(int i=str.size();i>=0;i--){
 9    for(int j=0;j<=str.size()-i;++j){
10      int l=j;
11      string temp;
12      int ju=0;
13      while(l<str.size()-i){
14        if(!ju) temp=str[l];
15        else temp+=str[l];
16        ju=1;
17        ++l;
18      }
19      st.insert(temp);
20
21    }
22  }
23  auto itr=st.begin();
24  for(int i=0;i<k;i++) itr++;
25  cout<<*itr<<endl;
26      return 0;
27}

Compiler output:
a.cc:2:2: error: expected unqualified-id before numeric constant
    2 |  2using namespace std;
      |  ^~~~~~
a.cc:3:2: error: expected unqualified-id before numeric constant
    3 |  3main(){
      |  ^~~~~
Language: C

include<stdio.h>
int main()
{
   char s[];
   int K;
   scanf("%s",s);
   scanf("%d",&K);
   
   
}

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


import java.util.stream.Collectors;

public class Main {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        final String s=scanner.next();
        final int K=scanner.nextInt();
        final String alphabet="abcdefghijklmnopqrstuvwxyz";
        Set<String> sets=new HashSet<>();
        for(int i=0;i<s.length();i++){
            for(int j=i+1;j<=s.length();j++){
                sets.add(s.substring(i,j));
            }
        }
        System.out.println(sets.stream().sorted().collect(Collectors.toList()).get(K-1));


    }

}

Compiler output:
Main.java:6: error: cannot find symbol
        Scanner scanner=new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:6: error: cannot find symbol
        Scanner scanner=new Scanner(System.in);
                            ^
  symbol:   class Scanner
  location: class Main
Main.java:10: error: cannot find symbol
        Set<String> sets=new HashSet<>();
        ^
  symbol:   class Set
  location: class Main
Main.java:10: error: cannot find symbol
        Set<String> sets=new HashSet<>();
                             ^
  symbol:   class HashSet
  location: class Main
4 errors