Cod sursa(job #2951897)
Utilizator | Data | 7 decembrie 2022 19:55:11 | |
---|---|---|---|
Problema | Hashuri | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.49 kb |
#include <fstream>
#include <set>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
set <int> a;
int tip, x, n;
int main()
{
fin >> n;
for(int i = 0; i < n ; i++)
{
fin >> tip >> x;
if(tip == 1)
{
a.insert(x);
}
else if(tip == 2)
{
a.erase(x);
}
else
{
fout << a.count(x) << '\n';
}
}
return 0;
}