Cod sursa(job #2442594)

Utilizator GabyD002Dobrita Gabriel GabyD002 Data 24 iulie 2019 14:38:19
Problema Hashuri Scor 20
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.39 kb
#include <bits/stdc++.h>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");

map <int,int> m;

int main()
{   int n;
    f>>n;
    while(n--)
    {   int t,x;
        f>>t>>x;
        if(t==1 && m.find(x)==m.end()) m[x]=1;
            else
                if(t==2) m.erase(x);
                    else g<<!(m.find(x)==m.end())<<'\n';
    }
    return 0;
}