Cod sursa(job #2895356)
| Utilizator | Data | 28 aprilie 2022 23:38:33 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 70 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.72 kb |
#include <iostream>
#include <fstream>
#include <set>
using namespace std;
ifstream f ("hashuri.in");
ofstream g ("hashuri.out");
set <long long> v;
long long n, val;
int op;
int main()
{
f >> n;
for(long long i = 0; i < n; i++)
{
f >> op;
if(op == 1) {
f >> val;
if(v.find(val) == v.end())
v.insert(val);
}
if(op == 2) {
f >> val;
if(v.find(val) != v.end())
v.erase(val);
}
if(op == 3) {
f >> val;
if(v.find(val) != v.end())
g << 1 <<'\n';
else
g << 0 <<'\n';
}
}
return 0;
}
