func_code_string: #include <bits/stdc++.h>   using namespace std;   int dp[2100][2100] = {0};   int a[2100];   bool vis[2100][2100];   int main(int argc, const char* argv[]) {     string s, p;     cin >> s >> p;     for (int i = 0; i < s.size(); ++i) {       int tmp = 0;       int l = 0;       while (i + tmp < s.size() && l < p.size()) {         if (s[i + tmp] == p[l]) {           ++l;         }         ++tmp;       }       if (l == p.size()) {         a[i] = tmp;       } else         a[i] = -1;     }     for (int i = 0; i < s.size(); ++i) {       for (int j = 0; j <= i; ++j) {         dp[i + 1][j] = max(dp[i + 1][j], dp[i][j]);         dp[i + 1][j + 1] = max(dp[i + 1][j + 1], dp[i][j]);         if (a[i] != -1 && i + a[i] <= s.size() &&             j + a[i] - p.size() + 1 <= i + a[i] + 1) {           dp[i + a[i]][j + a[i] - p.size()] =               max(dp[i + a[i]][j + a[i] - p.size()], dp[i][j] + 1);         }       }     }     for (int i = 0; i <= s.size(); ++i) {       cout << dp[s.size()][i] <<    ;     }     cout << endl;     return 0;   }   