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.
#include<cmath>#include<cstdio>#include<vector>#include<iostream>#include<set>#include<algorithm>usingnamespacestd;intmain(){/* Enter your code here. Read input from STDIN. Print output to STDOUT */intQ;cin>>Q;set<int>s;for(inti=0;i<Q;i++){intqueryType,queryValue;cin>>queryType>>queryValue;if(queryType==1){s.insert(queryValue);}elseif(queryType==2){s.erase(queryValue);}elseif(queryType==3){set<int>::iteratorit=s.find(queryValue);if(it!=s.end()){cout<<"Yes"<<endl;}else{cout<<"No"<<endl;}}}return0;}
#include<cmath>#include<cstdio>#include<vector>#include<iostream>#include<set>#include<algorithm>usingnamespacestd;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++){intquery;intx;cin>>query;cin>>x;switch(query){case1:s.insert(x);break;case2:s.erase(x);break;case3:autoitr=s.find(x);if(itr!=s.end()){cout<<"Yes"<<endl;}else{cout<<"No"<<endl;}break;}}return0;}
#include<cmath>#include<cstdio>#include<vector>#include<iostream>#include<set>#include<algorithm>usingnamespacestd;intmain(){/* Enter your code here. Read input from STDIN. Print output to STDOUT */size_tQ,y,x;cin>>Q;set<size_t>numbers;for(;Q>0;Q--){cin>>y>>x;switch(y){case1:numbers.insert(x);break;case2:numbers.erase(x);break;case3:{autoit=numbers.find(x);cout<<(it==numbers.end()?"No":"Yes")<<endl;}break;}}return0;}
include
include
include
include
include
include
using namespace std;
int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */
int n,x,y; cin>>n; sets; for(int i=0;i>x>>y; if(x==1) s.insert(y); else if(x==2) s.erase(y); else{ set::iterator itr = s.find(y); if(itr!=s.end()) cout<<"Yes"<
}
here is my solution
include
include
include
include
include
include
using namespace std;
int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ int q; set s; int x, y;
}
}