Pagini recente » Cod sursa (job #2668033) | Cod sursa (job #2852850) | Cod sursa (job #2490183) | Cod sursa (job #1489537) | Cod sursa (job #1467273)
#include <fstream>
#include <map>
#include <unordered_map>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int nr_op, op;
unordered_map<int, int> H;
int main()
{
f>>nr_op;
for(int i = 1 ; i <= nr_op ; ++i )
{
int tip, x;
f>>tip>>x;
if ( tip == 1 && H.find(x) == H.end() )
H[x] = ++op;
if ( tip == 2 )
H.erase(x);
if ( tip == 3 )
g<<( H.find(x) != H.end() )<<'\n';
}
f.close();
g.close();
return 0;
}