Cod sursa(job #1764913)
| Utilizator | Data | 26 septembrie 2016 09:00:48 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 70 |
| Compilator | cpp | Status | done |
| Runda | cerculdeinfo-lectia1-hashuri.rabinkarp | Marime | 0.73 kb |
#include<cstdio>
#include<map>
std::map<int,int> v;
int main()
{
freopen("hashuri.in","r",stdin);
freopen("hashuri.out","w",stdout);
int n;
scanf("%d ",&n);
for(int i=1;i<=n;i++)
{
int op,param;
scanf("%d %d ",&op,¶m);
switch(op)
{
case 1:
{
v[param]=1;
break;
};
case 2:
{
v.erase(param);
break;
};
case 3:
{
printf("%d\n",v.find(param)!=v.end());
};
}
}
return 0;
}
