Pagini recente » Cod sursa (job #947189) | Cod sursa (job #1156414) | Cod sursa (job #1254390) | Cod sursa (job #2597269) | Cod sursa (job #733969)
Cod sursa(job #733969)
#include<cstdio>
#include<tr1/unordered_set>
using namespace std::tr1;
unordered_set<int> hs;
int main()
{
freopen ("hashuri.in","r",stdin);
freopen ("hashuri.out","w",stdout);
int n;
scanf ("%d",&n);
while(n--){
int x,y;
scanf ("%d %d",&x,&y);
switch(x){
case 1:
hs.insert (y);
break;
case 2:
hs.erase (y);
break;
case 3:
printf ("%lu\n",hs.count (y));
break;
}
}
return 0;
}