Cod sursa(job #1909923)
Utilizator | Data | 7 martie 2017 14:41:09 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.55 kb |
#include <cstdio>
#include <map>
using namespace std;
map <int,int> a;
int n,x,op;
int main()
{
freopen("hashuri.in","r",stdin);
freopen("hashuri.out","w",stdout);
scanf("%d",&n);
while(n)
{
scanf("%d%d",&op,&x);
if(op==1)
a[x]=1;
else
if(op==2)
a[x]=0;
else
{
if(!a[x])
printf("0\n");
else
printf("1\n");
}
n--;
}
return 0;
}