Cod sursa(job #1307242)
Utilizator | Data | 1 ianuarie 2015 18:37:18 | |
---|---|---|---|
Problema | Hashuri | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.42 kb |
#include <fstream>
#include <unordered_set>
using namespace std;
int main() {
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
int t; fin >> t;
unordered_set<int> h;
for (int op, x; t--;) {
fin >> op >> x;
if (op == 1)
h.insert(x);
else if (op == 2)
h.erase(x);
else
fout << h.count(x) << '\n';
}
return 0;
}