Pagini recente » Cod sursa (job #388396) | Cod sursa (job #341818) | Cod sursa (job #533734) | Borderou de evaluare (job #1523431) | Cod sursa (job #2123200)
#include <bits/stdc++.h>
using namespace std;
map < int, int > mp;
int main()
{
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;
}