func_code_string: #include <bits/stdc++.h>   using namespace std;   long long int solve(string &s, vector<vector<long long int> > &pre,                       vector<vector<long long int> > &dp, long long int st,                       long long int en, long long int a, long long int b) {     if (st > en) {       return 0;     }     if (dp[st][en] != -1) {       return dp[st][en];     }     long long int val = solve(s, pre, dp, st + 1, en, a, b) + a;     for (long long int i = st; i < pre[st][0] + st; i++) {       val = min(val, solve(s, pre, dp, i + 1, en, a, b) + b);     }     dp[st][en] = val;     return val;   }   void getZarr(string str, int Z[]);   long long int get_len(string &text, string &pattern) {     string concat = pattern +  $  + text;     int l = concat.length();     int Z[l];     getZarr(concat, Z);     long long int ans = 0;     for (int i = pattern.length() + 1; i < l; ++i) {       ans = max(ans, (long long int)Z[i]);     }     return ans;   }   void getZarr(string str, int Z[]) {     int n = str.length();     int L, R, k;     L = R = 0;     for (int i = 1; i < n; ++i) {       if (i > R) {         L = R = i;         while (R < n && str[R - L] == str[R]) R++;         Z[i] = R - L;         R--;       } else {         k = i - L;         if (Z[k] < R - i + 1)           Z[i] = Z[k];         else {           L = i;           while (R < n && str[R - L] == str[R]) R++;           Z[i] = R - L;           R--;         }       }     }   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     long long int n, a, b;     cin >> n >> a >> b;     string s;     cin >> s;     vector<vector<long long int> > pre(n + 1, vector<long long int>(1, -1)),         dp(n + 1, vector<long long int>(n + 1, -1));     string s1 =   ;     for (long long int l = 1; l < n; l++) {       long long int min1 = min(l, n - l);       s1 += s[l - 1];       string s2 =   ;       for (long long int idx = l; idx < (l + min1); idx++) {         s2 += s[idx];       }       long long int len = get_len(s1, s2);       pre[l][0] = len;     }     cout << solve(s, pre, dp, 0, n - 1, a, b) << endl;     return 0;   }   