You are viewing a single comment's thread. Return to all comments →
int main() { set s; int q; int a; int y; cin>>q; while(q>0){ cin>>a; if(a==1){ cin>>y;
s.insert(y); } else if(a==2){ cin>>y; auto it=s.find(y); if(it!=s.end()){ s.erase(*it); } else{ continue; } } else if(a==3){ cin>>y; auto itr=s.find(y); if(itr!=s.end()){ cout<<"Yes"<<endl; } else{ cout<<"No"<<endl; } } q--; } 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 →
int main() { set s; int q; int a; int y; cin>>q; while(q>0){ cin>>a; if(a==1){ cin>>y;
}