Language: C++

/*Huyyt*/
#include<bits/stdc++.h>
#define mem(a,b) memset(a,b,sizeof(a))
#define pb push_back
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const ll LLmaxn = 2e18;
string a;
int K;
string str[10000000];
int pop = 0;
map<string, int> mp;
int main()
{
        cin >> a;
        cin >> K;
        for (int i = 0; i <= 25 && pop < K; i++)
        {
                for (int j = 0; j < a.size(); j++)
                {
                        if (a[j] == 'a' + i)
                        {
                                string now = "";
                                for (int k = j; k < min(a.size(), j + K - 1); k++)
                                {
                                        now += a[k];
                                        if (!mp[now])
                                        {
                                                str[++pop] = now;
                                                mp[now]++;
                                        }
                                }
                        }
                }
        }
        sort(str + 1, str + pop + 1);
        cout << str[K] << endl;
        return 0;
}


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