Pagini recente » Cod sursa (job #167737) | Cod sursa (job #1022261) | Cod sursa (job #758996) | Cod sursa (job #1177551) | Cod sursa (job #2738975)
#include <iostream>
#include <fstream>
#include <map>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
int main() {
int n, x, op;
map<int, int> m;
fin >> n;
for(int i=0; i<n; ++i)
{
fin >> op >> x;
if (op == 1)
{
if(m.count(x) == 0)
m[x] = 1;
}
else if (op == 2)
{
if(m.count(x) != 0)
m.erase(x);
}
else
{
if( m.count(x)!= 0)
fout << 1 << "\n";
else
fout << 0 << "\n";
}
}
return 0;
}