Cod sursa(job #2745986)

Utilizator jumpthenfallDan Florin jumpthenfall Data 27 aprilie 2021 12:42:11
Problema Hashuri Scor 0
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.47 kb
#include <bits/stdc++.h>
#include <ext/hash_set>
#include <iostream>
#include <fstream>

using namespace std;
using namespace __gnu_cxx;

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

long x, op, N ,i;

hash_set <long long> multime;

int main()
{
	f >> N;

	for (i = 0; i < N; i++)
	{
		f >> op >> x;
		if (op == 1)
			multime.insert(x);
		if (op == 2)
			multime.erase(x);
		if (op == 3)
			g << (multime.find(x) != multime.end()) << endl;
	}

}