Cod sursa(job #2788627)
Utilizator | Data | 26 octombrie 2021 09:24:20 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.52 kb |
#include <fstream>
#include <set>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
int main()
{
int t, op, val;
fin >> t;
set<int> s;
while (t-- > 0)
{
fin >> op >> val;
if (op == 1)
{
s.insert(val);
}
else if (op == 2)
{
s.erase(val);
}
else if (op == 3)
{
fout << ((s.find(val) != s.end()) ? 1 : 0) << "\n";
}
}
return 0;
}