Cod sursa(job #1729976)

Utilizator RG1999one shot RG1999 Data 15 iulie 2016 23:22:59
Problema Hashuri Scor 70
Compilator cpp Status done
Runda Arhiva educationala Marime 0.49 kb
#include <bits/stdc++.h>
using namespace std;
map <int,int > bgd;
using namespace std;
int n,i,v,x;
int main()
{
    freopen("hashuri.in","r",stdin);
    freopen("hashuri.out","w",stdout);
    scanf("%d",&n);
    for(i=1;i<=n;i++)
    {
        scanf("%d%d",&v,&x);
        if(v==1&&bgd[x]==0)
            bgd[x]=1;
        else
            if(v==2&&bgd[x]==1)
            bgd[x]=0;
        else
            if(v==3)
            printf("%d\n",bgd[x]);

    }
    return 0;
}