Cod sursa(job #812654)
Utilizator | Data | 14 noiembrie 2012 09:56:55 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.48 kb |
#include <stdio.h>
#include <set>
#include <cstdlib>
using namespace std;
int n,op,x;
set <int> A;
int main()
{
freopen("hashuri.in", "r", stdin);
freopen("hashuri.out", "w", stdout);
for ( scanf("%d", &n); n ; n-- )
{
scanf("%d %d", &op, &x);
if ( op == 1 ) A.insert(x);
if ( op == 2 ) A.erase(x);
if ( op == 3 )printf("%d\n", A.find(x) != A.end());
}
return 0;
}