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

#include<bits/stdc++.h>
//#include<tr1::unordered_map>
#define rep(i,a,n) for(int i=a;i<=n;++i)
#define per(i,a,n) for(int i=n;i>=a;--i)
#define pb push_back
#define fi first
#define se second
#define io std::ios::sync_with_stdio(false)
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const int P = 1e9+7, INF = 0x3f3f3f3f;
const int  maxn=3e7;
ll gcd(ll a,ll b)
{
    return b?gcd(b,a%b):a;
}
ll qpow(ll a,ll n)
{
    ll r=1%P;
    for (a%=P; n; a=a*a%P,n>>=1)if(n&1)r=r*a%P;
    return r;
}
struct node
{
  int a[26];
};
node tree[maxn];
int cnt;
void add(char *x,int len)
{ int cur=0;
  for(int i=0;i<len;i++)
  {
      int now=x[i]-'a';
      if(!tree[cur].a[now]) {
        tree[cur].a[now]=++cnt;
      }
      cur=tree[cur].a[now];
  }
}
char s[5003];
int ans;
 int k;
 string anss;
int dfs(int cur)
{
  if(ans==k)
  return 1;
    for(int i=0;i<26;i++)
    {
      if(tree[cur].a[i])
      {   ans++;
        int t=dfs(tree[cur].a[i]);
        if(t==1)
        {
                anss.push_back('a'+i);
                return 1;
        }
      }
    }
    return 0;
}
int main()
{
  io;
  cin>>s+1;
  cin>>k;
  int len=strlen(s+1);
  for(int i=1;i<=len;i++)
  {
      add(s+i,len-i+1);
  }
  dfs(0);
  reverse(anss.begin(),anss.end());
  cout<<anss<<endl;
}


Compiler output:
/tmp/ccIdeXnn.o: in function `add(char*, int)':
a.cc:(.text+0x1aa): relocation truncated to fit: R_X86_64_PC32 against symbol `cnt' defined in .bss section in /tmp/ccIdeXnn.o
a.cc:(.text+0x1b3): relocation truncated to fit: R_X86_64_PC32 against symbol `cnt' defined in .bss section in /tmp/ccIdeXnn.o
a.cc:(.text+0x1b9): relocation truncated to fit: R_X86_64_PC32 against symbol `cnt' defined in .bss section in /tmp/ccIdeXnn.o
/tmp/ccIdeXnn.o: in function `dfs(int)':
a.cc:(.text+0x249): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccIdeXnn.o
a.cc:(.text+0x24f): relocation truncated to fit: R_X86_64_PC32 against symbol `k' defined in .bss section in /tmp/ccIdeXnn.o
a.cc:(.text+0x2a7): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccIdeXnn.o
a.cc:(.text+0x2b0): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccIdeXnn.o
a.cc:(.text+0x306): relocation truncated to fit: R_X86_64_PC32 against symbol `anss[abi:cxx11]' defined in .bss section in /tmp/ccIdeXnn.o
/tmp/ccIdeXnn.o: in function `main':
a.cc:(.text+0x344): relocation truncated to fit: R_X86_64_PC32 against symbol `s' defined in .bss section in /tmp/ccIdeXnn.o
a.cc:(.text+0x35d): relocation truncated to fit: R_X86_64_PC32 against symbol `k' defined in .bss section in /tmp/ccIdeXnn.o
a.cc:(.text+0x376): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

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

string s;
int k, cnt;
set <string> sub;

int32_t main() {
	ios_base::sync_with_stdio(0); cin.tie(0);
	cin >> s >> k;
	for(int i = 0; i < s.length(); ++i) {
		for(int j = min(s.length(), k); j > 0; --j) {
			sub.insert(s.substr(i, j));
		}
	}
	cnt = 0;
	for(auto it:sub) {
		if (cnt == k-1) {
			cout << it;
			break;
		}
		++cnt;
		// cout << '#' << ' ' << cnt << '\n';
		// cout << it << '\n';
	}
}

