Pagini recente » Cod sursa (job #1210689) | Cod sursa (job #971820) | Cod sursa (job #1344415) | Cod sursa (job #1022816) | Cod sursa (job #2123218)
#include <bits/stdc++.h>
using namespace std;
unordered_map < int, int > mp;
int main()
{
ios::sync_with_stdio(0); cin.tie(0);
ifstream in("hashuri.in");
ofstream out("hashuri.out");
int key = 1, el, n,qw;
in >> n ;
for(int i=1; i<=n; i++)
{
in >> qw >> el;
if( qw == 1 && mp.find(el) == mp.end() ) mp[el] = key;
if( qw == 2 ) mp.erase(el);
if( qw == 3 ) if( mp.find(el) != mp.end() ) out <<1 << '\n'; else out << 0 << '\n';
key ++;
}
return 0;
}