func_code_string: #include <bits/stdc++.h>   using namespace std;   int tree[1000000 + 5], a[1000000 + 5], data[1000000 + 5], rear, sum;   int lowbit(int x) { return (x & -x); }   void modify(int x, int value) {     for (int i = x; i <= 1000000; i += lowbit(i)) tree[i] += value;     return;   }   int query(int x) {     int sum = 0;     for (int i = x; i; i -= lowbit(i)) sum += tree[i];     return sum;   }   void del(int rear, int x) {     int l = 1, r = rear, mid;     while (l < r) {       mid = (l + r) / 2;       if (query(mid) < x)         l = mid + 1;       else         r = mid;     }     modify(l, -1);     data[l] = -1;     return;   }   int main() {     int n, m, i, j, ch;     scanf( %d%d , &n, &m);     for (i = 1; i <= m; i++) scanf( %d , &a[i]);     a[i] = 1000005;     for (i = 1; i <= n; i++) {       scanf( %d , &ch);       if (ch == -1) {         for (j = 1; a[j] <= sum; j++) del(rear, a[j] - j + 1);         sum -= (j - 1);       } else {         modify(++rear, 1);         data[rear] = ch;         sum++;       }     }     if (!sum)       printf( Poor stack! n );     else {       for (i = 1; i <= rear; i++)         if (data[i] != -1) printf( %d , data[i]);       printf(  n );     }     return 0;   }   