Language: C++

// In the name of God

#include <iostream>
#include <algorithm>
#include <fstream>
#include <vector>
#include <deque>
#include <assert.h>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <stdio.h>
#include <string.h>
#include <utility>
#include <math.h>
#include <bitset>
#include <iomanip>

using namespace std;

#define rep(i, n) for (int i = 0, _n = (int)(n); i < _n; ++i)
#define int long long
const int N = (int) 1e5 + 5, L = 20, mod = (int) 1e16 + 7, base = 727;
int h[N], pw[N], n;
string t;
int get_hash(int l, int r) {
    return (h[r] - (h[l] * 1ll * pw[r - l] % mod) + mod) % mod;
}
int sa[N], rank[N][L], lcp_table[N], ind[N], adr[N];
pair<int, int> value[N];
int a[N], b[N], c[N];

void radix_sort(int n) {
    memset(c, 0, sizeof c);
    for (int i = 0; i < n; ++i) c[value[a[i]].second]++;
    for (int i = 1; i < N; ++i) c[i] += c[i - 1];
    for (int i = 0; i < n; ++i) b[--c[value[a[i]].second]] = a[i];
    memset(c, 0, sizeof c);
    for (int i = 0; i < n; ++i) c[value[b[i]].first]++;
    for (int i = 1; i < N; ++i) c[i] += c[i - 1];
    for (int i = n - 1; i >= 0; --i) a[--c[value[b[i]].first]] = b[i];
}

void make_suffix_array() {
    for (int i = 0; i < n; ++i)
        rank[i][0] = t[i];    
    for (int g = 1; g < L; ++g) {
        for (int i = 0; i < n; ++i) {
            value[i] = make_pair(rank[i][g - 1], (i + (1 << g - 1)) < n? rank[i + (1 << g - 1)][g - 1]: 0);
            a[i] = i;
        }
        radix_sort(n);
        int cnt = 1;
        for (int i = 0; i < n; ++i) {
            cnt += (i > 0 && value[a[i]] != value[a[i - 1]]);
            rank[a[i]][g] = cnt;
            sa[i] = a[i];
        }
    }
}

int lcp(int a, int b) {
    int l = 0;
    for (int j = L - 1; j >= 0; --j) if (a < n && b < n)
        if (rank[a][j] == rank[b][j]) {
            a += 1 << j;
            b += 1 << j;
            l += 1 << j;
        }
    return l; 
}
int32_t main() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> t; n = (int) t.size();
    make_suffix_array();
    int mx = 0;
    for (int i = 0; i < n - 1; ++i)
        mx = max(mx, lcp(sa[i], sa[i + 1]));
    cout << n - mx << endl;

}

Compiler output:
a.cc: In function 'void make_suffix_array()':
a.cc:47:9: error: reference to 'rank' is ambiguous
   47 |         rank[i][0] = t[i];
      |         ^~~~
In file included from /usr/include/c++/14/bits/move.h:37,
                 from /usr/include/c++/14/bits/exception_ptr.h:41,
                 from /usr/include/c++/14/exception:166,
                 from /usr/include/c++/14/ios:41,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:3:
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
 1437 |     struct rank
      |            ^~~~
a.cc:30:12: note:                 'long long int rank [100005][20]'
   30 | int sa[N], rank[N][L], lcp_table[N], ind[N], adr[N];
      |            ^~~~
a.cc:50:34: error: reference to 'rank' is ambiguous
   50 |             value[i] = make_pair(rank[i][g - 1], (i + (1 << g - 1)) < n? rank[i + (1 << g - 1)][g - 1]: 0);
      |                                  ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
 1437 |     struct rank
      |            ^~~~
a.cc:30:12: note:                 'long long int rank [100005][20]'
   30 | int sa[N], rank[N][L], lcp_table[N], ind[N], adr[N];
      |            ^~~~
a.cc:50:74: error: reference to 'rank' is ambiguous
   50 |             value[i] = make_pair(rank[i][g - 1], (i + (1 << g - 1)) < n? rank[i + (1 << g - 1)][g - 1]: 0);
      |                                                                          ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
 1437 |     struct rank
      |            ^~~~
a.cc:30:12: note:                 'long long int rank [100005][20]'
   30 | int sa[N], rank[N][L], lcp_table[N], ind[N], adr[N];
      |            ^~~~
a.cc:57:13: error: reference to 'rank' is ambiguous
   57 |             rank[a[i]][g] = cnt;
      |             ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
 1437 |     struct rank
      |            ^~~~
a.cc:30:12: note:                 'long long int rank [100005][20]'
   30 | int sa[N], rank[N][L], lcp_table[N], ind[N], adr[N];
      |            ^~~~
a.cc: In function 'long long int lcp(long long int, long long int)':
a.cc:66:13: error: reference to 'rank' is ambiguous
   66 |         if (rank[a][j] == rank[b][j]) {
      |             ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
 1437 |     struct rank
      |            ^~~~
a.cc:30:12: note:                 'long long int rank [100005][20]'
   30 | int sa[N], rank[N][L], lcp_table[N], ind[N], adr[N];
      |            ^~~~
a.cc:66:27: error: reference to 'rank' is ambiguous
   66 |         if (rank[a][j] == rank[b][j]) {
      |                           ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
 1437 |     struct rank
      |            ^~~~
a.cc:30:12: note:                 'long long int rank [100005][20]'
   30 | int sa[N], rank[N][L], lcp_table[N], ind[N], adr[N];
      |            ^~~~