Cod sursa(job #2745510)

Utilizator Marie02THGStanescu Maria Raluca Marie02THG Data 26 aprilie 2021 17:25:45
Problema Hashuri Scor 70
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.52 kb
#include <bits/stdc++.h>

using namespace std;

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


int main()

{
    unordered_map<int, int> h;
    int n,c,i;
    long long x;
	in>>n;
	for(i=1;i<=n;i++)
	{

        in>>c>>x;

        if(c == 1)
	    { h[x]=1; }
        else if(c == 2)
	    {  h.erase(x); }
        else if(c == 3)
	    {

            if(h.find(x) != h.end())
	              out<<1<<endl;

            else
                out<<0<<endl;

         }}

    return 0;

}