Cod sursa(job #2003665)

Utilizator dumitrescu_andreiDumitrescu Andrei dumitrescu_andrei Data 23 iulie 2017 15:45:19
Problema Hashuri Scor 70
Compilator cpp Status done
Runda Arhiva educationala Marime 0.38 kb
#include <bits/stdc++.h>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");

int n,nr=1;
map <int,int> h;

int main()
{
    f>>n;
    for(int i=1;i<=n;++i)
    {
        int x,y;
        f>>x>>y;
        if(x==1 && h.find(y)==h.end()) h[y]=nr++;
        if(x==2) h.erase(y);
        if(x==3) g<<(h.find(y)!=h.end())<<'\n';


    }
    return 0;
}