Pagini recente » Cod sursa (job #107697) | Cod sursa (job #1921412) | Clasament preONI 2007, Clasa a 9-a si gimnaziu | Cod sursa (job #481850) | Cod sursa (job #1155700)
#include <iostream>
#include <fstream>
#include <map>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int n, nr, type, x;
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";
}
}