Cod sursa(job #2896368)

Utilizator RaresParleaParlea Costin-Rares-Calin RaresParlea Data 29 aprilie 2022 22:23:39
Problema Hashuri Scor 60
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.54 kb
#include <bits/stdc++.h>
#include<iostream>
#include<fstream>
using namespace std;
ifstream fin ("hashuri.in");
ofstream fout ("hashuri.out");

unordered_map<int, int> hashul;

long long x,c,n,i;
int main()
{
	fin>>n;
	for(i=1;i<=n;i++)
	{
        fin>>c>>x;
        if(c == 1)
           hashul[x]=1;
        else if(c == 2)
           hashul.erase(x);
        else if(c == 3)
            if(hashul.find(x) != hashul.end())
	              fout<<1<<endl;
            else
                fout<<0<<endl;
    }
    return 0;
}