Pagini recente » Cod sursa (job #1332618) | Cod sursa (job #1721463) | Cod sursa (job #1121811) | Cod sursa (job #2984235) | Cod sursa (job #1155699)
#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> hash;
int main()
{
f >> n;
nr = 0;
for(int i = 0; i < n; ++i)
{
f >> type >> x;
if(type == 1 && hash.find(x) == hash.end())
hash[x] = nr++;
if(type == 2)
hash.erase(x);
if(type == 3)
g << (hash.find(x) != hash.end()) << "\n";
}
}