Pagini recente » Cod sursa (job #2843953) | Cod sursa (job #707545) | Cod sursa (job #1207030) | Cod sursa (job #1281698) | Cod sursa (job #1132145)
/// Craciun Catalin
/// Hashuri
/// Arhiva educationala
/// www.infoarena.ro/problema/hashuri
#include <fstream>
#include <iostream>
#include <map>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
map<int, bool> H;
int main()
{
long n;
f>>n;
for (long i=1;i<=n;i++)
{
short tip;
long x;
f>>tip>>x;
if (tip==1)
{
if (H.find(x)==H.end())
H[x]=1;
}
else if (tip==2)
{
H.erase(x);
}
else if (tip==3)
{
if (H.find(x)!=H.end())
g<<1<<'\n';
else
g<<0<<'\n';
}
}
f.close();
g.close();
return 0;
}