func_code_string: #include <bits/stdc++.h>   using namespace std;   struct node {     int len, l, r;     bool operator<(const node &a) const { return len > a.len; }   };   int day[200010];   int m[200010];   int main() {     int n, k, c, i, j;     scanf( %d %d , &n, &k);     c = 0;     for (i = 0; i < n; i++) {       scanf( %d , &day[i]);       if (day[i] < 0) c++;     }     if (c > k) {       printf( -1 n );       return 0;     }     int turn = 0;     bool f = 0;     priority_queue<node> q;     for (i = 0; i < n; i++) {       if (day[i] < 0) {         m[i] = 1;         k--;       }       if (!f && day[i] < 0) {         turn++;         f = 1;       }       if (f && day[i] >= 0) {         turn++;         f = 0;       }     }     int l = 0, r = 0;     i = 0;     while (m[i] == 0 && i < n) i++;     for (; i < n; i++) {       if (m[i] == 0) {         l = i;         while (m[i] == 0 && i < n) i++;         r = i - 1;         node tp;         tp.l = l, tp.r = r;         tp.len = r - l + 1;         q.push(tp);         i = i - 1;       }     }     int tt = turn, kk = k;     while (!q.empty()) {       node x = q.top();       q.pop();       if (k < x.len && kk < x.len)         break;       else {         if (k >= x.len) {           k -= x.len;           if (x.r != n - 1) {             turn -= 2;           } else             turn--;         }         if (kk >= x.len) {           if (x.r != n - 1) {             kk -= x.len;             tt -= 2;           }         }       }     }     printf( %d n , min(turn, tt));   }   