func_code_string: #include <bits/stdc++.h>   using namespace std;   int main() {     int n, m;     cin >> n >> m;     vector<pair<int, bool> > list(n);     for (int i = 0; i < n; i++) cin >> list[i].first;     int tmp;     for (int i = 0; i < m; i++) {       cin >> tmp;       list[tmp - 1].second = 1;     }     vector<int> v1(n - m), v2(m);     int c1 = 0, c2 = 0;     for (int i = 0; i < n; i++) {       if (list[i].second == 1)         v2[c1++] = list[i].first;       else         v1[c2++] = list[i].first;     }     sort(v1.begin(), v1.end());     sort(v2.begin(), v2.end());     c1 = c2 = 0;     long long cnt = 0;     for (int i = 0; i < v1.size(); i++) cnt += v1[i];     if (cnt < v2.back()) {       cnt += v2.back();       v2.back() = -1;     }     for (int i = 0; i < v2.size(); i++) {       if (v2[i] != -1) cnt *= 2;     }     cout << cnt;     return 0;   }   