Cod sursa(job #1643104)

Utilizator gapdanPopescu George gapdan Data 9 martie 2016 17:34:58
Problema Hashuri Scor 10
Compilator cpp Status done
Runda Arhiva educationala Marime 0.44 kb
#include <unordered_map>
#include <cstdio>

using namespace std;

int T,x,t;
unordered_map<int,int>H;

int main()
{
    freopen("hashuri.in","r",stdin);
    freopen("hashuri.out","w",stdout);
    scanf("%d",&T);
    while(T>0)
    {
        scanf("%d%d",&t,&x);
        if(t == 1) ++H[x];
            else if(t==2) --H[x];
                else if(H[x]!=0) printf("1\n");
                    else printf("0\n");
        --T;
    }
    return 0;
}