Cod sursa(job #829712)
Utilizator | Data | 5 decembrie 2012 19:12:45 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.5 kb |
#include<cstdio>
#include<set>
#include<algorithm>
using namespace std;
int n,i,x,y;
set<int>myset;
int main()
{
freopen("hashuri.in","r",stdin);
freopen("hashuri.out","w",stdout);
scanf("%d",&n);
for (i=1;i<=n;i++)
{
scanf("%d %d",&x,&y);
switch (x)
{
case 1:
if (myset.count(y)==0) myset.insert(y);
break;
case 2:
if (myset.count(y)==1) myset.erase(y);
break;
case 3:
if (myset.count(y)) printf("1\n");else printf("0\n");
break;
}
}
return 0;
}