Pagini recente » Cod sursa (job #1064549) | Cod sursa (job #1898082) | Cod sursa (job #1666896) | Cod sursa (job #638414) | Cod sursa (job #1639374)
#include <iostream>
#include <fstream>
#include <map>
using namespace std;
ifstream fin ("hashuri.in");
ofstream fout ("hashuri.out");
map <int, int> hsh;
int N, M;
int main()
{
fin >>N;
for (int i = 1; i <= N; ++i)
{
int type, x;
fin >>type >>x;
if (type == 1)
if (hsh.find(x) == hsh.end())
hsh[x] = ++M;
if (type == 2)
hsh.erase(x);
if (type == 3)
fout <<((hsh.find(x) != hsh.end()) ? (1):(0)) <<'\n';
}
fout.close();
return 0;
}