Cod sursa(job #2745655)

Utilizator GhiuzanuEdward Ghiuzan Ghiuzanu Data 26 aprilie 2021 21:10:30
Problema Hashuri Scor 70
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.41 kb
#include <bits/stdc++.h>
using namespace std;

ifstream fin ("hashuri.in");
ofstream fout ("hashuri.out");

unordered_map<int, int> hashuri;
int n,y;
long long x;

int main()
{
    fin>>n;
    for(int i=1;i<=n;i++)
    {
        fin>>y>>x;
        if(y == 1)
            hashuri[x]=1;
        else if(y == 2)
            hashuri.erase(x);
        else if(y == 3)
            fout<<hashuri[x]<<endl;
    }
    return 0;
}