func_code_string: #include <bits/stdc++.h>   using namespace std;   const int N = 1e5 + 5;   int z[N], t1[N], t2[N];   string s;   vector<pair<int, int> > ans;   int n;   void BuildZArray() {     int L = 0, R = 0;     for (int i = 1; i < n; i++) {       if (i > R) {         L = R = i;         while (R < n && s[R - L] == s[R]) R++;         z[i] = R - L;         R--;       } else {         int k = i - L;         if (z[k] < R - i + 1)           z[i] = z[k];         else {           L = i;           while (R < n && s[R - L] == s[R]) R++;           z[i] = R - L;           R--;         }       }     }   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     cin >> s;     n = s.size();     BuildZArray();     for (int i = 0; i < n; i++) {       t1[z[i]]++;     }     t1[n]++;     for (int i = N - 1; i >= 0; i--) {       t2[i] = t1[i] + t2[i + 1];     }     for (int i = 0; i < n; i++)       if (z[i] >= n - i) ans.push_back(pair<int, int>(z[i], t2[z[i]]));     ans.push_back(pair<int, int>(n, 1));     sort(ans.begin(), ans.end());     cout << ans.size() <<   n ;     for (auto it : ans) cout << it.first <<     << it.second <<   n ;     return 0;   }   