Cod sursa(job #2639658)

Utilizator StasBrega Stanislav Stas Data 3 august 2020 13:31:43
Problema Hashuri Scor 70
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.54 kb
#include <bits/stdc++.h>

#define pb push_back
#define ll unsigned long long int

using namespace std;

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

unordered_set <int> s;
int n;

int main()
{

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    fin >> n;

    while(n--) {
        int x, y;
        fin >> x >> y;
        if(x==1)
            s.insert(y);
        else if(x==2)
            s.erase(y);
        else
            fout << int(s.find(y) != s.end()) << "\n";
    }

	return 0;

}