Cod sursa(job #1195920)
| Utilizator | Data | 8 iunie 2014 11:37:35 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 70 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.46 kb |
#include <map>
#include <stdio.h>
using namespace std;
int N,op,x;
map <int,int> M;
int main()
{
freopen("hashuri.in", "r",stdin);
freopen("hashuri.out", "w" , stdout);
scanf("%d ",&N);
for (int i=1; i<=N ; i++)
{
scanf("%d %d",&op,&x);
if (op == 1 && M.find(x) == M.end()) M[x] = x;
if (op == 2 ) M.erase(x);
if (op == 3 ) printf("%d\n",M.find(x) != M.end());
}
return 0;
}
