Pagini recente » Cod sursa (job #1579010) | Cod sursa (job #1923528) | Cod sursa (job #2528983) | Cod sursa (job #237386) | Cod sursa (job #3246298)
#include <bits/stdc++.h>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
int n , op;
unordered_map<int , int> M;
int main()
{
int x;
fin >> n;
while(n--)
{
fin >> op >> x;
if(op == 1) M[x]++;
else if(op == 2) M.erase(x);
else if(M.find(x) != M.end()) fout << "1\n";
else fout << "0\n" ;
}
return 0;
}
/**
5 3
4 -2 2 = 0
3 -1 5 = 3
2 0 -3 = -5
4 1 -3 = -8
5 -3 2 = 0
-------
1 1 0
*/