Cod sursa(job #811119)
| Utilizator | Data | 11 noiembrie 2012 15:45:06 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 30 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.43 kb |
#include<stdio.h>
#include<set>
#define H 32000
using namespace std;
set<short int> s[H+5];
int main()
{
freopen("hashuri.in","r",stdin);
freopen("hashuri.out","w",stdout);
int n,i,x,tip;
scanf("%d",&n);
for(i=1;i<=n;i++)
{
scanf("%d%d",&tip,&x);
if(tip==1) s[x%H].insert((short int)x/H);
if(tip==2) s[x%H].erase((short int)x/H);
if(tip==3) printf("%d\n",s[x%H].count((short int)x/H));
}
return 0;
}
