Pagini recente » Cod sursa (job #1819125) | Cod sursa (job #1767623) | Cod sursa (job #232067) | Cod sursa (job #1564673) | Cod sursa (job #2075120)
#include <iostream>
#include <hash_map>
#include <fstream>
using namespace std;
using namespace __gnu_cxx;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
int n, op, x;
int main()
{
hash_map<int, bool> hashTable;
fin>>n;
while (n) {
fin>>op>>x;
switch (op) {
case 1:
hashTable.insert({x, 1});
break;
case 2:
// if (hashTable.count(x))
hashTable.erase(x);
break;
case 3:
if (hashTable.count(x))
fout<<hashTable[x]<<"\n";
else
fout<<0<<"\n";
break;
}
n--;
}
return 0;
}