Cod sursa(job #674307)
Utilizator | daniel Daniel30 | Data | 5 februarie 2012 23:33:38 |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.43 kb |
#include<cstdio>
#include<set>
using namespace std;
#define FC(i) for(scanf("%d",&i);i;--i)
set<int > a;
int n,x,y;
int main()
{freopen("hashuri.in","rt",stdin);
freopen("hashuri.out","wt",stdout);
FC(n)
{scanf("%d%d",&x,&y);
int exp=a.count(y);
switch(x)
{case 1 : a.insert(y);break;
case 2 : a.erase(y);break;
case 3 : if(exp>0) printf("1\n"); else printf("0\n");break;
}
}
return 0;
}