Cod sursa(job #2911327)
Utilizator | Data | 28 iunie 2022 16:00:56 | |
---|---|---|---|
Problema | Hashuri | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.48 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
int n,o,x;
unordered_set<int> s;
int main()
{
fin>>n;
for(; n; n--)
{
fin>>o>>x;
if(o==1)
{
s.insert(x);
}
else if(o==2)
{
s.erase(x);
}
else if(s.find(x)==s.end())
fout<<"0\n";
else
fout<<"1\n";
}
return 0;
}