Cod sursa(job #2941163)

Utilizator EasyTnsEasyTns EasyTns Data 17 noiembrie 2022 11:05:29
Problema Hashuri Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.58 kb
#include<fstream>
#include<vector>
#include<cstring>
#include<algorithm>
#include <unordered_map>
//#include<iostream>
using namespace std;
ifstream cin("hashuri.in");
ofstream cout("hashuri.out");
using namespace std;
unordered_map<int,int>h;
int n;
int main()
{
    int x;
cin>>n;
for(;n;n--)
{
    cin>>x;
    if(x==1)
    {
        cin>>x;
        h[x]++;
    }
    else
        if(x==2)
        {
            cin>>x;
            h[x]--;
        }
        else
        {
            cin>>x;
            if(h[x]>=1)
                cout<<1<<'\n';
            else cout<<0<<'\n';
        }
}
}