func_code_string: #include <bits/stdc++.h>   using namespace std;   const long long mod = 1e9 + 7;   using namespace std;   string s;   long long ispalindroma[2005][2005];   long long ispalindrome(long long i, long long j) {     if (i > j) return (1);     if (i == j) return (1);     if (ispalindroma[i][j] != -1) return (ispalindroma[i][j]);     long long ans = 0;     if (s[i] == s[j]) {       ans = ispalindrome(i + 1, j - 1);     }     return (ispalindroma[i][j] = ans);   }   int solve() {     cin >> s;     long long sum[2005], dp[2005];     dp[0] = sum[0] = 0;     for (long long i = 0; i < 2005; i++) {       for (long long j = 0; j < 2005; j++) ispalindroma[i][j] = -1;     }     long long a1 = ispalindrome(0, s.size() - 1);     for (long long i = 0; i < s.size(); i++) {       long long c = 0;       for (long long j = 0; j <= i; j++) {         if (ispalindrome(j, i)) c++;       }       sum[i + 1] = sum[i] + c;     }     for (long long i = 0; i < s.size(); i++) {       long long ans = 0;       for (long long j = 0; j <= i; j++) {         if (ispalindrome(j, i)) ans = ans + sum[j];       }       dp[i + 1] = dp[i] + ans;     }     cout << dp[s.size()] <<   n ;     return 0;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     long long t;     t = 1;     while (t--) {       solve();     }   }   