链接:Miku
--------------------
一个map干过去
-------------------
#include <map> #include <cstring> #include <cstdio> #include <cstdio> #include <algorithm> #include <iostream> using namespace std; string s, now; int n; map<string, bool> m; int main() { cin >> n; for (int i = 1; i <= n; ++i) { cin >> now; // cout<<now; if (now == "add") { getline(cin, s); // cout<<s; m[s] = 1; } else { getline(cin, s); if (m[s]) cout << "yes" << endl; else cout << "no" << endl; } } return 0; }