Cod sursa(job #1207097)

Utilizator azkabancont-vechi azkaban Data 12 iulie 2014 11:17:19
Problema Hashuri Scor 0
Compilator cpp Status done
Runda Arhiva educationala Marime 0.55 kb
#include <stdio.h>
#include <hash_map.h>
using namespace std;
hash_map <int,int,hash <int> > HASH;
int x,y,nr,n;
void openfile()
{
 freopen("hashuri.in","r",stdin);
 freopen("hashuri.out","w",stdout);
}
int main()
{
 openfile();
 scanf("%d",&n);
 while(n--){
            scanf("%d %d",&x,&y);
            switch(x){
                      case 1: ++HASH[y]; break;
                      case 2: HASH.erase(y); break;
                      case 3: printf("%d\n",HASH.end()!=HASH.find(y)); break;
                      }
        }
return 0;
}