Pagini recente » Cod sursa (job #2313452) | Cod sursa (job #2433415) | Cod sursa (job #210006) | Cod sursa (job #1982546) | Cod sursa (job #1982547)
#include <bits/stdc++.h>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
unordered_map <int, int>a;
int n, Nr, x;
void Rezolva(int tip, int x)
{
if(tip == 1)
if(a.find(x) == a.end())
a[x] = Nr;
if(tip == 2)
a.erase(x);
if(tip == 3)
fout << (a.find(x) != a.end()) << "\n";
}
void Citire()
{
int i, tip;
fin >> n;
for(i = 1; i <= n; i++)
{
fin >> tip >> x;
Rezolva(tip, x);
}
}
int main()
{
Citire();
return 0;
}