Cod sursa(job #731196)
| Utilizator | Data | 7 aprilie 2012 18:03:21 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 70 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.52 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, a;
scanf("%d", &n);
while(n--)
{
scanf("%d %d", &op, &a);
switch(op)
{
case 1: s.insert(a); break;
case 2: if(s.count(a)) s.erase(a); break;
case 3: printf("%d\n", s.count(a)); break;
}
}
fclose(stdin);
fclose(stdout);
return 0;
}
