Cod sursa(job #424999)
Utilizator | Data | 25 martie 2010 13:31:39 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.42 kb |
//#include "stdafx.h"
#include<stdio.h>
#include<set>
using namespace std;
set <int> x;
int i,n,k,p;
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) x.insert(p);
if (k==2) x.erase(p);
if (k==3)
if (x.find(p)!=x.end())
printf("1\n");
else
printf("0\n");
}
return 0;
}