Cod sursa(job #2911138)
Utilizator | Data | 27 iunie 2022 10:31:33 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.48 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
set<int> S;
int n,o,x;
int main()
{
f>>n;
for(; n; n--)
{
f>>o>>x;
if(o==1)
S.insert(x);
else if(o==2)
S.erase(x);
else
{
auto it=S.find(x);
if(it==S.end())
g<<"0\n";
else
g<<"1\n";
}
}
return 0;
}