Pagini recente » Cod sursa (job #1673652) | Cod sursa (job #3200664) | Cod sursa (job #2825533) | Cod sursa (job #1651048) | Cod sursa (job #1507929)
#include <fstream>
#include <iostream>
#include <unordered_set>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
unordered_set<int> myhash;
int main() {
int n=1, op, val;
fin >> n;
for (int i = 1; i<= n; i++ ) {
fin >> op >> val;
cout << op << val;
if (op == 1) {
myhash.insert(val);
}
if (op == 2) {
myhash.erase(val);
}
if (op == 3) {
fout << (myhash.find(val) != myhash.end()) <<'\n';
}
}
fin.close();
fout.close();
return 0;
}