Pagini recente » Cod sursa (job #2472473) | Cod sursa (job #2187759) | Cod sursa (job #2145111) | Cod sursa (job #2734755) | Cod sursa (job #1289836)
#include <iostream>
#include <fstream>
#include <unordered_map>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int n, nr, type, x;
unordered_map<int, int> m;
int main()
{
f >> n;
nr = 0;
for(int i = 0; i < n; ++i)
{
f >> type >> x;
if(type == 1 && m.find(x) == m.end())
m[x] = nr++;
if(type == 2)
m.erase(x);
if(type == 3)
g << (m.find(x) != m.end()) << "\n";
}
}