Pagini recente » Cod sursa (job #1153334) | Cod sursa (job #2671441) | Cod sursa (job #2323566) | Cod sursa (job #1708675) | Cod sursa (job #1132133)
/// 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)
H[x]=true;
else if (tip==2)
H[x]=false;
else if (tip==3)
if (H[x])
g<<1<<'\n';
else
g<<0<<'\n';
}
f.close();
g.close();
return 0;
}