You are viewing a single comment's thread. Return to all comments →
I am trying to run the following code. It runs fine for the first test case. But on submitting compiler is giving this message: Abort called
int Q; cin>>Q; set<int> s; int x[Q],y[Q]; for(int i = 0 ; i < Q ;i++){ cin>>y[i]>>x[i]; } for(int i = 0 ; i< Q; i++){ if(y[i] == 1){ s.insert(x[i]); } else if(y[i] == 2){ set<int>::iterator itr=s.find(x[i]); s.erase(itr); } else if(y[i]==3){ set<int>::iterator itr=s.find(x[i]); if(itr == s.end()) cout<<"No"<<"\n"; else cout<<"Yes"<<"\n"; } } return 0;
Sets-STL
You are viewing a single comment's thread. Return to all comments →
I am trying to run the following code. It runs fine for the first test case. But on submitting compiler is giving this message: Abort called