Pagini recente » Cod sursa (job #678716) | Cod sursa (job #108395) | Cod sursa (job #2762656) | Cod sursa (job #2216022) | Cod sursa (job #627765)
Cod sursa(job #627765)
#include<fstream>
#include<iostream>
#include<tr1/unordered_map>
using namespace std;
using namespace tr1;
unordered_map <int,int> h;
int main() {
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int n;
f >> n;
int t, x;
for (int i = 1; i <= n; i++) {
f >> t >> x;
if (t == 1) {
h[x]++;
} else if (t == 2) {
h.erase(x);
} else {
g << (h.find(x) != h.end()) << '\n';
}
}
return 0;
}