Cod sursa(job #1207046)

Utilizator azkabancont-vechi azkaban Data 11 iulie 2014 22:01:50
Problema Hashuri Scor 30
Compilator cpp Status done
Runda Arhiva educationala Marime 0.54 kb
#include <stdio.h>
#include <map>
using namespace std;
map <long,long> Hash;
long n,nr, i, tip, x,aux;
void openfile()
{
 freopen("hashuri.in","r",stdin);
 freopen("hashuri.out","w",stdout);
}
int main()
{
 openfile();
 scanf("%d",&n);
 for (i=1;i<=n;++i){
                   scanf("%d %d",&aux,&x);
                   if (aux==1 && Hash.find(x)==Hash.end()) Hash[x%666013]=++nr;
                   if (aux==2) Hash.erase(x);
                   if (aux==3) printf("%d\n",Hash.find(x)!=Hash.end());  
                   }
return 0;
}