We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
intmain(){/* Enter your code here. Read input from STDIN. Print output to STDOUT */set<int>s;intQ;cin>>Q;for(inti=0;i<Q;i++){pair<int,int>query;cin>>query.first>>query.second;intx=query.first;inty=query.second;if(x==1){s.insert(y);}elseif(x==2){s.erase(y);}elseif(x==3){set<int>::iteratorit=s.find(y);it==s.end()?cout<<"No\n":cout<<"Yes\n";}}return0;}
Cookie support is required to access HackerRank
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 →