#include #include #include #include using namespace std; const int maxnode = 1200001; const int maxsize = 26; //struct Trie //{ int ch[maxnode][maxsize]; int val[maxnode]; int sz; // Trie() // { // memset(ch, 0, sizeof(ch)); // sz = 1; // } void init() { //memset(ch, 0, sizeof(ch)); sz = 1; } int getId(char c) { return c - 'a'; } void insert(string str, int v) { int i; int u = 0; for(i=0; i> n; scanf("%d", &n); for(i=1; i<=n; i++) { scanf("%s", str1); scanf("%s", str2); //cin >> str1 >> str2; if(str1[0] == 'i'){ insert(str2, 1); } if(str1[0] == 'd'){ int t = query(str2); //cout << "t " << t << endl; if(t > 0){ delete1(str2, t); } } if(str1[0] == 's'){ if(query(str2) > 0){ printf("Yes\n"); } else{ printf("No\n"); } } } return 0; }