func_code_string: #include <bits/stdc++.h>   #pragma GCC optimize( O2,Ofast,inline,unroll-all-loops,-ffast-math )   #pragma GCC target( avx,sse2,sse3,sse4,popcnt )   using namespace std;   int nxt[100010][26], f[255][255][255], pos[26], n, q, a = 0, b = 0, c = 0;   char s[100010], A[255], B[255], C[255];   template <class T>   void read(T &x) {     char ch = x = 0;     bool fl = false;     while (!isdigit(ch)) fl |= ch ==  - , ch = getchar();     while (isdigit(ch)) x = x * 10 + ch -  0 , ch = getchar();     x = fl ? -x : x;   }   int main() {     read(n), read(q), scanf( %s , s + 1);     for (int i = 0; i < 26; i++) {       pos[i] = n + 1;     }     memcpy(nxt[n + 1], pos, sizeof(pos));     for (int i = n; ~i; i--) {       memcpy(nxt[i], pos, sizeof(pos)), pos[s[i] -  a ] = i;     }     char op[10];     for (int i = 1, x; i <= q; i++) {       scanf( %s , op);       if (op[0] ==  + ) {         read(x), scanf( %s , op);         if (x == 1) {           A[++a] = op[0];           for (int b = 0; b <= ::b; b++) {             for (int c = 0; c <= ::c; c++) {               f[a][b][c] = 1 << 30;               if (a)                 f[a][b][c] = min(f[a][b][c], nxt[f[a - 1][b][c]][A[a] -  a ]);               if (b)                 f[a][b][c] = min(f[a][b][c], nxt[f[a][b - 1][c]][B[b] -  a ]);               if (c)                 f[a][b][c] = min(f[a][b][c], nxt[f[a][b][c - 1]][C[c] -  a ]);             }           }         }         if (x == 2) {           B[++b] = op[0];           for (int a = 0; a <= ::a; a++) {             for (int c = 0; c <= ::c; c++) {               f[a][b][c] = 1 << 30;               if (a)                 f[a][b][c] = min(f[a][b][c], nxt[f[a - 1][b][c]][A[a] -  a ]);               if (b)                 f[a][b][c] = min(f[a][b][c], nxt[f[a][b - 1][c]][B[b] -  a ]);               if (c)                 f[a][b][c] = min(f[a][b][c], nxt[f[a][b][c - 1]][C[c] -  a ]);             }           }         }         if (x == 3) {           C[++c] = op[0];           for (int a = 0; a <= ::a; a++) {             for (int b = 0; b <= ::b; b++) {               f[a][b][c] = 1 << 30;               if (a)                 f[a][b][c] = min(f[a][b][c], nxt[f[a - 1][b][c]][A[a] -  a ]);               if (b)                 f[a][b][c] = min(f[a][b][c], nxt[f[a][b - 1][c]][B[b] -  a ]);               if (c)                 f[a][b][c] = min(f[a][b][c], nxt[f[a][b][c - 1]][C[c] -  a ]);             }           }         }       } else {         read(x);         if (x == 1) a--;         if (x == 2) b--;         if (x == 3) c--;       }       puts(f[a][b][c] <= n ?  YES  :  NO );     }     return 0;   }   