Pagini recente » Cod sursa (job #1661428) | Cod sursa (job #619860) | Cod sursa (job #402855) | Cod sursa (job #2135167) | Cod sursa (job #1641443)
#include <fstream>
#include <unordered_set>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int x, nrquiz, type;
unordered_set < int > s;
int main()
{
f >> nrquiz;
while (nrquiz)
{
nrquiz --;
f >> type >> x;
if (type == 1)
s.insert(x);
if (type == 2)
s.erase(x);
if (type == 3)
g << (s.find(x) != s.end()) << '\n';
}
return 0;
}