func_code_string: #include <bits/stdc++.h>   using namespace std;   bool G[100005];   bool use[100005];   int top[100005];   int Top[100005];   char R[100005];   int num[100005];   int main() {     int m, n, Len = 0, useLen = 0;     char str[10];     memset(G, true, sizeof(G));     memset(use, false, sizeof(use));     scanf( %d%d , &n, &m);     int number = 0, last = 0;     for (int i = 0; i < m; i++) {       scanf( %s %d , str, &num[i]);       R[i] = str[0];     }     for (int i = 0; i < m; i++) {       int a;       str[0] = R[i];       a = num[i];       if (str[0] ==  + ) {         if (number != 0 || (Len != 0 && use[a] == false)) G[a] = false;         last = a;         number++;       }       if (str[0] ==  - ) {         if (use[a] == false) {           for (int i = Len - 1; i >= useLen; i--) {             G[Top[i]] = false;           }           useLen = Len;           if (number != 0 || (i != m - 1 && a != num[i + 1])) G[a] = false;         } else {           if (number > 1 || (number == 1 && i != m - 1 && num[i + 1] != a))             G[a] = false;           number--;         }       }       if (use[a] == false) {         Top[Len++] = a;         use[a] = true;       }     }     int sum = 0;     for (int i = 1; i <= n; i++)       if (G[i]) {         top[sum++] = i;       }     printf( %d n , sum);     if (sum > 0) {       for (int i = 0; i < sum - 1; i++) printf( %d  , top[i]);       printf( %d n , top[sum - 1]);     }     return 0;   }   