Pagini recente » Cod sursa (job #1233980) | Cod sursa (job #162717) | Cod sursa (job #1983683) | Cod sursa (job #1083305) | Cod sursa (job #1195880)
#include <iostream>
#include <fstream>
#include <map>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int N,op,x;
map <int,int> hash;
int main()
{
f >> N;
for (int i=1; i<=N ; i++)
{
f >> op >> x;
if (op == 1 && hash.find(x) == hash.end()) hash[x] = 1;
if (op == 2 ) hash.erase(x);
if (op == 3 ) g << (hash.find(x) != hash.end()) << '\n';
}
return 0;
}