func_code_string: #include <bits/stdc++.h>   using namespace std;   int main() {     ios_base::sync_with_stdio(0);     int n, s, k, a[55], dp[55][2505];     cin >> n >> s >> k;     for (int i = 0; i < n; i++) cin >> a[i];     string s1;     cin >> s1;     priority_queue<pair<int, pair<int, int> > > q;     s--;     for (int i = 0; i < 55; i++)       for (int j = 0; j < 2505; j++) dp[i][j] = 1e7 + 7;     for (int i = 0; i < n; i++) {       dp[i][a[i]] = abs(i - s);       q.push(make_pair(abs(i - s), make_pair(i, a[i])));     }     while (!q.empty()) {       pair<int, pair<int, int> > p = q.top();       q.pop();       int dd = p.first;       int at = p.second.first;       int choc = p.second.second;       for (int i = 0; i < n; i++) {         if (a[i] > a[at] && s1[i] != s1[at]) {           int dis = abs(i - at);           if (dp[at][choc] + dis < dp[i][choc + a[i]]) {             dp[i][choc + a[i]] = dp[at][choc] + dis;             q.push(make_pair(-dp[i][choc + a[i]], make_pair(i, choc + a[i])));           }         }       }     }     int ans = 1e7 + 7;     for (int i = 0; i < n; i++)       for (int j = k; j <= 2505; j++) ans = min(ans, dp[i][j]);     if (ans > 1e6)       cout <<  -1 ;     else       cout << ans;     return 0;   }   