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

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define pii pair<int,int>
#define pb push_back

int main()
{
	string s;
	cin>>s;
	string copy = s;
	int k;
	cin>>k;
	sort(copy.begin(),copy.end());
	if(copy[0]==copy[copy.length()-1])
	{
		for(int i=0;i<k;i++)
			cout<<copy[0];
		cout<<"\n";
		return 0;
	}
	
	set<string> arr;
	for(int k=97;k<123;k++){
	for(int i=0;i<s.length();i++)
	{
		if(s[i]==k){
		string x=(s.length()-i,'0');
		int l=0;
		for(int j=i;j<s.length();j++)
		{
			x[l++]=s[j];
			arr.insert(x);
			/*if(arr.size()>=k)
				break;*/
		}}
		/*if(arr.size()>=k)
			break;*/
	}
	if(arr.size()>=k)
		break;
}
auto it = arr.begin();
for(int i=0;i<k-1;i++)
	it++;
cout<<*it<<"\n";
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:40: error: conversion from 'char' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
   29 |                 string x=(s.length()-i,'0');
      |                                        ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define pii pair<int,int>
#define pb push_back

int main()
{
	string s;
	cin>>s;
	string copy = s;
	sort(copy.begin(),copy.end());
	if(copy[0]==copy[copy.length()-1])
	{
		for(int i=0;i<k;i++)
			cout<<copy[0];
		cout<<"\n";
		return 0;
	}
	int k;
	cin>>k;
	set<string> arr;
	for(int k=97;k<123;k++){
	for(int i=0;i<s.length();i++)
	{
		if(s[i]==k){
		string x="";
		for(int j=i;j<s.length();j++)
		{
			x=x+s[j];
			arr.insert(x);
			/*if(arr.size()>=k)
				break;*/
		}}
		/*if(arr.size()>=k)
			break;*/
	}
	if(arr.size()>=k)
		break;
}
auto it = arr.begin();
for(int i=0;i<k-1;i++)
	it++;
cout<<*it<<"\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:31: error: 'k' was not declared in this scope
   16 |                 for(int i=0;i<k;i++)
      |                               ^
Language: C++

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

long long MOD = 1e9+7;
int MAX_INT = 1e9;

// 最大公約数
long long gcd(long long a, long long b){
  if(b == 0) return a;
  return gcd(b, a % b);
}
// 最小公倍数
long long lcm(long long a, long long b) {
  return a / gcd(a, b) * b;
}

// x^y%p
long long modpow(long long x, long long y, long long p=1) {
    long long res = 1;
    x = x % p;
    if (x == 0) return 0;
    while (y > 0) {
        if (y & 1) res = res * x % p;
        y = y>>1;
        x = x * x % p;
    }
    return res;
}

int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(NULL);

  string s;
  int K;
  cin >> s >> K;

  set<string> s_substring;
  for(int i = 0; i < s.size(); i ++) {
    string tmp;
    for(int j = i; j < min((int)s.size(), i + 5); j++) {
      tmp.push_back(s[j]);
      s_substring.insert(tmp);
    }
  }

  set<string>::iterator itr = s_substring.begin();
  advance(itr, 4);

  cout << *itr << endl;

  return 0;
}


Compiler output:
a.cc:3:10: fatal error: atcoder/all: No such file or directory
    3 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll         = long long;
constexpr ll MOD = 1000000007;
#define REP(i, n) for (ll i = 0; i < (n); i++)
#define REP2(i, x, n) for (ll i = x; i < (n); i++)
#define PR(x) cout << (x) << "\n"
#define PS(x) cout << (x) << " "
#define PRYES(x) PR((x) ? "Yes" : "No")
const long long INF = numeric_limits<long long>::max();

template <class T> void dumpVector(const vector<T>& vec) {
#ifdef SOURCE_TEST
    for (ll i = 0; i < vec.size(); ++i) {
        cout << vec[i] << ",";
    }
    cout << endl;
#endif
}

template <class T> void distinct(vector<T>& vec) {
    // 配列から重複を削除する
    sort(vec.begin(), vec.end());
    vec.erase(unique(vec.begin(), vec.end()), vec.end());
}

int main() {
    string s;
    cin >> s;
    ll N;
    cin >> N;

    vector<string> strings;
    for (ll i = 0; i < s.size(); ++i) {
        for (ll j = 1; (i + j) <= s.size(); ++j) {
            if (i + j > K) continue;
            strings.push_back(s.substr(i, j));
        }
    }

    dumpVector(strings);
    sort(strings.begin(), strings.end());
    distinct(strings);

    PR(strings[N - 1]);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:25: error: 'K' was not declared in this scope
   36 |             if (i + j > K) continue;
      |                         ^
Language: C++

//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#include <algorithm>
#define rep(i,n) for(int i=0;i<(n);++i)
#define all(a) (a).begin(),(a).end()
using namespace std;
using Graph = vector<vector<int>>;
typedef long long ll;
//using Graph = vector<vector<pair<ll,ll>>>;
const int mod =1e+9+7;

const int dy[4]={0,1,0,-1};
const int dx[4]={1,0,-1,0};
const ll INF=1e10;

int main(){
    string s;
    ll k; cin>>s>>k;
    map<string,ll>mp;
    ll num=s.size();
    ll cnt=0;
    for(char c='a';c<='z';c++){
        for(int i=0;i<num;i++){
            if(s[i]==c){
                for(int j=1;j<=num-i;j++){
                    if(mp[s.substr(i,j)]>=1)continue++;
                    mp[s.substr(i,j)]++;
                    cnt++;
                }
            }
        }
        if(cnt>=k)break;
    }
    ll CNT=1;
    for(auto p:mp){
        if(CNT==k){
            cout<<p.first<<endl;
            return 0;
        }
        else CNT++;
    }
}











Compiler output:
a.cc: In function 'int main()':
a.cc:26:53: error: expected ';' before '++' token
   26 |                     if(mp[s.substr(i,j)]>=1)continue++;
      |                                                     ^~
      |                                                     ;
a.cc:26:55: error: expected primary-expression before ';' token
   26 |                     if(mp[s.substr(i,j)]>=1)continue++;
      |                                                       ^
Language: C++



#include <bits/stdc++.h>
#include <string.h>
#include <vector>
//s#define rep(i, n) for (int i = 0; i < (n); i++)
#define MAX 10000

using namespace std;

#define ll long long
#define pb push_back
//#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define rep(i,a,n) for(int i=a; i<n; i++)
#define INF (int)1e15
#define MOD 1000000007
//#define N 12
#define sz 1000*1000

 int  main(){

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

  int n = s.length();
 for(int i=0;i<n;i++){
      for(int j=1;j<=n-i;j++){
             if(j > k) break;
             string ans = s.substr(i,j);
                  ani.insert(ans); }

 }


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

 cout<<v[k-1]<<endl;

 return 0;
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:32:19: error: 'ani' was not declared in this scope; did you mean 'ans'?
   32 |                   ani.insert(ans); }
      |                   ^~~
      |                   ans
a.cc:38:8: 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]
   38 |  unique(v.begin(),v.end());
      |  ~~~~~~^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_algo.h:891:5: note: declared here
  891 |     unique(_ForwardIterator __first, _ForwardIterator __last)
      |     ^~~~~~
Language: C++


#include <bits/stdc++.h>
#include <string.h>
#include <vector>
//s#define rep(i, n) for (int i = 0; i < (n); i++)
#define MAX 10000

using namespace std;

#define ll long long
#define pb push_back
//#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define rep(i,a,n) for(int i=a; i<n; i++)
#define INF (int)1e15
#define MOD 1000000007
//#define N 12
#define sz 1000*1000

 int  main(){

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

  int n = s.length();
 for(int i=0;i<n;i++){
      for(int j=1;j<=n-i;j++){
             if(j > k) break;
                  ani.insert(ans); }

 }


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

 cout<<v[k-1]<<endl;

 return 0;
 }


Compiler output:
a.cc: In function 'int main()':
a.cc:30:19: error: 'ani' was not declared in this scope
   30 |                   ani.insert(ans); }
      |                   ^~~
