You are viewing a single comment's thread. Return to all comments →
My C++ code
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> #include <set> using namespace std; int main() { int query{0}; std::cin>>query; std::set<int> set_x; for(int i = 0;i < query;i++) { int x(0),y(0); std::cin>>x; std::cin>>y; if(x == 1) { set_x.insert(y); }else if(x == 2) { set_x.erase(y); }else { if(set_x.find(y) != set_x.end()) { std::cout<<"Yes\n"; }else { std::cout<<"No\n"; } } } return 0; }
Seems like cookies are disabled on this browser, please enable them to open this website
Sets-STL
You are viewing a single comment's thread. Return to all comments →
My C++ code