Cod sursa(job #1235818)
Utilizator | Data | 30 septembrie 2014 18:55:59 | |
---|---|---|---|
Problema | Hashuri | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.5 kb |
#include <cstdio>
#include <set>
#define P 100003
using namespace std;
int n,c,v,h;
set<int> T[P];
int main()
{
freopen("hashuri.in","r",stdin);
freopen("hashuri.out","w",stdout);
scanf("%d",&n);
for(;n;n--)
{
scanf("%d%d",&c,&v);
h=v%P;
if(c==1)
T[h].insert(v);
else
if(c==2)
T[h].erase(v);
else
printf("%d",T[h].find(v)!=T[h].end());
}
return 0;
}