Cod sursa(job #425033)
Utilizator | Data | 25 martie 2010 14:02:43 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.46 kb |
//#include "stdafx.h"
#include<stdio.h>
#include<map>
using namespace std;
map <int , int> x;
int i,n,k,p,m;
int main()
{
freopen("hashuri.in","r",stdin);
freopen("hashuri.out","w",stdout);
scanf("%d",&n);
for (i=1;i<=n;i++)
{
scanf("%d%d",&k,&p);
if (k==1)
if (x.find(p)==x.end())
x[p]=++m;
if (k==2) x.erase(p);
if (k==3)
if (x.find(p)!=x.end())
printf("1\n");
else
printf("0\n");
}
return 0;
}