a.cc:30:30: error: 'ans' was not declared in this scope; did you mean 'abs'?
   30 |                   ani.insert(ans); }
      |                              ^~~
      |                              abs
a.cc:36:8: 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]
   36 |  unique(v.begin(),v.end());
      |  ~~~~~~^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:891:5: note: declared here
  891 |     unique(_ForwardIterator __first, _ForwardIterator __last)
      |     ^~~~~~
Language: C++

#include "bits/stdc++.h"
#include <set>

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 rep1(i, n) for (int i = 1; i < (n); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
#define all(i) (i).begin(), (i).end()
#define rall(i) (i).begin(), (i).end(), greater<int>()
//#define int long long
#define elif else if
#define eb emplace_back
#define pb push_back
#define mp make_pair
#define fst first
#define sec second
#define mod 1000000007
#define INF 10e10
template <typename T>

void print(T x)
{
	std::cout << x << " ";
}
template <typename T>

void println(T x)
{
	std::cout << x << "\n";
}

signed main(void) {
	string s;
	int k;
	cin >> s >> k;
	set<string>st;
	if (s.size() == 1) {
		print(s);
		return; 0;
	}
	rep(i, s.size()) {
		rep1(j,s.size()-i+1) {
			string sub = s.substr(i, j);
			st.insert(sub);
		}
	}
	auto itr = st.begin();
	for (int i = 0; i < k-1;i++) {
		itr++;
	}
	print(*itr);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:17: error: return-statement with no value, in function returning 'int' [-fpermissive]
   41 |                 return; 0;
      |                 ^~~~~~
Language: C++

#include "bits/stdc++.h"
#include <set>

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 rep1(i, n) for (int i = 1; i < (n); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
#define all(i) (i).begin(), (i).end()
#define rall(i) (i).begin(), (i).end(), greater<int>()
#define int long long
#define elif else if
#define eb emplace_back
#define pb push_back
#define mp make_pair
#define fst first
#define sec second
#define mod 1000000007
#define INF 10e10
template <typename T>

void print(T x)
{
	std::cout << x << " ";
}
template <typename T>

void println(T x)
{
	std::cout << x << "\n";
}

signed main(void) {
	string s;
	int k;
	cin >> s >> k;
	set<string>st;
	if (s.size() == 1) {
		print(s);
		return; 0;
	}
	rep(i, s.size()) {
		rep1(j,s.size()-i+1) {
			string sub = s.substr(i, j);
			st.insert(sub);
		}
	}
	auto itr = st.begin();
	for (int i = 0; i < k-1;i++) {
		itr++;
	}
	print(*itr);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:17: error: return-statement with no value, in function returning 'int' [-fpermissive]
   41 |                 return; 0;
      |                 ^~~~~~
Language: C++

#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <math.h>
#include <string>
#include <numeric>
#include <queue>
#include <cstdio>
#include <cstring>
#define ll long long
#define rep(i,n) for(ll i=0;i<n;++i)
#define rep1(i,n) for(ll i=1;i<n;++i)
#define mrep(i,n) for(ll i=n;i>=0;--i)
#define all(a) (a).begin(),(a).end()
#define vl vector<ll>
#define vvl vector<vector<ll> >
#define vb vector<bool>
#define vvb vector<vector<bool> >
#define pl pair<ll,ll>
#define inf 1001001001001001000
//#define mod 1000000007
#define mod 998244353
#define pi 3.1415926535
using namespace std;
struct __INIT {
	__INIT() {
		cin.tie(0);
		ios::sync_with_stdio(false);
		cout << fixed << setprecision(15);
	}
}__init;

int main(void) {
    string s;
    ll k;
    cin>>s>>k;
    set<string> pitsu;
    if(s.size() <= 26*100){
        rep(i,s.size()){
            string t = "";
            for(ll j = i;j<s.size();j++){
                t += s[j];
                pitsu.insert(t);
            }
        }
        ll i = 0;
        for(string tmp:pitsu){
            if(i == k-1){
                cout<<tmp<<endl;
                return 0;
            }
            i++;
        }
    }
    else{
        vl kosu(26);
        rep(i,s.size()){
            kosu[s[i]-'a']++;
        }
        rep(i,26){
            if(kosu[i] >= k){
                ll t = "";
                rep(j,k) t += (char)(i+'a');
                cout<<t<<endl;
            }
        }
    }
    
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:65:24: error: invalid conversion from 'const char*' to 'long long int' [-fpermissive]
   65 |                 ll t = "";
      |                        ^~
      |                        |
      |                        const char*
Language: Java

import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        String s = scan.next();
        int k = scan.nextInt();
        HashSet<String> a = new HashSet<String>();

        for (int i=1;i<=Math.min(k,s.length());i++){
            for (int j=0;j<s.length()+1-i;j++){
                a.add(s.substring(j,j+i);
            }
        }
        ArrayList<String> b = new ArrayList<String>(a);
        Collections.sort(b);
        System.out.println(b.get(k-1));
    }
    
}

Compiler output:
Main.java:12: error: ')' or ',' expected
                a.add(s.substring(j,j+i);
                                        ^
1 error
Language: C++

#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i < (n+1); ++i)
const double PI  =3.141592653589793238463;
using namespace std;
using ll = long long;
const ll INF = +10010010000;
typedef pair<int,int> P;
const int mod = 1e9+7;

struct mint{
    ll x;
    mint(ll x=0):x((x%mod+mod)%mod){}
    mint& operator+=(const mint a){
        (x+=a.x)%=mod;
        return *this;
    }
    mint& operator-=(const mint a){
        (x-=mod-a.x)%=mod;
        return *this;
    }
    mint& operator*=(const mint a){
        (x *= a.x)%= mod;
        return *this;
    }
    mint operator+(const mint a)const{
        mint res(*this);
        return res+=a;
    }
    mint operator-(const mint a)const{
        mint res(*this);
        return res-=a;
    }
    mint operator*(const mint a)const{
        mint res(*this);
        return res*=a;
    }
    mint pow(ll t) const {
      if(!t)return 1;
      mint a = pow(t>>1);
      a*=a;
      if(t%1)a*=*this;
      return a;
    }

    // for prime mod
    mint inv() const {
      return pow(mod-2);
    }
    mint& operator/=(const mint a){
      return (*this) *= a.inv();
    }
    mint operator/(const mint a)const{
      mint res(*this);
      return res/=a;
    }
};

struct combination{
  vector<mint> fact, ifact;
  combination(int n):fact(n+1),ifact(n+1){
    fact[0] = 1;
    for(int i = 1; i<n;++i)fact[i] = fact[i-1] * i;
    ifact[n] = fact[n].inv();
    for(int i = n; i>=1;--i) ifact[i-1] = ifact[i] * i;
  }
  mint operator()(int n, int k){
    if(k<0 || k>n)return 0;
    return fact[n] * ifact[k] + ifact[n-k]; 
  }
};

int main(){
    string s;
    cin >> s;
    int k;cin >> k;
    int n = s.size();
    string subs;
    vector<string> p;
    p.push_back(subs);
    rep(l,n-1){
        subs = s.substr(l,1);
        p.push_back(subs);
        for(int r = l+2;r<n;++r){
            subs.push_back(s[r]);
            p.push_back(subs);
        }
    }
    sort(p.begin(),p.end());
    cout << p[k-1] <<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:91:22: error: expected primary-expression before '<' token
   91 |     cout << p[k-1] <<<endl;
      |                      ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n)for(int i=0;i<(n);i++)
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define pb push_back
using ll = long long;
using P = pair<int, int>;

int main(){
    string s; cin >> s;
    int k; cin >> k;
    vector<string> vec;
    for(int i = 0; i < s.size(); ++i){
        for(int j = 1; j <= k; ++j){
            string tmp = s.substr(i,j);//初め,文字数
            vec.push_back(tmp);
        }
    }
    sort(ALL(vec));
    vec.erase(unique(ALL(vec),vec.end()));
    cout << vec[k-1] << endl;
    return 0;
}

Compiler output:
In file included from /usr/include/c++/14/bits/stl_algobase.h:71,
                 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/predefined_ops.h: In instantiation of 'constexpr bool __gnu_cxx::__ops::_Iter_comp_iter<_Compare>::operator()(_Iterator1, _Iterator2) [with _Iterator1 = __gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >; _Iterator2 = __gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >; _Compare = __gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >]':
/usr/include/c++/14/bits/stl_algo.h:869:20:   required from '_ForwardIterator std::__unique(_ForwardIterator, _ForwardIterator, _BinaryPredicate) [with _ForwardIterator = __gnu_cxx::__normal_iterator<__cxx11::basic_string<char>*, vector<__cxx11::basic_string<char> > >; _BinaryPredicate = __gnu_cxx::__ops::_Iter_comp_iter<__gnu_cxx::__normal_iterator<__cxx11::basic_string<char>*, vector<__cxx11::basic_string<char> > > >]'
  869 |         if (!__binary_pred(__dest, __first))
      |              ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:933:27:   required from '_FIter std::unique(_FIter, _FIter, _BinaryPredicate) [with _FIter = __gnu_cxx::__normal_iterator<__cxx11::basic_string<char>*, vector<__cxx11::basic_string<char> > >; _BinaryPredicate = __gnu_cxx::__normal_iterator<__cxx11::basic_string<char>*, vector<__cxx11::basic_string<char> > >]'
  933 |       return std::__unique(__first, __last,
      |              ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
  934 |                            __gnu_cxx::__ops::__iter_comp_iter(__binary_pred));
      |                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:21:21:   required from here
   21 |     vec.erase(unique(ALL(vec),vec.end()));
      |               ~~~~~~^~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/predefined_ops.h:158:30: error: no match for call to '(__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >) (std::__cxx11::basic_string<char>&, std::__cxx11::basic_string<char>&)'
  158 |         { return bool(_M_comp(*__it1, *__it2)); }
      |                       ~~~~~~~^~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <limits>
#include <queue>
#include <iomanip>
#include <set>

template<typename T> bool chmax(T &a,T b){
    if(a<b){
        a=b;
        return true;
    }
    return false;
}

template<typename T> bool chmin(T &a,T b){
    if(a>b){
        a=b;
        return true;
    }
    return false;
}

using namespace std;
using ll = long long int;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<vvll> vvvll;
const int MOD=1000000007;
//const int MOD=998244353;
const int INTMAX=1001001000;
const ll LLMAX=1010010010010010000;

bool comp(string a,string b){
    return strcmp(a.c_str(),b.c_str())<0;
}

bool include(vector<string> list,string a){
    for(ll i=0;i<list.size();i++){
        if(strcmp(list[i].c_str(),a.c_str())==0)return true;
    }
    return false;
}


int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    string s;
    int K;
    cin>>s>>K;
    
    vector<string> S;
    for(ll i=0;i<s.size();i++){
        for(ll j=0;j<K;j++){
            if(i+j>=s.size())break;
            if(!include(S,s.substr(i,j+1)))S.push_back(s.substr(i,j+1));
        }
    }
    sort(S.begin(),S.end(),comp);
    cout<<S[K-1]<<endl;
    
    return 0;
}


Compiler output:
a.cc: In function 'bool comp(std::string, std::string)':
a.cc:38:12: error: 'strcmp' was not declared in this scope
   38 |     return strcmp(a.c_str(),b.c_str())<0;
      |            ^~~~~~
a.cc:10:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    9 | #include <set>
  +++ |+#include <cstring>
   10 | 
a.cc: In function 'bool include(std::vector<std::__cxx11::basic_string<char> >, std::string)':
a.cc:43:12: error: 'strcmp' was not declared in this scope
   43 |         if(strcmp(list[i].c_str(),a.c_str())==0)return true;
      |            ^~~~~~
a.cc:43:12: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; ++i)
#define rrep(i, n) for(int i = n-1; i >= 0; --i)
#define fi first
#define se second
using namespace std;
using lint = long long;
using uint = unsigned int;
using ulint = unsigned long long;
using ldouble = long double;
using pii = pair<int, int>;
using pli = pair<lint, lint>;
using pdd = pair<double, double>;
using pld = pair<ldouble, ldouble>;
using v1i = vector<int>;
using v1li = vector<lint>;
using v2i = vector<vector<int>>;
using v2li = vector<vector<lint>>;
using v3i = vector<vector<vector<int>>>;
using v3li = vector<vector<vector<lint>>>;
using v1b = vector<bool>;
using v2b = vector<vector<bool>>;
using v3b = vector<vector<vector<bool>>>;
using v1c = vector<char>;
using v2c = vector<vector<char>>;
using v3c = vector<vector<vector<char>>>;
constexpr lint mod1 = 1e9+7;
constexpr lint mod2 = 998244353;

int main() {
  string s;
  int k;
  cin >> s >> k;
  priority_queue<string, vector<string>, greater<string>> p;
  string t = "?"; int c = 0;
  rep(i, s.size()){
    string u = "";
    rep(j, min(5, (int)s.size()-i)){
      u += s[i+j];
      p.insert(u);
    }
  }
  while(c < k){
    if(t != p.top()){
      t = p.top();
      p.pop();
      ++c;
    }
    else p.pop();
  }
  cout << t << "\n";
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:9: error: 'class std::priority_queue<std::__cxx11::basic_string<char>, std::vector<std::__cxx11::basic_string<char> >, std::greater<std::__cxx11::basic_string<char> > >' has no member named 'insert'
   40 |       p.insert(u);
      |         ^~~~~~
Language: C++

s=input()
K=int(input())
e=set()
for i in range(len(s)):
    for j in range(1,6):
        if(i+j>len(s)):
            break
        e.add(s[i:i+j])
li=sorted(e)
print(li[K-1])

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

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep2(i,a,b) for(int i=(int)(a);i<(int)(b);i++) 
#define elif else if
#define pb push_back
#define ll long long
#define mp make_pair
#define all(x) x.begin(),x.end()
//#define x first
//#define y second

using namespace std;
int k;
string s;
set<string>ans;
set<string>::iterator it;
int main()
{
	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
	cin>>s>>k;
	rep(i,)
	rep2(i,1,min((int)(s.size()+1),6))
	rep(j,s.size()-i+1)
	ans.insert(s.substr(j,i));
	for(it=ans.begin();k>1;it++,k--);
	cout<<*it<<endl;
	return 0;}

Compiler output:
a.cc: In function 'int main()':
a.cc:2:33: error: expected primary-expression before 'int'
    2 | #define rep(i,n) for(int i=0;i<(int)(n);i++)
      |                                 ^~~
a.cc:22:9: note: in expansion of macro 'rep'
   22 |         rep(i,)
      |         ^~~
a.cc:2:33: error: expected ')' before 'int'
    2 | #define rep(i,n) for(int i=0;i<(int)(n);i++)
      |                                ~^~~
a.cc:22:9: note: in expansion of macro 'rep'
   22 |         rep(i,)
      |         ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i,n) for (int i = 0; i < (n); ++i)
int main()
{
    string s;
    cin >> s;
    int k;
    cin >> k;
    vector<string> substring;
    int s_len = s.length();
    rep(i, s.length()) {
        for ( int j = 1; j <= min(k, s_len - i); j++)
            substring.push_back(s.substr(i, j));
    sort(substring.begin(), substring.end());
    substring.erase(unique(substring.begin(), substring.end()), substring.end());
    cout << substring[k-1] << endl;
    return 0;
}


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

#include<bits/stdc++.h>
using namespace std;
int main()
{
 string s;int k;
  cin>>s>>k;
  for(int i=1;i<=s.length();i++)
  {
    for(int j=0;j+i-1<s.length();j++)
      v.insert(s.substr(j,i));
  }
  int p=k-1;
  auto it = v.begin();
  while(p--)
    it++;
  cout<<*it;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:7: error: 'v' was not declared in this scope
   10 |       v.insert(s.substr(j,i));
      |       ^
a.cc:13:13: error: 'v' was not declared in this scope
   13 |   auto it = v.begin();
      |             ^
Language: C++

from string import ascii_lowercase
s = input()
k = int(input())

sub = []
l = [[] for _ in range(5)]

for i in range(min(len(s),5)):
    if i == 0:
        for c in ascii_lowercase:
            if s.find(c) != -1:
                l[i].append(c)
                sub.append(c)
            if len(l[i]) >= k:
                break
    else:
        for ss in l[i-1]:
            for c in ascii_lowercase:
                tmp = ss + c
                if s.find(tmp) != -1:
                    l[i].append(tmp)
                    sub.append(tmp)
            if len(l[i]) >= k:
                break

sub.sort()
print(sub[k-1])



Compiler output:
a.cc:1:1: error: 'from' does not name a type
    1 | from string import ascii_lowercase
      | ^~~~
Language: C++

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


int main () {
    string str;
    cin >> str;
    cin >> m;
  	int n = str.length();
  	set <string> st;
    for (int i = 0; i < n; i++)
        for (int j = 1; i + j <= n && j <= 5; j++)
            st.insert(str.substr(i, j));
    auto itr = st.begin();
    cout << *next(itr, m-1) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:12: error: 'm' was not declared in this scope; did you mean 'tm'?
   10 |     cin >> m;
      |            ^
      |            tm
Language: C++

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

int main(){
  string s;cin >> s;
  int k;cin >> k;
  set<string> x;
  int l=(int)s.size()
  for(int i=1;i<=min({l,k});i++){
    for(int j=0;j<l-i+1;j++){
      x.insert(s.substr(j,i));
    }
  }
  int a=0;
  for(auto itr=x.begin();itr!=x.end();itr++){
    a++;
    if(a==k){cout << *itr << endl;break;}
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:3: error: expected ',' or ';' before 'for'
   12 |   for(int i=1;i<=min({l,k});i++){
      |   ^~~
a.cc:12:15: error: 'i' was not declared in this scope
   12 |   for(int i=1;i<=min({l,k});i++){
      |               ^
Language: C++

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

int main(){
  string s;cin >> s;
  int k;cin >> k;
  set<string> x;
  int l=(int)s.size()
  for(int i=1;i<=min({l,k}));i++){
    for(int j=0;j<l-i+1;j++){
      x.insert(s.substr(j,i));
    }
  }
  int a=0;
  for(auto itr=x.begin();itr!=x.end();itr++){
    a++;
    if(a==k){cout << *itr << endl;break;}
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:3: error: expected ',' or ';' before 'for'
   12 |   for(int i=1;i<=min({l,k}));i++){
      |   ^~~
a.cc:12:15: error: 'i' was not declared in this scope
   12 |   for(int i=1;i<=min({l,k}));i++){
      |               ^
Language: C++

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

int main(){
  string s;cin >> s;
  int k;cin >> k;
  set<string> x;
  int l=min({(int)s.size(),k});
  for(int i=1;i<=l;i++){
    for(int j=0;j<l;j++){
      x.insert(s.substr(j,i));
    }
  }
  int a=0;
  for(auto itr=x.begin();itr!=x.end();itr++){
    a++;
    if(a==k){cout << *itr << endl;break;}
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:12: error: no matching function for call to 'min(<brace-enclosed initializer list>)'
   10 |   int l=min({(int)s.size(),k});
      |         ~~~^~~~~~~~~~~~~~~~~~~
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:   candidate expects 2 arguments, 1 provided
/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, 1 provided
Language: C++

include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int(i)=0;i<(n);i++)

int main(){
  string s;int k;cin>>s>>k;
  vector<string> ans(k+1,"zzzzz");
  
  for(int i=1;i<=k;i++){
    REP(j,s.size()-i+1){
      bool f=0;
      string t=s.substr(j,i);
      REP(p,k) if(ans.at(p)==t) f=1;
      for(int m=k-1;m>=0;m--){
        if(!f&&ans.at(m)>t){
          ans.at(m+1)=ans.at(m);
          ans.at(m)=t;
        }
      }
    }
  }
  //REP(i,k) cout<<ans.at(i)<<endl;
  cout<<ans.at(k-1);
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'string' was not declared in this scope
    6 |   string s;int k;cin>>s>>k;
      |   ^~~~~~
a.cc:6:18: error: 'cin' was not declared in this scope
    6 |   string s;int k;cin>>s>>k;
      |                  ^~~
a.cc:6:23: error: 's' was not declared in this scope
    6 |   string s;int k;cin>>s>>k;
      |                       ^
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<string> ans(k+1,"zzzzz");
      |   ^~~~~~
a.cc:7:18: error: 'ans' was not declared in this scope
    7 |   vector<string> ans(k+1,"zzzzz");
      |                  ^~~
a.cc:12:13: error: expected ';' before 't'
   12 |       string t=s.substr(j,i);
      |             ^~
      |             ;
a.cc:13:30: error: 't' was not declared in this scope
   13 |       REP(p,k) if(ans.at(p)==t) f=1;
      |                              ^
a.cc:15:26: error: 't' was not declared in this scope
   15 |         if(!f&&ans.at(m)>t){
      |                          ^
a.cc:23:3: error: 'cout' was not declared in this scope
   23 |   cout<<ans.at(k-1);
      |   ^~~~
Language: C++

#include <iostream>
#include <assert.h>
#include <algorithm>
#include <string>
#include <list>

void update_list(std::string& substr, std::list<std::string>& list, const int32_t k){
    if(substr == ""){
        return;
    }
    if(list.empty()){
        list.push_back(substr);
        return;
    }
    for(auto it = list.begin(); it != list.end(); it++){
        if(*it == substr){
            return;
        }
        else if(*it > substr){
            list.insert(it, substr);
            if((int32_t)list.size() > k){
                list.pop_back();
            }
            return;
        }
    }
    if((int32_t)list.size() < k){
        list.push_back(substr);
    }
    return;
}

int main(){
    std::cin.tie(0);
    std::ios::sync_with_stdio(false);

    std::string s;
    int32_t K;
    std::cin >> s;
    std::cin >> K;
    std::list<std::string> substr_list;

    for(int32_t i = 0; i < (int32_t)s.size(); i++){
        for(int32_t j = i; j < (int32_t)s.size() && J<i+K; j++){
            std::string substr = s.substr(i,j - i + 1);
            update_list(substr, substr_list, K);
        }
    }

    assert((int32_t)substr_list.size() == K);
    std::cout << substr_list.back() << std::endl;

    return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:44:53: error: 'J' was not declared in this scope
   44 |         for(int32_t j = i; j < (int32_t)s.size() && J<i+K; j++){
      |                                                     ^
Language: C++

s = input()
k = int(input())
l = len(s)

i = l
b = 1
cnddt = set()
while i:
    for j in range(l-i+1):
        cnddt.add(s[j:j+i])
    i -= 1
print(sorted(list(cnddt))[k-1])

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

#include<bits/stdc++.h>
using namespace std;
int main(){
  string s;cin>>s;
  int K;cin>>K;
  int N=s.length();
  vector<string> substrings;
  for(int i=0;i<K;i++){
    for(int j=0;j<N-i-1;j++){
      substrings.push_back(s.substr(j,i+1));
    }
  }
  sort(substrings.begin(),substrings.emd());
  int tmp=0;
  int i=0;
  string last="";
  while(1){
    if(last!=substrings[i]){
      last=substrings[i];
      i++;
      if(i==k){cout<<last;return 0;}
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:38: error: 'class std::vector<std::__cxx11::basic_string<char> >' has no member named 'emd'; did you mean 'end'?
   13 |   sort(substrings.begin(),substrings.emd());
      |                                      ^~~
      |                                      end
a.cc:21:13: error: 'k' was not declared in this scope
   21 |       if(i==k){cout<<last;return 0;}
      |             ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0;i<(n);i++)
#define REP2(i,a,b) for(int i=(a);i<(b);i++)
#define ALL(v) (v).begin(),(v).end()
#define INF 2e9
typedef long long ll;

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

  vector<string> sub;
  map<string,bool> mp;
  REP2(i,1,min(k,s.size())+1){
    REP(j,s.size()){
      string temp=s.substr(j,i);
      if(mp[temp]) continue;
      sub.emplace_back(temp);
      mp[temp]=1;
    }
  }
  sort(ALL(sub));
  cout<<sub[k-1]<<endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:15: error: no matching function for call to 'min(int&, std::__cxx11::basic_string<char>::size_type)'
   17 |   REP2(i,1,min(k,s.size())+1){
      |            ~~~^~~~~~~~~~~~
a.cc:4:38: note: in definition of macro 'REP2'
    4 | #define REP2(i,a,b) for(int i=(a);i<(b);i++)
      |                                      ^
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:17:15: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'})
   17 |   REP2(i,1,min(k,s.size())+1){
      |            ~~~^~~~~~~~~~~~
a.cc:4:38: note: in definition of macro 'REP2'
    4 | #define REP2(i,a,b) for(int i=(a);i<(b);i++)
      |                                      ^
/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:17:15: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   17 |   REP2(i,1,min(k,s.size())+1){
      |            ~~~^~~~~~~~~~~~
a.cc:4:38: note: in definition of macro 'REP2'
    4 | #define REP2(i,a,b) for(int i=(a);i<(b);i++)
      |                                      ^
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bits/stdc++.h>
#include<cmath>
#include<bitset>
#include<queue>
#include<set>
#define ll long long
#define itn int
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n)  FFOR(i,1,n)
#define SORT(V) sort((V).begin(),(V).end())
#define REVERSE(V) reverse((V).begin(),(V).end())
#define INF ((1LL<<62)-(1LL<<31))
#define MOD 1000000007
using namespace std;

int main(){
  string S;
  int K;
  cin>>S>>K;
  
  int N=S.size();
  set<string> L;
  
  for(int i=1; i<=K; ++i){
    for(int j=0; j<=N-i; ++j){
      L.insert(S.substr(j,i));
    }
  }
  
  REP(i,K-2){
    L.erase(L.begin());
  }
  
  vector<string> LL;
  LL.push_back(L.begin(),L.end());
  
  cout<<LL.at(0)<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:15: error: no matching function for call to 'std::vector<std::__cxx11::basic_string<char> >::push_back(std::set<std::__cxx11::basic_string<char> >::iterator, std::set<std::__cxx11::basic_string<char> >::iterator)'
   41 |   LL.push_back(L.begin(),L.end());
      |   ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; value_type = std::__cxx11::basic_string<char>]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; value_type = std::__cxx11::basic_string<char>]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note:   candidate expects 1 argument, 2 provided
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bits/stdc++.h>
#include<cmath>
#include<bitset>
#include<queue>
#include<set>
#define ll long long
#define itn int
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n)  FFOR(i,1,n)
#define SORT(V) sort((V).begin(),(V).end())
#define REVERSE(V) reverse((V).begin(),(V).end())
#define INF ((1LL<<62)-(1LL<<31))
#define MOD 1000000007
using namespace std;

int main(){
  string S;
  int K;
  cin>>S>>K;
  
  int N=S.size();
  set<string> L;
  
  for(int i=1; i<=K; ++i){
    for(int j=0; j<=N-i; ++j){
      L.insert(S.substr(j,i));
    }
  }
  
  REP(i,K-2){
    L.erase(L.begin());
  }
  
  string Q=L.at(0);
  cout<<Q<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:40:14: error: 'class std::set<std::__cxx11::basic_string<char> >' has no member named 'at'
   40 |   string Q=L.at(0);
      |              ^~
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bits/stdc++.h>
#include<cmath>
#include<bitset>
#include<queue>
#include<set>
#define ll long long
#define itn int
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n)  FFOR(i,1,n)
#define SORT(V) sort((V).begin(),(V).end())
#define REVERSE(V) reverse((V).begin(),(V).end())
#define INF ((1LL<<62)-(1LL<<31))
#define MOD 1000000007
using namespace std;

int main(){
  string S;
  int K;
  cin>>S>>K;
  
  int N=S.size();
  set<string> L;
  
  for(int i=1; i<=K; ++i){
    for(int j=0; j<=N-i; ++j){
      L.insert(S.substr(j,i));
    }
  }
  
  REP(i,K-2){
    L.erase(L.begin());
  }
  
  string Q=L.begin();
  cout<<Q<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:40:19: error: conversion from 'std::set<std::__cxx11::basic_string<char> >::iterator' {aka 'std::_Rb_tree<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>, std::_Identity<std::__cxx11::basic_string<char> >, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::__cxx11::basic_string<char> > >::const_iterator'} to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
   40 |   string Q=L.begin();
      |            ~~~~~~~^~
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bits/stdc++.h>
#include<cmath>
#include<bitset>
#include<queue>
#define ll long long
#define itn int
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n)  FFOR(i,1,n)
#define SORT(V) sort((V).begin(),(V).end())
#define REVERSE(V) reverse((V).begin(),(V).end())
#define INF ((1LL<<62)-(1LL<<31))
#define MOD 1000000007
using namespace std;

int main(){
  string S;
  int K;
  cin>>S>>K;
  
  int N=S.size();
  set<string> L;
  
  for(int i=1; i<=K; ++i){
    for(int j=0; j<=N-i; ++j){
      L.insert(S.substr(j,i));
    }
  }
  
  cout<<L.at(K-1)<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:11: error: 'class std::set<std::__cxx11::basic_string<char> >' has no member named 'at'
   35 |   cout<<L.at(K-1)<<endl;
      |           ^~
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
int main(){
  string s;cin>>s;int k;cin>>k;
  string ss = s;
  vector<string> z;
  vector<string> ans;
  sort(ss.begin(),ss.end());
  ss.erase(unique(ss.begin(), ss.end()), ss.end());
  for(int i = 0; ss.size() > i; i++){
    for(int j = 0; s.size() > j; j++){
      if(s[j] == ss[i]){
        z.push_back(s.substr(j));
      }
    }
    for(int i = 0; z.size() > i; i++){
      for(int j = 0; z[i].size() > j; j++){
        ans.push_back(z[i].substr(0,j+1));
      }
    }
    sort(ans.begin(),ans.end());
    ans.erase(unique(ans.begin(),ans.end()),ans.end());
    if(ans.size() >= k){
      cout << ans[k-1] << endl;
      return 0;
    }
    z.clear();

  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<string> z;
      |   ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    2 | #include <algorithm>
  +++ |+#include <vector>
    3 | using namespace std;
a.cc:7:16: error: expected primary-expression before '>' token
    7 |   vector<string> z;
      |                ^
a.cc:7:18: error: 'z' was not declared in this scope
    7 |   vector<string> z;
      |                  ^
a.cc:8:16: error: expected primary-expression before '>' token
    8 |   vector<string> ans;
      |                ^
a.cc:8:18: error: 'ans' was not declared in this scope; did you mean 'abs'?
    8 |   vector<string> ans;
      |                  ^~~
      |                  abs
Language: C++

int main() {
	string s;
	cin >> s;
	ll K;
	cin >> K;

	ll len = s.length();
	set<string> st;

	for (ll i = 0; i < len; i++) {
		for (ll j = 1; j <= len - i; j++) {
			st.insert(s.substr(i, j));
		}
	}

	vector<string> A;
	for (auto item : st) {
		A.push_back(item);
	}

	std::sort(A.begin(), A.end());

	cout << A[K - 1];

}


Compiler output:
a.cc: In function 'int main()':
a.cc:2:9: error: 'string' was not declared in this scope
    2 |         string s;
      |         ^~~~~~
a.cc:3:9: error: 'cin' was not declared in this scope
    3 |         cin >> s;
      |         ^~~
a.cc:3:16: error: 's' was not declared in this scope
    3 |         cin >> s;
      |                ^
a.cc:4:9: error: 'll' was not declared in this scope
    4 |         ll K;
      |         ^~
a.cc:5:16: error: 'K' was not declared in this scope
    5 |         cin >> K;
      |                ^
a.cc:7:11: error: expected ';' before 'len'
    7 |         ll len = s.length();
      |           ^~~~
      |           ;
a.cc:8:9: error: 'set' was not declared in this scope
    8 |         set<string> st;
      |         ^~~
a.cc:8:21: error: 'st' was not declared in this scope; did you mean 'std'?
    8 |         set<string> st;
      |                     ^~
      |                     std
a.cc:10:16: error: expected ';' before 'i'
   10 |         for (ll i = 0; i < len; i++) {
      |                ^~
      |                ;
a.cc:10:24: error: 'i' was not declared in this scope
   10 |         for (ll i = 0; i < len; i++) {
      |                        ^
a.cc:10:28: error: 'len' was not declared in this scope
   10 |         for (ll i = 0; i < len; i++) {
      |                            ^~~
a.cc:11:24: error: expected ';' before 'j'
   11 |                 for (ll j = 1; j <= len - i; j++) {
      |                        ^~
      |                        ;
a.cc:11:32: error: 'j' was not declared in this scope
   11 |                 for (ll j = 1; j <= len - i; j++) {
      |                                ^
a.cc:16:9: error: 'vector' was not declared in this scope
   16 |         vector<string> A;
      |         ^~~~~~
a.cc:16:24: error: 'A' was not declared in this scope
   16 |         vector<string> A;
      |                        ^
a.cc:21:14: error: 'sort' is not a member of 'std'
   21 |         std::sort(A.begin(), A.end());
      |              ^~~~
a.cc:23:9: error: 'cout' was not declared in this scope
   23 |         cout << A[K - 1];
      |         ^~~~