Cod sursa(job #679624)
| Utilizator | Data | 13 februarie 2012 16:30:46 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 70 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.46 kb |
#include <cstdio>
#include <set>
using namespace std;
#define file_in "hashuri.in"
#define file_out "hashuri.out"
int Q,Tip,X;
set<int> S;
int main(){
freopen(file_in,"r",stdin);
freopen(file_out,"w",stdout);
scanf("%d", &Q);
while(Q--){
scanf("%d %d", &Tip, &X);
if (Tip==1){
S.insert(X);
}
else
if (Tip==2){
S.erase(X);
}
else{
printf("%d\n", S.find(X)!=S.end());
}
}
return 0;
}