Cod sursa(job #694500)

Utilizator Daniel30daniel Daniel30 Data 27 februarie 2012 21:21:04
Problema Hashuri Scor 70
Compilator cpp Status done
Runda Arhiva educationala Marime 0.4 kb
#include <cstdio>
#include <map>
using namespace std;
int n,nr,x,y;
map<int,int> M;
int main()
{freopen("hashuri.in", "rt", stdin);
 freopen("hashuri.out", "wt", stdout);
 scanf("%d ", &n);
 for (register int i = 1; i <= n; i++) 
	{scanf("%d%d ", &y, &x);
	 if (y==1 &&M.find(x)==M.end()) M[x]=++nr;
	 if (y==2) M.erase(x);
	 if (y==3) printf("%d\n", M.find(x) != M.end());
	}
 return 0;
}