Pagini recente » Cod sursa (job #1269188) | Cod sursa (job #582036) | Cod sursa (job #2767588) | Cod sursa (job #2131983) | Cod sursa (job #2745627)
#include <iostream>
#include <fstream>
#include <unordered_map>
using namespace std;
unordered_map<long long, long long> h;
long long n, x, y;
int main() {
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
fin>>n;
for (int i = 0; i < n; ++i) {
fin>>y>>x;
if (y == 1)
h[x] = 1;
else if (y == 2)
h.erase(x);
else if (y == 3){
if(h.find(x) != h.end())
fout<<1<<endl;
else
fout<<0<<endl;
}
}
return 0;
}