Compiler output:
a.cc: In function 'int32_t main()':
a.cc:13:32: error: no matching function for call to 'min(std::__cxx11::basic_string<char>::size_type, long long int&)'
   13 |                 for(int j = min(s.length(), k); j > 0; --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:13:32: note:   deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'long long int')
   13 |                 for(int j = min(s.length(), k); j > 0; --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:13:32: note:   mismatched types 'std::initializer_list<_Tp>' and 'long unsigned int'
   13 |                 for(int j = min(s.length(), k); j > 0; --j) {
      |                             ~~~^~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <fstream>
#include <queue>
#include <deque>
#include <iomanip>
#include <cmath>
#include <set>
#include <stack>
#include <map>
#include <unordered_map>

#define FOR(i,n) for(int i=0;i<n;i++)
#define FORE(i,a,b) for(int i=a;i<=b;i++)
#define ll long long 
//#define int long long
#define ld long double
#define vi vector<ll>
#define pb push_back
#define ff first
#define ss second
#define ii pair<int,int>
#define iii pair<int,ii>
#define il pair<ll,ll>
#define vv vector
//#define endl '\n'
using namespace std;
const int MAXN = 2000 + 5;
const int INF = 1e9;

 
int bit[2*MAXN];
 
void add(int x, int val) {
  x += 1;
  while(x < 2*MAXN) {
    bit[x] += val;
    x += x&(-x);
  }
}
 
int sum(int x) {
  x += 1;
  int ret = 0;
  while(x > 0) {
    ret += bit[x];
    x -= x&(-x);
  }
  return ret;
}
 
int main() {
	int n;
	cin >> n;

	int location[2][n];
	for(int i = 0; i < 2*n; i++) {
		char c; int x;
		cin >> c >> x;
		location[cur == 'W'][x-1] = i;
	}

	int dp[n+1][n+1];

	dp[0][0] = 0;
	FOR(i,n+1){
	    if(i > 0) add(location[0][i-1], 1);
	 
	    FOR(j,n){
	    	if(i < n)dp[i+1][j] = min(dp[i+1][j], dp[i][j] + location[0][i] - sum(location[0][i]));
	    	dp[i][j+1] = min(dp[i][j+1], dp[i][j] + location[1][j] - sum(location[1][j]));
	    	add(location[1][j], 1);
	    }
	 	if(i < n)dp[i+1][n] = min(dp[i+1][n], dp[i][n] + location[0][i] - sum(location[0][i]));
	    
	    FOR(j,n)add(location[1][j], -1);
	}

	cout << dp[n][n] << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:61:26: error: 'cur' was not declared in this scope
   61 |                 location[cur == 'W'][x-1] = i;
      |                          ^~~
Language: C++

#include <bits/stdc++.h>
#define loop2(i, s, n, a) for (int i = int(s); i < int(n); i += a)
#define loop(i, s, n) loop2(i, s, n, 1)
#define rep(i, n) loop(i, 0, n)

#define pb push_back
#define all(in) in.begin(),in.end()

using ll = long long;
using ull = unsigned long long;
using namespace std;
typedef pair<int,int> P;

int main(){
    string s; cin >> s;
    int n; cin >> n;
    int m = s.length();

    vector<string> ans;

    rep(i,m+1) rep(j,m+1) if(i < j) {
      ans.push_back(s.substr(i,j-i));
    sort(all(ans));
  	ans.erase(unique(ans.begin(), ans.end()), ans.end());
    if(ans.size() > n) ans.pop_back()
    }
    cout << ans[n-1] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:38: error: expected ';' before '}' token
   25 |     if(ans.size() > n) ans.pop_back()
      |                                      ^
      |                                      ;
   26 |     }
      |     ~
Language: C++

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

int main() {
  string s;
  int k;
  cin>>s>>k;
  vector<string>sub;
  for(int i=1;i<=s.size();i++){
    for(int j=0;j<n-i+1;j++){
      sub.push_back(s.substr(j,i));
    }
  }
  sort(sub.begin(),sub.end());
  int now=1;
  int ss=sub[0];
  for(int i=1;i<sub.size();i++){
    if(s[i]!=ss){
      ss=sub[i];
      now++;
      if(now==k){
        cout<<ss<<endl;
        break;
      }
    }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:19: error: 'n' was not declared in this scope
   10 |     for(int j=0;j<n-i+1;j++){
      |                   ^
a.cc:16:15: error: cannot convert '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} to 'int' in initialization
   16 |   int ss=sub[0];
      |               ^
a.cc:19:15: error: cannot convert '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} to 'int' in assignment
   19 |       ss=sub[i];
      |               ^
Language: C++

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

int main() {
	string S; cin >> S;
	int N = S.size();
	int K; cin >> K;
	vector<string>A;
	for (int i = 0; i < S.size(); i++) {
		string T = "";
		int pus = min(K, N - i);
		for (int j = i; j < i + pus; j++) {
			T.push_back(S.at(j));
			A.push_back(T);
		}
	}
	sort(A.begin(), A.end());
	long long num = 1;
	if (A.size() == 1) {
		cout << A.at(0) << endl;
		continue;
	}
	for (int i = 1; i < A.size(); i++) {
		if (A.at(i) != A.at(i - 1)) {
			num++;
			if (num == K) {
				cout << A.at(i) << endl;
				return 0;
			}
		}
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:17: error: continue statement not within a loop
   22 |                 continue;
      |                 ^~~~~~~~
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Comparator;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;

public class KthSubstring { // Template for CF
    public static class ListComparator implements Comparator<List<Integer>> {

        @Override
        public int compare(List<Integer> l1, List<Integer> l2) {
            for (int i = 0; i < l1.size(); ++i) {
                if (l1.get(i).compareTo(l2.get(i)) != 0) {
                    return l1.get(i).compareTo(l2.get(i));
                }
            }
            return 0;
        }
    }

    public static void main(String[] args) throws IOException {
        BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        String str = f.readLine();
        int k = Integer.parseInt(f.readLine());
        Set<String> set = new TreeSet<>();
        for (int j = 0; j < str.length(); j++) {
            for (int p = j; p < str.length(); p++) {
                String a = "";
                if (p == str.length() - 1) {
                    a = str.substring(j);
                } else {
                    a = str.substring(j, p + 1);
                }
                set.add(a);
            }
        }
        int ind = 0;
        for (String i : set) {
            if (ind == k - 1) {
                out.println(i);
                break;
            }
            ind++;
        }
        out.close();

    }

}


Compiler output:
Main.java:10: error: class KthSubstring is public, should be declared in a file named KthSubstring.java
public class KthSubstring { // Template for CF
       ^
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define FOR(i,l,r) for(i=l;i<r;i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define P pair<ll,ll>
#define F first
#define S second
signed main(){
  string S;ll K,i,j,k=0;cin>>S>>K;
  vector<string>SUB(S.size()*(S.size()+1)/2);
  REP(i,S.size())FOR(j,1,min(K,S.size()-i+1))SUB.at(k++)=S.substr(i,j);
  sort(ALL(SUB),[](const string&x,const string&y){return x<y;});j=0;
  REP(i,K-1){
    j++;
    while(SUB.at(j-1)==SUB.at(j))j++;
  }
  cout<<SUB.at(j)<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:29: error: no matching function for call to 'min(ll&, long long unsigned int)'
   13 |   REP(i,S.size())FOR(j,1,min(K,S.size()-i+1))SUB.at(k++)=S.substr(i,j);
      |                          ~~~^~~~~~~~~~~~~~~~
a.cc:4:30: note: in definition of macro 'FOR'
    4 | #define FOR(i,l,r) for(i=l;i<r;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:13:29: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'long long unsigned int')
   13 |   REP(i,S.size())FOR(j,1,min(K,S.size()-i+1))SUB.at(k++)=S.substr(i,j);
      |                          ~~~^~~~~~~~~~~~~~~~
a.cc:4:30: note: in definition of macro 'FOR'
    4 | #define FOR(i,l,r) for(i=l;i<r;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:13:29: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   13 |   REP(i,S.size())FOR(j,1,min(K,S.size()-i+1))SUB.at(k++)=S.substr(i,j);
      |                          ~~~^~~~~~~~~~~~~~~~
a.cc:4:30: note: in definition of macro 'FOR'
    4 | #define FOR(i,l,r) for(i=l;i<r;i++)
      |                              ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define FOR(i,l,r) for(i=l;i<r;i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define P pair<ll,ll>
#define F first
#define S second
signed main(){
  string S;ll K,i,j;cin>>S>>K;
  queue<string>SUB;
  REP(i,S.size())FOR(j,1,S.size()-i+1)SUB.push(S.substr(i,j));
  sort(ALL(SUB));j=0;
  REP(i,K-1){
    j++;
    while(SUB.at(j-1)==SUB.at(j))j++;
  }
  cout<<SUB.at(j)<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:18: error: 'class std::queue<std::__cxx11::basic_string<char> >' has no member named 'begin'
    6 | #define ALL(x) x.begin(),x.end()
      |                  ^~~~~
a.cc:14:8: note: in expansion of macro 'ALL'
   14 |   sort(ALL(SUB));j=0;
      |        ^~~
a.cc:6:28: error: 'class std::queue<std::__cxx11::basic_string<char> >' has no member named 'end'
    6 | #define ALL(x) x.begin(),x.end()
      |                            ^~~
a.cc:14:8: note: in expansion of macro 'ALL'
   14 |   sort(ALL(SUB));j=0;
      |        ^~~
a.cc:17:15: error: 'class std::queue<std::__cxx11::basic_string<char> >' has no member named 'at'
   17 |     while(SUB.at(j-1)==SUB.at(j))j++;
      |               ^~
a.cc:17:28: error: 'class std::queue<std::__cxx11::basic_string<char> >' has no member named 'at'
   17 |     while(SUB.at(j-1)==SUB.at(j))j++;
      |                            ^~
a.cc:19:13: error: 'class std::queue<std::__cxx11::basic_string<char> >' has no member named 'at'
   19 |   cout<<SUB.at(j)<<endl;
      |             ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define FOR(i,l,r) for(i=l;i<r;i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define P pair<ll,ll>
#define F first
#define S second
signed main(){
  string S;ll K,i,j;cin>>S>>K;
  deque<string>SUB;
  REP(i,S.size())FOR(j,1,S.size()-i+1)SUB.push(S.substr(i,j));
  sort(ALL(SUB));j=0;
  REP(i,K-1){
    j++;
    while(SUB.at(j-1)==SUB.at(j))j++;
  }
  cout<<SUB.at(j)<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:43: error: 'class std::deque<std::__cxx11::basic_string<char> >' has no member named 'push'
   13 |   REP(i,S.size())FOR(j,1,S.size()-i+1)SUB.push(S.substr(i,j));
      |                                           ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll,ll> pl;
typedef vector<pl> vp;
const ll INF=1001001001;
const ll LINF=1001001001001001001;
const ll D4[]={0,1,0,-1,0};
const ll D8[]={0,1,1,0,-1,-1,1,-1,0};
#define _overload3(_1,_2,_3,name,...) name
#define _rep2(i,n) for(ll i=0;i<(n);++i)
#define _rep3(i,a,b) for(ll i=(a);i<(b);++i)
#define rep(...) _overload3(__VA_ARGS__,_rep3,_rep2)(__VA_ARGS__)
#define _repe2(i,n) for(ll i=0;i<=(n);++i)
#define _repe3(i,a,b) for(ll i=(a);i<=(b);++i)
#define repe(...) _overload3(__VA_ARGS__,_repe3,_repe2)(__VA_ARGS__)
#define _rrep2(i,n) for(ll i=(n)-1;i>=0;i--)
#define _rrep3(i,a,b) for(ll i=(b)-1;i>=(a);i--)
#define rrep(...) _overload3(__VA_ARGS__,_rrep3,_rrep2)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
template<class T>
bool chmax(T &a,const T &b){if(a<b){a=b;return 1;}return 0;}
template<class T>
bool chmin(T &a,const T &b){if(b<a){a=b;return 1;}return 0;}
template<class T>
using pq=priority_queue<T,vector<T>,greater<T>>;

string s;
ll K;

void solve();

int main(){
    cin.tie(0);
    ios::sync_with_stdio(0);
    cin >> s;
    cin >> K;
    solve();
}

// 1 ≤ |s| ≤ 5000
// s は英小文字からなる
// 1 ≤ K ≤ 5
// s は異なる substring を K 個以上持つ

// string s, ll K
// 辞書順で K 番目に小さい s の substring を出力せよ。
void solve(){
    ll n=s.size();
    set<string> st;
    rep(i,n)repe(j,1,n-i){
        if(j>5)break;
        st.insert(s.substr(i,j));
    }

    ll id=1;
    for(string ss:st){
        if(id==K){
            cout<<ss<<endl;
            return;
        }
        ++i;
    }
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:64:11: error: 'i' was not declared in this scope; did you mean 'id'?
   64 |         ++i;
      |           ^
      |           id
Language: C++

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

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef vector<pdd> vdd;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define mem(a,b) memset(a, b, sizeof(a) )
#define all(x) (x).begin(),(x).end()
#define INF 1000000000000
#define MOD 1000000007
#define PB push_back
#define MP make_pair
#define F first
#define S second

inline void normal(ll &a) { a %= MOD; (a < 0) && (a += MOD); }
inline ll modMul(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a*b)%MOD; }
inline ll modAdd(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a+b)%MOD; }
inline ll modSub(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); a -= b; normal(a); return a; }
inline ll modPow(ll b, ll p) { ll r = 1; while(p) { if(p&1) r = modMul(r, b); b = modMul(b, b); p >>= 1; } return r; }
inline ll modInverse(ll a) { return modPow(a, MOD-2); }
inline ll modDiv(ll a, ll b) { return modMul(a, modInverse(b)); }

ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

int ctoi(char c) {
	if (c >= '0' && c <= '9') {
		return c - '0';
	}
	return 0;
}

int main(){
	string s;cin>>s;
	int n;cin>>n;
	vector<string>a;
	rep(i,s.size()){
		string t="";
		for(int j=i;j<s.size();++j){
			t+=s[i]
			a.PB(t);
		}
	}
	sort(all(a));
    a.erase(unique(all(a)),a.end());
	cout<<a[n-1]<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:53:32: error: expected ';' before 'a'
   53 |                         t+=s[i]
      |                                ^
      |                                ;
   54 |                         a.PB(t);
      |                         ~
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
using ll = long long;
using graph = std::vector<std::vector<ll>>;

using namespace std;

int main() {
    string s;
    unsigned int K;
    cin >> s >> K;
    set<string> S;
    for (int a = 0; a < s.size(); ++a) {
        for(int b = 1; b <= min(K,s.size() - a); b++){
            string sb = s.substr(a,b);
            if(S.count(sb) != 0){
                continue;
            }
            S.insert(sb);
        }
    }
    auto itr = S.begin();
    for (int i = 0; i < K - 1; ++i) {
        itr++;
    }
    cout << *itr << endl;


}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:32: error: no matching function for call to 'min(unsigned int&, std::__cxx11::basic_string<char>::size_type)'
   20 |         for(int b = 1; b <= min(K,s.size() - a); b++){
      |                             ~~~^~~~~~~~~~~~~~~~
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:20:32: note:   deduced conflicting types for parameter 'const _Tp' ('unsigned int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'})
   20 |         for(int b = 1; b <= min(K,s.size() - a); b++){
      |                             ~~~^~~~~~~~~~~~~~~~
/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:2:
/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:20:32: note:   mismatched types 'std::initializer_list<_Tp>' and 'unsigned int'
   20 |         for(int b = 1; b <= min(K,s.size() - a); b++){
      |                             ~~~^~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <cstring>
#include <vector>
using namespace std;
const int N=5002;
char s[N]; int k;
vector<string> v;
int main() {
    scanf("%s%d",s+1,&k);
    int n=strlen(s+1);
    for(int i=1;i<=n;i++){
        for(int j=i;j<=min(i+k-1,n);j++){
            string str="";
            for(int k=i;k<=j;k++){
                str+=s[k];
            }
            v.push_back(str);
        }
    }
    sort(v.begin(),v.end());
    v.erase(unique(v.begin(),v.end()),v.end());
    cout<<v[k-1]<<endl;
}

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

#include<bits/stdc++.h>
#include <iostream>
#include <string>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
int main(){
  string s;
  cin>>s;
  ll k;
  cin>>k;
  set<string> h;
  string kk;
  int p=0;
  rep(i,si){
    for(int j=1;j<=k;j++){
      if(j+i>=si) continue;
      h.insert(s.substr(i,j));
    }
  }
  auto g=h.begin();
  for(int i=0;i<k;i++){
    g++;
  }
  COUT(*g);
}
    
  

Compiler output:
a.cc: In function 'int main()':
a.cc:41:9: error: 'si' was not declared in this scope; did you mean 'i'?
   41 |   rep(i,si){
      |         ^~
a.cc:6:39: note: in definition of macro 'rep'
    6 | #define rep(i, n) for (ll i = 0; i < (n); i++)
      |                                       ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
int main(){
  string s;
  cin>>s;
  ll k;
  cin>>k;
  ll si=s.size();
  vstr h(si*k,{});
 
  string kk;
  int p=0;
  rep(i,si){
    char o=s[i];
    h[p]+=o;
    p++;
    for(int j=1;j<k;i++){
      if(j+i>=si) break;
      
      h[p]=h[p-1]+s[i+j];
      p++;
    }
  }
  sort(all(h));
  COUT(h[k-1]);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:17: error: call of overloaded 'vector(long long int, <brace-enclosed initializer list>)' is ambiguous
   37 |   vstr h(si*k,{});
      |                 ^
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:569:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(size_type, const value_type&, const allocator_type&) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; size_type = long unsigned int; value_type = std::__cxx11::basic_string<char>; allocator_type = std::allocator<std::__cxx11::basic_string<char> >]'
  569 |       vector(size_type __n, const value_type& __value,
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:556:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(size_type, const allocator_type&) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; size_type = long unsigned int; allocator_type = std::allocator<std::__cxx11::basic_string<char> >]'
  556 |       vector(size_type __n, const allocator_type& __a = allocator_type())
      |       ^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
int main(){
  string s;
  cin>>s;
  ll k;
  cin>>k;
  ll si=s.size();
  vstr h(si*k);
 
  string kk;
  int p=0;
  rep(i,si){
    char o=s[i];
    h[p]=o;
    p++;
    for(int j=1;j<k;i++){
      if(j+i>=n) break;
      h[p]=o+s[i+j];
      p++;
    }
  }
  sort(all(h));
  COUT(h[k-1]);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:46:15: error: 'n' was not declared in this scope
   46 |       if(j+i>=n) break;
      |               ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
int main(){
  string s;
  cin>>s;
  ll n;
  cin>>n;
  vstr h(n*k);
  ll si=s.size();
  string kk;
  int p=0;
  rep(i,si){
    char o=s[i];
    h[p]=o;
    p++;
    for(int j=1;j<k;i++){
      if(j+i>=n) break;
      h[p]=o+s[i+j];
      p++;
    }
  }
  sort(all(h));
  COUT(h[k-1]);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:36:12: error: 'k' was not declared in this scope
   36 |   vstr h(n*k);
      |            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll=long long;
 
int main(){
  int i,j,cnt=0;
  int k;
  string s;
  cin>>s;
  cin>>k;
  string a[25000];
  for(i=0;i<s.size();i++){
    for(j=1;j<=min(k,s.size()-i);j++){
      a[cnt++]=s.substr(i,j);
    }
  }
  sort(a,a+cnt);
  if(k==1){
    cout<<a[0]<<endl;
    return 0;
  }
  for(i=1;;i++){
    if(a[i-1]!=a[i])k--;
    if(k==1){
      cout<<a[i]<<endl;
      return 0;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:19: error: no matching function for call to 'min(int&, std::__cxx11::basic_string<char>::size_type)'
   13 |     for(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:13:19: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'})
   13 |     for(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:13:19: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   13 |     for(j=1;j<=min(k,s.size()-i);j++){
      |                ~~~^~~~~~~~~~~~~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:81: error: expected ';' before '}' token
   11 |   for(int i=0;i<s.size();i++){ for(int j=1;j<K;j++) vec.push_back(s.substr(i,j))}
      |                                                                                 ^
      |                                                                                 ;
Language: C++

greater<int>()
typedef long long ll;
ll GCD(ll x, ll y) { return y ? GCD(y, x%y) : x; }
ll LCM(ll x, ll y) { return x * y / GCD(x, y); }

using namespace std;
int main() {
	string s;
	int K;

	cin >> s >> K;
	vector<string> array;
	for (int i = 0; i < s.length(); i++)
	{
		for (int j = 1; j < s.length() - i + 1; j++)
		{
			array.push_back(s.substr(i, j));
		}
	}
	
	sort(array.begin(), array.end());
	array.erase(unique(array.begin(), array.end()), array.end());

	cout << array[K - 1] << endl;

}

Compiler output:
a.cc:1:1: error: 'greater' does not name a type
    1 | greater<int>()
      | ^~~~~~~
a.cc:3:1: error: 'll' does not name a type
    3 | ll GCD(ll x, ll y) { return y ? GCD(y, x%y) : x; }
      | ^~
a.cc:4:1: error: 'll' does not name a type
    4 | ll LCM(ll x, ll y) { return x * y / GCD(x, y); }
      | ^~
a.cc: In function 'int main()':
a.cc:8:9: error: 'string' was not declared in this scope
    8 |         string s;
      |         ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | greater<int>()
a.cc:11:9: error: 'cin' was not declared in this scope
   11 |         cin >> s >> K;
      |         ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | greater<int>()
a.cc:11:16: error: 's' was not declared in this scope
   11 |         cin >> s >> K;
      |                ^
a.cc:12:9: error: 'vector' was not declared in this scope
   12 |         vector<string> array;
      |         ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | greater<int>()
a.cc:12:24: error: 'array' was not declared in this scope
   12 |         vector<string> array;
      |                        ^~~~~
a.cc:1:1: note: 'std::array' is defined in header '<array>'; this is probably fixable by adding '#include <array>'
  +++ |+#include <array>
    1 | greater<int>()
a.cc:21:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   21 |         sort(array.begin(), array.end());
      |         ^~~~
      |         short
a.cc:22:21: error: 'unique' was not declared in this scope
   22 |         array.erase(unique(array.begin(), array.end()), array.end());
      |                     ^~~~~~
a.cc:24:9: error: 'cout' was not declared in this scope
   24 |         cout << array[K - 1] << endl;
      |         ^~~~
a.cc:24:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:24:33: error: 'endl' was not declared in this scope
   24 |         cout << array[K - 1] << endl;
      |                                 ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | greater<int>()
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<map>
#include<cstdio>
#include<stack>
#include<queue>
#include<fstream>
#include<cstdio>
#include<deque>
#include<iomanip>
#include <numeric>

using namespace std;
#define ok1 printf("ok1\n");
#define ok2 printf("ok2\n");
#define M 1000000000000000000LL
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n) for(int i=(s);i<(n);i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define REPR(i,s,n) for(int i=(s);i>=(n);(i)--)
#define all(a) (a).begin(),(a).end()
#define reall(a) (a).rbegin(),(a).rend()
#define pb push_back
#define pf push_front
#define MIN(a,b) a=min((a),(b))
#define MAX(a,b) a=max((a),(b))
#define SIZE(v) (int)v.size()
const double pi = acos(-1.0);

typedef vector<int> vi;
typedef vector<string> vs;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef deque<ll> dll;
typedef pair<string, int> P;
const ll mod 1e9 + 7;

int main()
{
	ios_base::sync_with_stdio(false);

	ll k;
	string s;
	cin >> s >> k;
	vs v;
	rep(i, s.size()) {
		REP(j, i + 1, i + 10) v.pb(s.substr(i, j - i));
	}
	sort(all(v));
	v.erase(unique(v.begin(), v.end()), v.end());
	cout << v[k - 1] << endl;
	return 0;
}


Compiler output:
a.cc:40:14: error: expected initializer before numeric constant
   40 | const ll mod 1e9 + 7;
      |              ^~~
Language: C++

#include <bits/stdc++.h>
#include <stdlib.h>
using namespace std;
typedef long long ll;
const ll mod=1000000007;
const ll BIG=1e15;

long long ruijou(int n, int k){
    if(k==0) return 1;
    int x=k/2;
    long long t=ruijou(n,x);
    
    if(k%2==1) return n*t*t;
    else return t*t;
}

int main(){
    set<string> data;
    string S;
    cin>>S;

    int K;
    cin>>K;

    for(int i=0;i<S.size();i++){
        for(int j=1;j<=min(K,S.size()-i);j++){
            data.insert(S.substr(i,j));
        }
    }

    auto itr=data.begin();
    if(K>=2){
        for(int i=0;i<K-1;i++) itr++;
    }

    cout<<*itr<<endl;

    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:27: error: no matching function for call to 'min(int&, std::__cxx11::basic_string<char>::size_type)'
   26 |         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:26:27: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'})
   26 |         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:26:27: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   26 |         for(int j=1;j<=min(K,S.size()-i);j++){
      |                        ~~~^~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);++i)
#define ALL(v)   (v).begin(),(v).end()
#define P(s)     cout<<(s)<<endl
#define vi   vector<int>
#define vvi  vector<vi >
#define vvvi vector<vvi >
#define pii  pair<int,int>
#define INF  (int)1e9
#define MOD  (int)1e9+7
typedef long long llong;
using namespace std;

int main(){
	string s;
	int k;
	cin>>s>>k;
	
	int n=min(s.size(),k);
	set<string> ss;
	for(int i=1;i<=n;++i){
		for(int j=0;j<=n-i;++j){
			ss.insert(s.substr(j,i));
		}
	}
	
	auto itr=ss.begin();
	REP(i,k-1){
		itr=ss.erase(ss.begin());
	}
	
	P(*itr);
}//解説参考.

Compiler output:
a.cc: In function 'int main()':
a.cc:19:18: error: no matching function for call to 'min(std::__cxx11::basic_string<char>::size_type, int&)'
   19 |         int n=min(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: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:19:18: note:   deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'int')
   19 |         int n=min(s.size(),k);
      |               ~~~^~~~~~~~~~~~
/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:19:18: note:   mismatched types 'std::initializer_list<_Tp>' and 'long unsigned int'
   19 |         int n=min(s.size(),k);
      |               ~~~^~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);++i)
#define ALL(v)   (v).begin(),(v).end()
#define P(s)     cout<<(s)<<endl
#define vi   vector<int>
#define vvi  vector<vi >
#define vvvi vector<vvi >
#define pii  pair<int,int>
#define INF  (int)1e9
#define MOD  (int)1e9+7
typedef long long llong;
using namespace std;

int main(){
	string s;
	int k;
	cin>>s>>k;
	
	int n=min(s.szie(),k);
	set<string> ss;
	for(int i=1;i<=n;++i){
		for(int j=0;j<=n-i;++j){
			ss.insert(s.substr(j,i));
		}
	}
	
	auto itr=ss.begin();
	REP(i,k-1){
		itr=ss.erase(ss.begin());
	}
	
	P(*itr);
}//解説参考.

Compiler output:
a.cc: In function 'int main()':
a.cc:19:21: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'szie'; did you mean 'size'?
   19 |         int n=min(s.szie(),k);
      |                     ^~~~
      |                     size