Cod sursa(job #2745521)

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

using namespace std;

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

unordered_map<int, int> h;
int n,c;
long long x;

int main()

{
	in>>n;
	for(int 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<<'\n';

            else
                out<<0<<'\n';

         }}

    return 0;

}