Pagini recente » Cod sursa (job #1812532) | Cod sursa (job #2409069) | Istoria paginii runda/ms_x-xii/clasament | Cod sursa (job #767757) | Cod sursa (job #2330625)
#include <iostream>
#include <fstream>
#include <unordered_map>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
unordered_map <int,int> mp;
int main()
{
int n;
fin >> n;
while (n--)
{
int tip;
fin >> tip;
if (tip == 1)
{
int x;
fin >> x;
mp[x]++;
}
else if (tip == 2)
{
int x;
fin >> x;
mp[x].erase();
}
else{
int x;
fin >> x;
if (mp[x])
fout << "1\n";
else
fout << "0\n";
}
}
return 0;
}