Cod sursa(job #1489963)
| Utilizator | Data | 22 septembrie 2015 14:59:47 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.51 kb |
#include <iostream>
#include <fstream>
#include <map>
using namespace std;
map<int,int> m;
int n,nr;
int main()
{
freopen("hashuri.in","r",stdin);
freopen("hashuri.out","w",stdout);
scanf("%d",&n);
int x,d;
for(int i=1;i<=n;i++)
{
scanf("%d %d",&d,&x);
if(d==1)
if(m.find(x)!=m.end())
m[x]=++nr;
if(d==2)
m.erase(x);
if(d==3)
printf("%d\n",m.find(x)==m.end());
}
return 0;
}
