Cod sursa(job #1438249)
| Utilizator | Data | 19 mai 2015 14:34:25 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.55 kb |
#include <fstream>
#include <unordered_set>
using namespace std;
int main()
{
ifstream in("hashuri.in");
ofstream out("hashuri.out");
unordered_set<int> set;
int n, op, val;
in >> n;
while (n--)
{
in >> op >> val;
switch (op)
{
case 1:
set.emplace(val);
break;
case 2:
set.erase(val);
break;
case 3:
out << (set.find(val) != set.end()) << '\n';
break;
}
}
}
