Cod sursa(job #1337710)
| Utilizator | Data | 9 februarie 2015 13:28:24 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 70 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.45 kb |
#include <stdio.h>
#include <set>
using namespace std;
set <int> s;
int main(){
freopen("hashuri.in","r",stdin);
freopen("hashuri.out","w",stdout);
int n, op, x, nr = 0;
scanf("%d", &n);
while(n--){
scanf("%d %d", &op, &x);
if(op == 1)
s.insert(x);
if(op == 2)
s.erase(x);
if(op == 3)
printf("%d\n",s.find(x) != s.end());
}
return 0;
}
