Pagini recente » Cod sursa (job #2479827) | Cod sursa (job #1669977) | Cod sursa (job #1859011) | Cod sursa (job #851108) | Cod sursa (job #1669317)
#include <iostream>
#include <fstream>
#include <unordered_set>
using namespace std;
ifstream fin ("hashuri.in");
ofstream fout ("hashuri.out");
unordered_set <int> h;
int main() {
ios_base::sync_with_stdio(false);
int op, n, x;
fin >> n;
while(n--) {
fin >> op >> x;
if(op==1) h.insert(x);
if(op==2) h.erase(x);
if(op==3) {
if(h.count(x) > 0) fout << "1\n";
else fout << "0\n";
}
}
fin.close();
fout.close();
return 0;
}