Cod sursa(job #1045928)

Utilizator KostynGraur Petru-Costin Kostyn Data 2 decembrie 2013 12:54:44
Problema Hashuri Scor 100
Compilator cpp Status done
Runda Arhiva educationala Marime 0.47 kb
#include <fstream>
#include <unordered_map>
using namespace std;
ifstream cin("hashuri.in");
ofstream cout("hashuri.out");
unordered_map<int, int> h;
int t, x, n, i;
 
int main()
{
	h.reserve(7000);
    cin>>n;
    for(i=1; i<=n; i++)
    {
        cin>>t>>x;
        if(t==1 && h.find(x)==h.end()) h[x]=1;
        else
        if(t==2 && h.find(x)!=h.end()) h.erase(x);
        else
        if(t==3) cout<<(h.find(x)!=h.end())<<'\n';
    }
    return 0;
}